# ROXL Instruction

The instruction ROXL (ROtate Left with eXtend) rotates a data register or a memory operand to the left. There are three ways to do this:
1. Rotate a data register to the left. Number of steps is a constant.
2. Rotate a data register to the left. Number of steps is stored in another data register. You can rotate 1-8 bits this way.
3. Rotate e a word in the memory one bit to the left.
The rotation is done with an extra bit (i.e. a 9, 17 or 33 bit rotation). The most significant bit is rotated to the carry flag and to the extra flag. The bit at the extra flag will be rotated to the least significant bit in the operand.

-- -- > | C | -- -- > |
OPERAND | < -- -- | X | < -- --

ADDRESS METHODS: (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l (only when rotating a word in the memory)
DATA LENGTH: Byte, word, longword
When rotating in the memory, you can only use word.

FLAGS: | X - The last bit that was rotated from the operand. Unaffected if rotation step was zero.
N - S
Z - S
C - Same as X
V - 0

SYNTAX: | ROXL #<steps>,Dy
ROXL Dx,Dy
ROXL <ea>

EXAMPLE CODE:

ROXL.B #1,D0 if D0.B contained 11110000, X = 1 it would now be 11100001 if X = 0 then 11100000