![NEC mPD17120 Subseries User Manual Download Page 261](http://html.mh-extra.com/html/nec/mpd17120-subseries/mpd17120-subseries_user-manual_249259261.webp)
CHAPTER 18 INSTRUCTION SET
246
<3> Example
Executes the RET instruction, if the LSB (least significant bit) content for address 25H in the data memory
(RAM) is 0. The execution is returned to the instruction next to the CALL instruction. If the LSB is 1, executes
the RETSK instruction. The execution is returned to the instruction following the one next to the CALL
instruction (in this example, ADD 03H, 16H).
..................
...................
.............................
CALL
BR
ADD
SUB1
LOOP
03H, 16H
SUB1
SKF
RETSK
RET
25H, #0001B
; LSB of 25H is "1"
; LSB of 25H is "0"
(5)
RETI
Return to the main program from interrupt service routine
<1> OP code
00111
100
1110
0000
<2> Function
PC
←
ASR, INTR
←
INTSK, SP
←
SP+1
Instruction to return to the main program, from an interrupt service program.
Restores the return address, saved to the stack by a vector interrupt, to the program counter.
Part of the system register is also returned to the status before the occurrence of the vector interrupt.
<3> Note 1
The system register contents that are automatically saved (i.e., that can be restored by the RETI instruction)
when an interrupt occurs is PSWORD.
Note 2
If the RETI instruction is used, instead of the RET instruction, in an ordinary subroutine, the contents of the
bank (which are to be saved when an interrupt occurs) are changed to the contents of the interrupt stack,
when the execution has returned to the return address. Consequently, an unpredictable status may be
assumed. Therefore, use the RET (or RETSK) instruction to return from a subroutine.
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 ...