EX (SP),IX

Operation

IXh <-> (SP+1), IXl <-> (SP)

Mnemonic

EX

Operands

(SP),IX

b7b6b5b4b3b2b1b0
1 1 0 1 1 1 0 1$DD
1 1 1 0 0 0 1 1$E3

Description

The low-order byte contained in Index Register IX is exchanged with the contents of the memory address specified by the contents of register pair SP (Stack Pointer), and the high-order byte of IX is exchanged with the next highest memory address (SP+1).

Condition Bits Affected

None

Example

If Index Register IX contains $3988, the SP register pair Contains $0100, memory location $0100 contains byte $90, and memory location $0101 contains byte $48, then the instruction

	EX	(SP),IX

results in the IX register pair containing number $4890, memory location $0100 containing $88, memory location $0101 containing $39, and the Stack Pointer containing $0100.