Question:medium

The contents of accumulator after the execution of following instruction will be
MVI A, B7H
ORA A
RAL

Show Hint

Always remember that ANA A or ORA A are frequently utilized by assembly programmers to clear the carry flag (\(CY = 0\)) without altering the numeric data value inside the accumulator itself!
Updated On: Jul 4, 2026
  • 6EH
  • 6FH
  • EEH
  • EFH
Show Solution

The Correct Option is A

Solution and Explanation

Understanding the Concept: This question traces execution of 8085 microprocessor assembly language instructions:
• MVI A, data: Move Immediate into Accumulator. Loads the specified 8-bit hex data value directly into register A.
• ORA r: Logical OR Accumulator with register r. Modifies status flags (specifically clearing the Carry flag, \(CY = 0\)).
• RAL: Rotate Accumulator Left Through Carry. Shifts all bits of the accumulator one position to the left. The most significant bit (\(D_7\)) moves into the Carry flag, and the old value of the Carry flag moves into the least significant bit (\(D_0\)).

Step 1: Analyze MVI A, B7H
.
The hexadecimal number \(\text{B7H}\) is loaded into the accumulator register \(A\). Converting \(\text{B7H}\) into its 8-bit binary equivalent: \[ \text{B} = 1011_2, \quad 7 = 0111_2 \implies A = 10110111_2 \end{itemize} Step 2: Analyze \texttt{ORA A.} The instruction performs a bitwise logical OR operation of the accumulator with itself. \[ A \leftarrow A \text{ OR } A = 10110111_2 \] The data contents inside \(A\) remain exactly unchanged, but an essential side-effect of all logical instructions in the 8085 architecture is that the Carry Flag (\(CY\)) is automatically reset to zero: \[ CY = 0 \]

Step 3: Analyze RAL
.
The RAL instruction executes a 9-bit rotation sequence to the left including the Carry flag bit: \[ D_7 \rightarrow CY, \quad D_6 \rightarrow D_7, \quad \ldots, \quad D_0 \rightarrow D_1, \quad CY \rightarrow D_0 \] Let us line up our current binary configuration prior to rotation: \[ CY = 0, \quad A = [1_7 \ 0_6 \ 1_5 \ 1_4 \ 0_3 \ 1_2 \ 1_1 \ 1_0] \] Performing the 1-bit left shift operation:
• The original \(D_7\) bit (\(1\)) is shifted out out of the accumulator and enters the carry flag: \(CY_{\text{new}} = 1\)
• The old carry bit (\(0\)) shifts into the lowest position \(D_0\): \(D_0 = 0\)
• All other internal bits shift one slot to the left. This dynamic results in the new binary register layout: \[ A = 01101110_2 \]

Step 4: Convert the final binary back to Hexadecimal.

Grouping the binary string into nibbles: \[ 0110_2 = 6_{10} = 6\text{H} \] \[ 1110_2 = 14_{10} = \text{EH} \] Combining them together gives: \[ A = \text{6EH} \] This precisely matches option (A).
Was this answer helpful?
0