exx

Exchange register sets

Swaps BC, DE and HL with BC', DE' and HL', the alternate register set.

1 byte · 4 cycles

SZHP/VNC ––––––
  • Changes no flag

Forms

  • exx

    Exchanges the 16-bit contents of BC, DE, and HL with BC', DE', and HL'.

        .org 0x8000
        ld bc, 0x0234
        ld de, 0x1000
        ld hl, 0x9000
        exx
        halt