Machine-translated by Google. Questions are authored in English.
Top

Discussion

In an 8085 microprocessor, the accumulator contains AAH and CY = 0. If the RAL instruction is executed twice, what will be the data in the accumulator?

  • A.AAH
  • B.9AH
  • C.99H
  • D.A9H

Answer: D

RAL rotates the accumulator one bit to the left through the carry flag: the most significant bit goes into CY, and the old CY goes into bit 0.


\[ \text{AAH} = 1010\ 1010,\quad CY = 0 \]


After the first RAL: the accumulator is \(0101\ 0100 = 54\text{H}\) and CY = 1.


After the second RAL: the accumulator is \(1010\ 1001 = \text{A9H}\) and CY = 0.


The value AAH would result from rotating by 8 positions through the carry, 9AH and 99H come from wrong rotations. The answer is A9H, option D.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.