Download Print this page

ZiLOG Z80380 User Manual page 41

Advertisement

Z
ILOG
5.5.2 16-Bit and 32-Bit Load, Exchange,
SWAP, and PUSH/POP Group
This group of load, exchange, and PUSH/POP instructions
(Table 5-4) allows one or two words of data (two bytes
equal one word) to be transferred between registers and
memory.
The exchange instructions (Table 5-5) allow for switching
between the primary and alternate register files, exchang-
ing the contents of two register files, exchanging the
contents of an addressing register with the top word on the
stack. For possible combinations of the word exchange
instructions, refer to Table 5-5. The 16-bit and 32-bit loads
include transfer between registers and memory and imme-
diate loads of registers or memory. The Push and Pop
stack instructions are also included in this group. None of
these instructions affect the CPU flags, except for EX AF,
AF'.
Table 5-6 has the supported source/destination combina-
tion for the 16-bit and 32-bit load instructions. The transfer
size, 16-bit or 32-bit, is determined by the status of LW bit
in SR, or by DDIR Decoder Directives.
Table 5-4. 16-Bit and 32-Bit Load, Exchange, PUSH/POP Group Instructions
Instruction Name
Exchange Word/Long Word Registers
Exchange Byte/Word Registers with Alternate Bank
Exchange Register Pair with Alternate Bank
Exchange Index Register with Alternate Bank
Exchange All Registers with Alternate Bank
Load Word/Long Word Registers
POP
PUSH
Swap Contents of D31-D16 and D15-D0
Table 5-5. Supported Source and Destination
Combination for 16-Bit and 32-Bit
Exchange Instructions
Destination
BC
DE
BC
DE
HL
IX
(SP)
DC-8297-03
Source
HL
IX
IY
PUSH/POP instructions are used to save/restore the con-
tents of a register onto the stack. It can be used to
exchange data between procedures, save the current
register file on context switching, or manipulate data on the
stack, such as return addresses. Supported sources are
listed in Table 5-7.
Swap instructions allows swapping of the contents of the
Word wide register (BC, DE, HL, IX, or IY) with its Extended
portion. These instructions are useful to manipulate the
upper word of the register to be set in Word mode. For
example, when doing data accesses, other than
00000000H-0000FFFFH address range, use this instruc-
tion to set "data frame" addresses.
This group of instructions is affected by the status of the LW
bit in SR (Select Register), and Decoder Directives which
specifies the operation mode in Word or Long Word.
Format
Note
EX dst,src
See Table 5-5
EXX
EX RR,RR'
RR = AF, BC, DE, or HL
EXXX
EXXY
EXALL
LD dst,src
See Table 5-6
LDW dst,src
See Table 5-6
POP dst
See Table 5-7
PUSH src
See Table 5-7
SWAP dst
dst = BC, DE, HL, IX, or IY
Note: √ are supported combinations. The exchange in-
structions which designate IY register as destination are
covered by the other combinations. These Exchange
Word instructions are affected by Long Word mode.
Z380
U
'
M
SER
S
ANUAL
5-7

Advertisement

loading
Need help?

Need help?

Do you have a question about the Z80380 and is the answer not in the manual?

Questions and answers