RLΒΆ
- RL M
- Rotate Left
- Description
- Performs a left shift on
M; the 7th bit ofMis moved into the carry, and the carry is moved into the 0th bit ofM.
- Uses
- Quickly multiplying by two
- Retrieving consecutive bits of a byte in a loop, starting from the left
- Results
Register/Flag 8-bit M
SflagSet if the result is negative; else reset ZflagSet if the result is 0; else reset HflagReset P/VflagSet if the result has even parity; else reset NflagReset Cflag7th bit of M- Allowed Instructions
Instruction Opcode CC (ADL/non-ADL) CC (.S) CC (.L) rl a $CB, $17 2F X X rl b $CB, $10 2F X X rl c $CB, $11 2F X X rl d $CB, $12 2F X X rl e $CB, $13 2F X X rl h $CB, $14 2F X X rl l $CB, $15 2F X X rl (hl) $CB, $16 2F + 1R + 1W + 1 3F + 1R + 1W + 1 3F + 1R + 1W + 1 rl (ix+n) $DD, $CB, n, $16 4F + 1R + 1W + 1 5F + 1R + 1W + 1 5F + 1R + 1W + 1 rl (iy+n) $FD, $CB, n, $16 4F + 1R + 1W + 1 5F + 1R + 1W + 1 5F + 1R + 1W + 1 - Notes
- When using
RLto multiply a number by 2, first make sure the carry flag is reset or the result will be( M * 2 ) + Carry.
- When using
- See Also
- RLA, RLC, RR, SLA