Ex (sp), iy – Zilog Z08470 User Manual
Page 139

UM008007-0715
Z80 Instruction Description
Z80 CPU
User Manual
127
EX (SP), IY
Operation
IYH
↔
(SP+1), IYL
↔
(SP)
Op Code
EX
Operands
(SP), IY
Description
The low-order byte in Index Register IY 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 IY is exchanged with the next highest memory address (SP+1).
Condition Bits Affected
None.
Example
If Index Register IY contains
3988h
, the SP register pair contains
0100h
, memory loca-
tion
0100h
contains byte
90h
, and memory location
0101h
contains byte
48h
, then the
instruction EX (SP), IY results in the IY register pair containing number
4890h
, memory
location
0100h
containing
88h
, memory location
0101h
containing
39h
, and the Stack
Pointer containing
0100h
.
M Cycles
T States
4 MHz E.T.
6
23 (4, 4, 3, 4, 3, 5)
5.75
1
1
1
0
1
1
1
1
FD
1
1
0
1
1
0
1
0
E3