Instructions to rotate Accumulator in 8085 Microprocessor

Microprocessor8085

In 8085 Instruction set,there a set of instructions which can Accumulator contents left orright. It is to be noted here that rotate operation can be performedonly on Accumulator contents. These instructions set is listed below– 

Mnemonics,Operand
Opcode(in HEX)
Bytes
RAL
17
1
RAR
1F
1
RLC
07
1
RRC
0F
1


Mnemonic RLC stands for “Rotate Left Accumulator”. It rotates the Accumulator contents to the left by 1-bit position. The following Fig. shows the operation explicitly – 


In this fig. it has been depicted that the mostsignificant bit of the Accumulator will come out and left rotate willcreate an empty space at the least significant bit place and thiscome out bit will be copied at the empty bit place and also on the Cybit in the flag register. Thus, Cy flag gets a copy of the bit movedout from the MS bit position. Notice that Cy flag is not involved inthe rotation, and it is only 8-bit rotation of Accumulator contents.Only Cy flag is affected by this instruction execution.

Mnemonic RAL, which stands or Rotate Accumulator Left and also involvingCy flag in rotation. It rotates the Accumulator contents to the leftby 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 rotationthe bit which is coming out from the most significant place will becopied to the Cy flag bit. And the previous Cy bit will be moved toleast significant bit place of the Accumulator. Thus it is a 9-bitrotation of Accumulator and Cy contents. Only Cy flag is affected bythis instruction execution.

Mnemonic RRC stands for “Rotate Right Accumulator”. With the help of thisinstruction, we can rotate the Accumulator current content to theright by 1-bit position. The following Fig.will depict the rotation operation –  


In this right rotation, the least significant bit willcome out from the Accumulator and will be copied to Cy bit in the flag register and also will be copied to the most significant bitposition of the Accumulator. Notice that the Cy flag is not involvedin the rotation, and it is only 8-bit rotation of Accumulatorcontents. Only Cy flag is affected by this instruction execution.

Mnemonic RAR stands for “Rotate Accumulator Right involving Cy flag inrotation”. It rotates the Accumulator contents to the right by1-bit position. From the following Fig. we aregetting the operation details – 


From the Fig. we can see that, during right rotate theleast significant bit is coming out and will be copied on the Cy flagbit and the previous Cy flag bit will be moved to the mostsignificant bit position of the Accumulator. It is 1-Byteinstruction. And it is 9-bit rotation of Accumulator and Cy contents.Only Cy flag is affected by this instruction execution.

raja
Published on 27-Dec-2018 15:32:00
Advertisements