EXX

Operation

(BC) <-> (BC'), (DE) <-> (DE'), (HL) <-> (HL')

Mnemonic

EXX

Operands

None

b7b6b5b4b3b2b1b0
1 1 0 1 1 0 0 1$D9

Description

Each 2-byte value in register pairs BC, DE, and HL is exchanged with the 2-byte value in BC', DE', and HL', respectively.

Condition Bits Affected

None

Example

If register pairs BC, DE, and HL contain $445A, $3DA2, and $8859, respectively, and register pairs BC', DE', and HL' contain $0988, $9300, and $00E7, respectively, then upon the execution of

	EXX

BC contains $0988, DE contains $9300, HL contains $00E7, BC' contains $445A, DE' contains $3DA2 and HL' contains $8859.