
7700 FAMILY SOFTWARE MANUAL
4–88
PUL
Pull
PUL
Function
:
Stack manipulation (pull)
Operation
:
Specified register of A, B, X, Y, DPR, DT, PG, PS
←
Stack
A,
S
←
S + n
E
The immediate value in the second byte of the instruction is used to specify the registers
to be restored.
E
Among the registers being restored, the following registers are affected by the flags in the
restored PS or the flags just before the instruction is executed.
G
A, B registers
When m=0 : The high-order and low-order bytes of the register are restored.
When m=1 : The low-order bytes of the register are restored.
G
X, Y registers
When x=0 : The high-order and low-order bytes of the register is restored.
When x=1 : The low-order byte of the register is restored.
E
n indicates the number of data bytes to be restored.
B,
X,
Y, DPR, DT, PG, PS
←
M(S + 1
to
S + n)
order to restore
Description
:
This instruction’s second byte specifies the registers to be restored. The registers correspond-
ing to the bits in the second byte that are 1 are restored from the stack. The bit and register
correspondence is as shown below:
b7
PS
Direction to restore from the stack
→
b0
A
DT
DPR
Y
X
B
When restoring from stack, registers A and B are affected by the m flag in restored PS, and
registers X and Y are affected by the x flag in restored PS. If PS is not restored, the registers
are affected by the value of these flags just before instruction execution.
Status flags
:
When bit 7 of the instruction’s second byte is 1, specifying that the program status register PS
is to be restored, the status flags are restored to the values that had been restored from the
stack. Otherwise, the status flags are not affected.
Addressing mode
Stack
Syntax
PUL #nn
Machine code
FB
16
, nn
Bytes
2
Cycles
14+3xi
1
+4xi
2
(Note 1) To the cycles-count shown above, the values shown below are added depending on the registers
being restored. The count is 14 cycles when no registers are restored. i
1
in above table represents
the number of registers (chosen from A, B, X, Y, PS and DT) to be saved. i
2
=1 if DPR is to be
restored, and i
2
=0 if DPR is not to be restored.
Register type
Cycles-count
PS
3
DT
3
DPR
4
Y
3
X
3
B
3
A
3