ROL
Instruction: Rotate value left by specified number of bits.
ROL Value, < # > Bits
Result: Value is rotated left by Bits.
- Value (d-field) is the register to rotate left.
- Bits (s-field) is a register or a 5-bit literal whose value is the number of bits to rotate left.
Opcode Table:
–INSTR– ZCRI –CON– –DEST– –SRC– | Z Result | C Result | Result | Clocks |
001001 001i 1111 ddddddddd sssssssss | Result = 0 | D[31] | 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 |
$8765_4321; -2,023,406,815 | $0000_0004; 4 | - | - | wz wc | $7654_3218; 1,985,229,336 | 0 | 1 |
$7654_3218; 1,985,229,336 | $0000_000C; 12 | - | - | wz wc | $4321_8765; 1,126,270,821 | 0 | 0 |
$4321_8765; 1,126,270,821 | $0000_0010; 16 | - | - | wz wc | $8765_4321; -2,023,406,815 | 0 | 0 |
Explanation
ROL (Rotate Left) rotates Value left, Bits times. The MSBs rotated out of Value are rotated into its LSBs.
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 31. 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.