71) Match List I with List II
| List I (Assembly code) | List II (Content of register A after the code) |
|---|---|
A. MOV A, #37HCPL A |
I. 02H |
B. MOV A, #37HANL A, #8AH |
II. F7H |
C. MOV A, #37HORL A, #8AH |
III. FBH |
D. MOV A, #37HXRL A, #8AH |
IV. C8H |
Choose the correct answer from the options given below:
Solution
To solve this assembly code problem, we convert the hexadecimal values to 8-bit binary and apply bitwise logic operations.
Binary Conversions:
• Register A (
• Operand (
A. CPL A (Complement A)
• Register A (
37H) = 0011 0111• Operand (
0CAH) = 1100 1010
Flips every bit (NOT operation) of the original 37H.
| 37H | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 |
| Result | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 |
Binary 1100 1000 = C8H. Match: A → IV
Output is 1 only where both bits are 1.
| 37H | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 |
| 0CAH | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 |
| AND | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
Binary 0000 0010 = 02H. Match: B → I
Output is 1 if at least one bit is 1.
| 37H | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 |
| 0CAH | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 |
| OR | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Binary 1111 1111 = FFH. Match: C → III
Output is 1 only if the bits are different.
| 37H | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 |
| 0CAH | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 |
| XOR | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 |
Binary 1111 1101 = FDH. Match: D → II
Final Sequence: A-IV, B-I, C-III, D-II — (Option 1)