COAL - F23 Assignment#1
COAL - F23 Assignment#1
COAL
F23
b) Write the status of various flags after the execution of the ADD instruction. (6 Marks)
MOV AL, 0x80 OF ZF SF PF AF CF
ADD AL, AL 1 1 0 1 0 1
Question#2 (3 + 3 + 3 Marks)
Write set of instructions to store 0x0BAD in memory at physical address 0x07DE1 using the following addressing modes one by one.
a) Direct Addressing Mode
MOV DS, 0x07DE0
MOV [0x0001], 0x0BAD
Question#3
Which of the following instructions are incorrect. Provide reasons.
1. MOV 0X1234, AX Incorrect because you can’t move data from register to immediate(constant).
Page 1 of 2
Assignment#1
COAL
F23
2. MOV AX, [CX] Correct Because the value at the address pointed by CX can be moved. This is memory to register
addressing mode.
3. MOV AL, [BL + 4] Correct because it is the value pointed by BL with an offset of 4 bytes is stored in AL
4. ADD DX, [BX+DX+2] Incorrect because the ADD instruction expects both operands to be registers or immediate values,
5. MOV CS, AX Incorrect because CS(code segment) register is not directly modifiable in user-level code.
6. ADD NUM1, NUM2 Incorrect because NUM1and NUM2 are neither a register nor an immediate.
8. ADD AX, BL Correct because the instruction add the value of register BL and AX and store in AX.
10. MOV AX, [BP+BX] Correct because it is data movement from memory into register i.e address pointed by BP with an
11. MOV DX, [SI+DI] Correct because SI + DI value is taken as an address and the value pointed by that address is moved
to DX.
12. ADD BX, [NUMBER + CX] Incorrect because Number is not a true operand.
13. MOV [0X1234], BL Correct as it is Data movement from BL to the value memory address.
14. MOV AX, [BX+SI+4] Correct as it is data movement from the address pointed by Bx with an offset of SI + 4 into
AX.
Page 2 of 2