2-135
2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Data Shift Instructions
2
ROL
ROL
Applicable Program Areas
Operands
Operand Specifications
Flags
Function
Hint
It is possible to set the Carry Flag contents to 1 or 0 immediately before executing this instruction, by
using the Set Carry (STC(040)) or Clear Carry (CLC(041)) instructions.
Instruction Mnemonic Variations
Function
code
Function
ROTATE LEFT ROL @ROL 027
Shifts all Wd bits one bit to the left
including the Carry Flag (CY).
Symbol
ROL
Area Step program areas Subroutines Interrupt tasks
Usage OK OK OK
Operand Description Data type Size
Wd Word UINT 1
Area
Word addresses Indirect DM addresses
Constants CF Pulse bits TR bits
CIO WR HR AR T C DM @DM *DM
Wd OK OK OK OK OK OK OK OK OK --- --- --- ---
Name Label Operation
Error Flag P_ER OFF
Equals Flag P_EQ • ON when the shift result is 0.
• OFF in all other cases.
Carry Flag P_CY • ON when 1 is shifted into the Carry Flag (CY).
• OFF in all other cases.
Negative Flag P_N • ON when the leftmost bit is 1 as a result of the shift.
• OFF in all other cases.
ROL(027) shifts all bits of Wd including the
Carry Flag (CY) to the left (from rightmost bit
to leftmost bit).
Wd: Word
ROL(027)
Wd
01514 1CY