Rotate Instruction in 8086 with example:
The Rotate Instruction in 8086 with example are namely
- ROL
- ROR
- RCL
- RCR
ROL Instruction : ROL destination, count.
This Rotate Instruction in 8086 with example all bits in a specified byte or word to the left some number of bit positions. MSB is placed as a new LSB and a new CF.
Diagram shows ROL instruction for byte rotation.
The destination can be a byte or a word. It can be in a register or in a memory location. The number of shifts are indicated by count. If number of shifts required is one you can place 1 in the count position. If number of shifts are greater than 1 then shift count must be loaded in CL register and CL must be placed in the count position of the instruction.
ROR Instruction : ROR destination, count.
This Rotate Instruction in 8086 with example all bits in a specified byte or word to the left some number of bit positions. LSB is placed as a new MSB and a new CF.
The destination can be a byte or a word. It can be in a register or in a memory location. The number of shifts are indicated by count. If number of shifts required is one, you can place 1 in the count position. If number of shifts are greater than 1 then shift count must be loaded in CL register and CL must be placed in the count position of the instruction.
Diagram shows ROR instruction for byte rotation.
RCL Instruction : RCL destination, count.
This Rotate Instruction in 8086 with example all of the bits in a specified word or byte some number of bit positions to the left along with the carry flag. MSB is placed as a new carry and previous carry is placed as a new LSB.
The destination can be a byte or a word. It can be in a register or in a memory location. The number of shifts are indicated by count. If number of shifts required is one, you can place 1 in the count position. If number of shifts are greater than 1 then shift count must be loaded in CL register and CL must be placed in the count position of the instruction.
Diagram shows RCL instruction for byte rotation.
RCR Instruction : RCR destination, count.
This Rotate Instruction in 8086 with example all of the bits in a specified word or byte some number of bit positions to the left along with the carry flag. LSB is placed as a new carry and previous carry is placed as a new MSB.
The destination can be a byte or a word. It can be in a register or in a memory location. The number of shifts are indicated by count. If number of shifts required is one you can place 1 in the count position. If number of shifts are greater than 1 then shift count must be loaded in CL register and CL must be placed in the count position in the instruction.
Diagram shows RCR instruction for byte rotation.