2-137

2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)

Data Shift Instructions

2

ROR

ROR
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 RIGHT ROR @ROR 028 Shifts all Wd bits one bit to the right

including the Carry Flag (CY).

Symbol
ROR
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.

ROR(028) shifts all bits of Wd including the

Carry Flag (CY) to the right (from leftmost bit

to rightmost bit).

Wd: Word
ROR(028)
Wd
01514 1
Wd
CY