Anda di halaman 1dari 5

ASIA PACIFIC INSTITUTE OF INNOVATION AND TECHNOLOGY TECHNOLOGY PARK MALAYSIA

TUTORIAL SHEET 9-8086- Answers MODULE CODE: EE008-3.5-3 MODULE LECTURER: SATHISH KUMAR SELVAPERUMAL MODULE NAME: MICROPROCESSOR SYSTEMS

1. Determine the physical address of the following logical address. a. 6A00H : 118H b. A300H : B120H c. 300H : A309H d. CS = 4800H, IP = 5235H e. ES = B200H, BX = 5012H Solution: 6A00H:118H Physical address = 6A000 + 0118 = 6A118H A300H:B120H Physical address = A3000 + B120 = AE120H 0300H:A309H Physical address = 03000 + A309 = 0D309H CS = 4800H, IP =5235H Physical address = 48000 + 5235 = 4D235H ES = B200H, BX = 5012H Physical address = B2000 + 5012 = B7012H

2. Determine the addressing mode for each of the following operations. a. MOV AX,DS Register addressing mode b. MOV BX,1234H Immediate addressing mode c. MOV CX,[2300] Direct addressing mode d. MOV AL,BH Register addressing mode e. MOV [DI],AX Register Indirect addressing mode f. MOV AH,[BX] Register Indirect addressing mode g. MOV [BP+6], AH Based relative addressing mode h. MOV BL,[SI]+4 Indexed addressing mode i. MOV [BP][SI]+5,AX Based Indexed plus displacement addressing mode j. MOV AH,[BX+SI+30] Based Indexed plus displacement addressing mode 3. Assume that the registers have the following values and that CS = 1000H, DS = 3000H, SS = 5000H, SI = 2560H, DI = A200H, BX = B304H, BP = 2378H, AX = AFFFH, CX = 9876H, and DX =

CA32H. Determine the logical and the physical address of the memory for each of the following instructions. a. MOV [BX][SI],AH b. MOV [23DEH],AX c. MOV [DI+30H],BL d. MOV [BP]+20H,CH e. MOV [BP][DI],DX Solution: (a) MOV [BX][SI],AH Logical address = DS:BX+SI = 3000:B304+2560 Physical address = 30000 + B304+2560= 3D864H (b) MOV [23DEH],AX Logical address = DS:25FF = 3000:23DE Physical address = 30000 + 23DE = 323DEH

(c) MOV [DI+30H],BL Logical address = DS:DI+30 = 3000:A200+30 Physical address = 30000 + A200 + 30= 3A230H

(d) MOV [BP]+20H,CH Logical address = SS:BP+20 = 5000:2378+20 Physical address = 50000 + 2378+20= 52398H (e) MOV [BP][DI],DX Logical address = SS:[BP+DI] = 5000: 2378 + A200 Physical address = 50000 + 2378 + A200 = 5C578H 4. Assume that SP = 3400H, AX = EA34H, BX = 1FAAH, and CX = 45H. Determine the content of the stack and stack pointer after the execution of each of the following instructions. PUSH AX PUSH CX PUSH BX

Solution:
SS : 33FA SS : 33FB SS : 33FC SS : 33FD SS : 33FE SS : 33FF SS : 3400 XX At Start SP = 3400H 34 EA XX After PUSH AX SP = 33FEH AX = EA34H 45 00 34 EA XX After PUSH AX SP = 33FCH CX = 45H AA 1F 45 00 34 EA XX After PUSH CX SP = 33FAH BX = 1FAAH

5. Determine the status of the following CF, PF, AF, ZF and SF for the following operations and describe the content of the respective register before and after the operation. (i) MOV BX, 2345H ADD BX, 7A2H

Before ADD BX, 7A2H => BX = 2345H After Addition => BX = 2AE7H CF, PF, AF, ZF , SF = 0, 0, 0, 0, 0

(ii)

MOV AX, A250H SUB AX, 341EH

Before SUB AX, 341EH => AX = A250H After Subtraction => AX = 6E32H

CF, PF, AF, ZF , SF = 0, 1, 1, 0, 0

(iii)

MOV AL, 22H MOV BL,38H ADD BL,AL

Before ADD BL,AL => AL = 22H AND BL = 38H After Addition => AL = 22H CF, PF, AF, ZF , SF = 0, 1, 0, 0, 0 6. If DS=3000H, CS=8000H, IP=345H, BX=F23H, Determine : (i) (ii) (iii) (iv) the logical addresses, the physical addresses, the lower range addresses, the upper range addresses of the given segments. AND BL = 5AH

Logical address CS:IP = 8000:0345 DS:BX = 3000:0F23

Physical address for CS:IP = 80000 + 0345 = 80345H Physical address for DS:BX = 30000 + F23 = 30F23H

Lower range address for CS:IP = 80000 + 0000 = 80000H Lower range address for DS:BX = 30000 + 0000 = 30000H

Upper range address for CS:IP = 80000 + FFFF = 8FFFFH Upper range address for DS:BX = 30000 + FFFF = 3FFFFH

Anda mungkin juga menyukai