SAM47 INSTRUCTION SET
KS57C2308/P2308/C2316/P2316
5-78
RET
—
Return From Subroutine
RET
Operation:
Operand
Operation Summary
Bytes
Cycles
–
Return from subroutine
1
3
Description:
RET pops the PC values successively from the stack, incrementing the stack pointer by six.
Program execution continues from the resulting address, generally the instruction immediately
following a CALL or CALLS.
Operand
Binary Code
Operation Notation
–
1
1
0
0
0
1
0
1
PC13–8
←
(SP+1) (SP)
PC7–0
←
(SP+2) (SP+3)
PSW
←
EMB,ERB
SP
←
SP+6
Example:
The stack pointer contains the value 0FAH. RAM locations 0FAH, 0FBH, 0FCH, and and 0FDH
contain 1H, 0H, 5H, and 2H, respectively. The instruction
RET
leaves the stack pointer with the new value of 00H and program execution continues from
location
0125H.
During a return from subroutine, PC values are popped from stack locations as follows:
SP
→
(0FAH)
PC11–PC8
SP + 1 (0FBH)
0
0
PC13
PC12
SP + 2(0FCH)
PC3–PC0
SP + 3(0FDH)
PC7–PC4
SP + 4(0FEH)
0
0
EMB
ERB
SP + 5(0FFH)
0
0
0
0
SP + 6(00H)
Summary of Contents for C2316
Page 30: ...ADDRESS SPACES KS57C2308 P2308 C2316 P2316 2 22 NOTES ...
Page 168: ...SAM47 INSTRUCTION SET KS57C2308 P2308 C2316 P2316 5 94 NOTES ...
Page 170: ......
Page 206: ...POWER DOWN KS57C2308 P2308 C2316 P2316 8 8 NOTES ...
Page 210: ...RESET KS57C2308 P2308 C2316 P2316 9 4 NOTES ...
Page 222: ...I O PORTS KS57C2308 P2308 C2316 P2316 10 12 NOTES ...
Page 272: ...LCD CONTROLLER DRIVER KS57C2308 P2308 C2316 P2316 12 24 NOTES ...
Page 280: ...SERIAL I O INTERFACE KS57C2308 P2308 C2316 P2316 13 8 NOTES ...
Page 294: ...MECHANICAL DATA KS57C2308 P2308 C2316 P2316 15 2 NOTES ...
Page 310: ...KS57P2308 P2316 OTP KS57C2308 P2308 C2316 P2316 16 16 NOTES ...
Page 318: ......
Page 320: ......
Page 322: ......
Page 325: ......
Page 327: ......