ROR

Instruction: Rotate value right by specified number of bits.

ROR Value, < # > Bits


Result: Value is rotated right by Bits.

  • Value (d-field) is the register to rotate right.
  • Bits (s-field) is a register or a 5-bit literal whose value is the number of bits to rotate right.

Opcode Table:

–INSTR–  ZCRI –CON–    –DEST–         –SRC–

Z Result

C Result

Result

Clocks

 001000    001i    1111    ddddddddd    sssssssss

Result = 0

D[0]

Written

4

Concise Truth Table:

In

Out

Destination

Source

Z

C

Effects

Destination

Z

C

$0000_0000; 0

$0000_0001; 1

-

-

wz wc

$0000_0000; 0

1

0

$1234_5678; 305,419,896

$0000_0004; 4

-

-

wz wc

$8123_4567; -2,128,394,905

0

0

$8123_4567; -2,128,394,905

$0000_000C; 12

-

-

wz wc

$5678_1234; 1,450,709,556

0

1

$5678_1234; 1,450,709,556

$0000_0010; 16

-

-

wz wc

$1234_5678; 305,419,896

0

0

Explanation

ROR (Rotate Right) rotates Value right, Bits times. The LSBs rotated out of Value are rotated into its MSBs.

If the WZ effect is specified, the Z flag is set (1) if the resulting Value equals zero. If the WC effect is specified, at the end of the operation, the C flag is set equal to Value's original bit 0. The result is written to Value unless the NR effect is specified.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.