These instruction rotate the accumulator left, or right with or without carry. The instructions are RR, RRC, RL, RLC.
The RL instruction rotates accumulator left one bit left
Figure shows how the bits rotate left internally and then bit-7 to bit-0
No flags are affected by this instruction
Figure 7.1 : Rotate left logic operation
|Opcode/ Encoding||Next Opcode Byte||Flags affected||Byte||Cycles|
|RL A||RL A
Rotate the accumulator left one bit through carry
carry-bit into bit-0, and Bit-7 into carry
carry flag is update with bit-7
No other flags are affected by this operation.
|Opcode/ Encoding||Subsequent Byte of Opcode||Flags affected||Cycles|
|RLC A||RLC A
RR Instruction rotate the accumulator Right one bit
Bit-7 to bit-6…..bit-1 to bit-0; bit -0 into bit-7
No flags are affected by this instruction.
|Format||example /Operation||Opcode/ Encoding||Next byte of opcode||Flags affected||Cycles|
|RR A||RR A
An = An+1
RRC is used to rotate accumulator through carry
Carry ->Bit-7, bit-7 to bit-6 and so on, and finally bit-0 in to carry.
No other flags are affected by this instruction.
|Format||Example/ Operation||Opcode/ Encoding||Next Opcode Byte||Flags affected||Cycles|
|RRC A||RRC A
An = An+1
for n=0 to 7
A7 = C
- NOP instruction does nothing.
- No registers or flags are affected on execution
- It is typically used to generate a delay in execution or to reserve space in code memory
|Opcode/ Encoding||Flags affected||Byte||Cycles|