Question:

It is desired to mask the higher order bits (D7-D4) of the data bytes in register C. consider the following set of 8085 instruction,
(i) MOV A, C
ANI FOH
MOV C, A
HLT
(ii) MOV A, C
MVI B, FOH
ANA B
MOV C, A
HLT
(iii) MOV A, C
MVI B, 0FH
ANA B
MOV C, A
HLT
(iv) MOV A, C
ANI 0FH
MOV C, A
HLT

Show Hint

Know how to use logical operations like AND, OR, XOR, and NOT for setting, clearing, and complementing specific bits.
Updated On: Feb 27, 2025
  • (i) and (ii)
  • (iii) and (iv)
  • Only (i)
  • Only (iv)
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

To mask the higher order bits (D7-D4) of a byte means to set those bits to 0, while keeping the lower bits (D3-D0) unchanged. This can be done by performing a logical AND operation with a mask. 
(i) Correctly loads the content of register C into A. The instruction `ANI F0H` masks the higher order bits and saves the result back in A, and finally saves it back in C. 
(ii) Correctly masks the higher order bits using register B. The instruction `ANA B` does the same thing. 
(iii) Does not mask the higher order bits, as the MVI operation loads 0F in register B. 
(iv) Does not mask the higher order bits, as the ANI operation masks the lower bits. Hence the correct option is (i) and (ii).

Was this answer helpful?
0
0