![Epson S1C17 Series Скачать руководство пользователя страница 173](http://html.mh-extra.com/html/epson/s1c17-series/s1c17-series_manual_107781173.webp)
7-114
Seiko Epson Corporation
S1C17 CORE MANUAL
(REV. 1.2)
ret
ret.d
Function
Return from subroutine
Standard) pc
←
A[sp](23:0), sp
←
sp + 4
Extension 1) Unusable
Extension 2) Unusable
Code
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 1 0 0 1 0 0 0
0 0
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0
ret.d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Flag
IE C V Z N
– – – – –
|
|
|
|
Mode
–
CLK
ret
Three cycles
ret.d
Two cycles (when a one-cycle delayed slot instruction follows), Three cycles (other)
Description
(1) Standard
ret
Restores the PC value (return address) that was saved into the stack when the
call
/
calla
instruction was executed for returning the program flow from the subroutine to the routine that
called the subroutine. The SP is incremented by four bytes.
If the SP has been modified in the subroutine, it is necessary to return the SP value before
executing the
ret
instruction.
(2) Delayed branch (d bit (bit 7) = 1)
ret.d
For the
ret.d
instruction, the next instruction becomes a delayed slot instruction. A delayed
slot instruction is executed before the program returns from the subroutine. Interrupts are
masked in intervals between the
ret.d
instruction and the next instruction, so no interrupts
occur.
Example
ret.d
add %r0,%r1
; Executed before return from the subroutine
Caution
When the
ret.d
instruction (delayed branch) is used, be careful to ensure that the next instruction
is limited to those that can be used as a delayed slot instruction. If any other instruction is executed,
the program may operate indeterminately. For the usable instructions, refer to the instruction list in
the Appendix.