![NEC mPD17120 Subseries User Manual Download Page 260](http://html.mh-extra.com/html/nec/mpd17120-subseries/mpd17120-subseries_user-manual_249259260.webp)
CHAPTER 18 INSTRUCTION SET
245
(3)
RET
Return to the main program from subroutine
<1> OP code
10
8 7
4 3
0
00111
000
1110
0000
<2> Function
PC
←
ASR,
SP
←
SP+1
Instruction to return to the main program from a subroutine.
Restores the return address, saved to the stack by the CALL instruction, to the program counter.
<3> Example
(4)
RETSK
Return to the main program then skip next instruction
<1> OP code
00111
001
1110
0000
<2> Function
PC
←
ASR, SP
←
SP+1 and skip
Instruction to return to the main program from a subroutine.
Skips the instruction next to the CALL instruction (Executes as NOP instruction).
Therefore, restores the return address, saved to the stack by the CALL instruction, to program counter PC
and then increments the program counter.
....................
............
...............................
CALL
SUB1
SUB1
RET
Summary of Contents for mPD17120 Subseries
Page 15: ... x MEMO ...
Page 23: ... MEMO 8 ...
Page 45: ... MEMO 30 ...
Page 49: ... MEMO 34 ...
Page 55: ... MEMO 40 ...
Page 93: ... MEMO 78 ...
Page 99: ... MEMO 84 ...
Page 102: ...CHAPTER 11 ARITHMETIC AND LOGIC UNIT 87 MEMO ...
Page 119: ... MEMO 104 ...
Page 175: ... MEMO 160 ...
Page 199: ... MEMO 184 ...
Page 265: ... MEMO 250 ...
Page 281: ...266 MEMO ...
Page 285: ... MEMO 270 ...
Page 289: ... MEMO 274 ...