Exercise Boolean Operators in Assembly Language
PART A: TRUE/FALSE QUESTION (10 Marks)
1. The AND instruction in 8086 performs two operands T F
2. The OR instruction sets the destination operand to 1 if both bits of the operands T F
are 0
3. The NOT instruction inverts each bit of the operand T F
4. The XOR instruction in 8086 is used to compare whether two values are equal. T F
5. The NEG instruction can perform immediate addressing modes T F
6. Boolean instructions like AND, OR, and XOR affect the Zero Flag (ZF). T F
7. The AND instruction in 8086 can be used to clear specific bits in a register. T F
8. The NOT instruction affects the flags in the FLAGS register. T F
9. The NOT instruction affects the flags in the FLAGS register. T F
10. In 8086, Boolean operators can only be used on 16-bit operands. T F
PART B : Determine the content register and SF, PF and ZF for the following instructions (10
Marks)
AX BX SF PF ZF
MOV AX,93
MOV BL, -15
AND AL, BL
NOT AX
XOR BX, 29
OR AX, BX
NOT BX
AND AX, BX
ADD AL, BL
NEG BX
PART C: Write Assembly language code for the following arithmetic and logic operations.
Assume the Result is 16-bit mode operations. (10 Marks)
Result = (42/6) XOR (23*6)
Result dw ??