MOTOROLA
5-20
INSTRUCTION SET
CPU16
REFERENCE MANUAL
5.8 Stacking Instructions
There are two types of stacking instructions. Stack pointer instructions use specialized
forms of mathematic and data transfer instructions to perform stack pointer manipula-
tion. Stack operation instructions save information on and retrieve information from the
system stack.
Table 5-28 Stacking Summary
Stack Pointer Instructions
Function
Add Immediate Data to SP
Compare SP to Memory
Load SP
Store SP
Transfer SP to IX
Transfer SP to IY
Transfer SP to IZ
Transfer IX to SP
Transfer IY to SP
Transfer IZ to SP
Stack Operation Instructions
Function
Push A
Mnemonic
AIS
CPS
LDS
STS
TSX
TSY
TSZ
TXS
TYS
TZS
Operation
SK : SP + ( IMM16)
SK : SP
(SP) – (M : M + 1)
(M : M + 1)
SP
(SP)
M : M + 1
(SK : SP) + 2
XK : IX
(SK : SP) + 2
YK : IY
(SK : SP) + 2
ZK : IZ
(XK : IX) – 2
SK : SP
(YK : IY) – 2
SK : SP
(ZK : IZ) – 2
SK : SP
Mnemonic
PSHA
Operation
(SK : SP) + 1
SK : SP
Push (A)
(SK : SP) – 2
SK : SP
(SK : SP) + 1
SK : SP
Push (B)
(SK : SP) – 2
SK : SP
For mask bits 0 to 6 :
PSHB
Push B
PSHM
Push Multiple Registers
Mask bits:
0 = D
2 = IX
4 = IZ
6 = CCR
1 = E
3 = IY
5 = K
7 = (reserved)
If mask bit set
Push register
(SK : SP) – 2
SK : SP
PULA
Pull A
(SK : SP) + 2
SK : SP
Pull (A)
(SK : SP) – 1
SK : SP
(SK : SP) + 2
SK : SP
Pull (B)
(SK : SP) – 1
SK : SP
For mask bits 0 to 7:
PULB
Pull B
PULM
Pull Multiple Registers
Mask bits:
0 = CCR[15:4]
2 = IZ
4 = IX
6 = D
1 = K
3 = IY
5 = E
7 = (reserved)
If mask bit set
(SK : SP) + 2
SK : SP
Pull register
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.