You are on page 1of 4

ELEC 451 – Homework # 1

Q1. Assume that SP = FF2EH, AX = 3291H, BX = F43CH, and CX = 09. Find the contents of the stack and SP
after the execution of each of the following instructions.
PUSH AX FF28
PUSH BX FF29
PUSH CX
FF2A
FF2B
FF2C
FF2D
FF2E

After PUSH CX, SP=FF28H

Q2. Show the sequence of instructions needed to restore all the registers to their original values in Q1. Show the
content of SP at each point.
SP = FF28
Contents
POP CX (CX=0009H) SP = FF2AH
POP BX (CX=F43CH) SP =FF2CH
POP AX (CX=3291H) SP =FF2EH

Q3. Find the status of the CF, PF, AF, ZF, and SF for the following operations.
a) MOV BL, 9FH
ADD BL, 61H
b) MOV AL, 23H
ADD AL, 97H
A. CF=1, PF=1, AF=1, ZF=1, SF=0, B. CF=0, PF=0, AF=0, ZF=0, SF=1
Q4. Assume the registers have the following values (all in hex) and that CS = 1000, DS = 2000,
SS = 3000, SI = 4000, DI = 5000, BX = 6080, BP = 7000, AX = 25FF, CX = 8791, and DX =
1299. Calculate the physical address of the memory where the operand is stored and the
contents of the memory locations in each of the following addressing examples.

a) MOV [SI + BX + 8], AH


Physical address: 2A088H, Content: 25H

b) MOV [3600], AX
Physical address: 23600H, Content: FFH, Physical address: 23601H, Content: 25H

c) MOV [DI + BP + 100], AX


Physical address: 3C100H, Content: FFH, Physical address: 3C101H, Content: 25H

d) MOV [SI] + 50, AH


Physical address: 24050H, Content: FFH, Physical address: 24051H, Content: 25H

Q5. Show the contents of the memory locations after the execution of each instruction.
MOV BX, 129FH // BH=12H, BL=9FH
MOV [1450], BX
DS: 1450 . . . //9FH
DS: 1451 . . .//12H

Q6. Encode the following instructions by using the information in the tables.

a) MOV [BP][SI] + 12, AX


b) MOV AH, [BX + SI + 256]

You might also like