Direction: Consider the following assembly language program for a hypothetical processor. A, B and C are 8 registers. The meanings of various instructions are shown as comments.
-
Which of the following instructions when inserted at location X will ensure that the value of register A after program execution is the same as its initial value?
-
- RRC A #1
- NOP; no operation
- LRC A #1; left rotate A through carry flag by one bit
- ADD A #1
- RRC A #1
Correct Option: A
In the end of program execution to check whether both initial and final value of register A is A0, we need to right rotate register A through carry by one bit. Hence (a) is correct option.