In 8085 Instruction set, there is another mnemonic RAL,which stands or Rotate Accumulator Left and also involving Cy flag in rotation. It rotates the Accumulator contents to the left by 1-bit position. The following Fig. is depicting the execution logic of the instruction.
From the Fig. we can see that the due to left rotation the bit which is coming out from the most significant place will be copied to the Cy flag bit. And the previous Cy bit will be moved to least significant bit place of the Accumulator. Thus it is a 9-bit rotation of Accumulator and Cy contents. Only Cy flag is affected by this instruction execution.
|Mnemonics, Operand||Opcode(in HEX)||Bytes|
The instruction can be used for multiple purposes.
To find the most significant bit of the Accumulator, performing rotate left.
To perform multiplication by 2. We know that if we multiply a number by 2n then the number will have n-bit left rotation.
As during rotation, an empty space will get created. So to put a new bit at that least significant space we can use this mnemonic as well.
Let us consider the following examples for the better understanding.
35H ---> 0011 0101 0 0110 1010 ---> 6AH (Prev. Cy bit as the Last bit)
Note that Accumulator value has been doubled compared with the previous value.
35H ---> 0011 0101 0 0110 1011 ---> 6BH(Prev. Cy bit as the Last bit)
Here the current Accumulator content is not doubled compared to the initial content of the Accumulator. As in this case because most significant bit of Accumulator was a 1 before rotation.
The timing diagram against this instruction RAL execution is as follows −
Summary − So this instruction RAL requires 1-Byte, 1-Machine Cycle (Opcode Fetch) and 4 T-States for execution as shown in the timing diagram.