sla

Shift left arithmetic

Shifts a register or memory byte left one bit, copying bit 7 to C and putting zero into bit 0.

SZHP/VNC ●●0●0●
  • ● depends on the result
  • 0 always 0

Forms

  • Shifts r left one bit position. Copies bit 7 to the carry flag and puts a zero into bit 0.

  • sla 2 bytes15 cycles

    Shifts (HL) left one bit position. Copies bit 7 to the carry flag and puts a zero into bit 0.

  • Shifts the memory location pointed to by IX plus dd left one bit position. Copies bit 7 to the carry flag and puts a zero into bit 0.

Undocumented 1 row

Zilog’s manual does not list these forms, but the Z80 runs them.

  • Shifts the memory location pointed to by IX plus dd left one bit position. Copies bit 7 to the carry flag and puts a zero into bit 0. Also stores the result in r.

Operands

r
An 8-bit register: a, b, c, d, e, h or l.
(hl)
The byte in memory at the address stored in hl. More
(ix+dd)
The byte in memory at ix + dd, where dd is a signed displacement from -128 to 127, for example (ix+5) or (ix-3). (iy+dd) works the same way. More
        .org 0x8000
        ld b, 3
        sla b
        halt