9.4.10 Subroutine Stack Control Instructions - NEC PD75402A User Manual

4-bit single-chip microcomputer
Table of Contents

Advertisement

9.4.10 Subroutine Stack Control Instructions

CALLF !faddr
Function: (SP-1)
PC
7
(SP-3)
0, 0, 0, 0
(SP-4)
0, PC
SP
SP-4, PC
faddr = A
to A
10
Saves the contents of the program counter (PC; return address) to the data memory (stack) addressed by
the stack pointer (SP) and decrements the SP, then branches to the address addressed by 11-bit immediate
data faddr.
The range that can be called is limited to addresses 000H to 77FH (0 to 1919).
RET
Function: PC
to PC
10
8
PC
to PC
7
4
Restores the contents of the data memory (stack) addressed by the stack pointer (SP) to the program counter
(PC), then increments the contents of the SP.
RETS
Function: PC
to PC
10
8
PC
to PC
7
4
Restores the contents of the data memory (stack) addressed by the stack pointer (SP) to the program counter
(PC) and increments the contents of the SP, then skips unconditionally.
RETI
Function: PC
to PC
10
8
PC
to PC
7
4
Restores the contents of the data memory (stack) addressed by the stack pointer (SP) to the program counter
(PC) and program status word (PSW), then increments the SP.
This instruction is used to return from an interrupt handling routine.
172
CHAPTER 9. INSTRUCTION SET
to PC
, (SP-2)
PC
to PC
4
3
to PC
,
10
8
A
to A
10
0
: 000H to 77FH
0
(SP), PC
to PC
(SP+2),
3
0
(SP+3), SP
SP+4
(SP), PC
to PC
(SP+2)
3
0
(SP+3), SP
SP+4, Then skip unconditionally
(SP), PC
to PC
(SP+2),
3
0
(SP+3), PSW
(SP+4), PSW
L
,
0
(SP+5), SP
SP+6
H

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd75p402

Table of Contents