eZ80 docs
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Exchange

EX

Exchanges the contents of af and af'.

  • Opcode: 00001000
  • Bytes: 1
  • Flags: None
  • Cycles: 1F

Exchanges the word of memory pointed to by sp with hl.

  • Opcode: 11100011
  • Bytes: 1
  • Flags: None
  • Cycles: 1F+3R+3W

Exchanges the contents of de and hl.

  • Opcode: 11101011
  • Bytes: 1
  • Flags: None
  • Cycles: 1F

Exchanges the word of memory pointed to by sp with ix.

  • Opcode: 11011101 11100011
  • Bytes: 2
  • Flags: None
  • Cycles: 2F+3R+3W

Exchanges the word of memory pointed to by sp with iy.

  • Opcode: 11111101 11100011
  • Bytes: 2
  • Flags: None
  • Cycles: 2F+3R+3W

EXX

Exchanges the contents of af, bc, de, and hl with af', bc', de', and hl', respectively.

  • Opcode: 11011001
  • Bytes: 1
  • Flags: None
  • Cycles: 1F