Ret — Return - Samsung S3F84B8 User Manual

8-bit cmos
Hide thumbs Also See for S3F84B8:
Table of Contents

Advertisement

S3F84B8_UM_REV 1.00
6.3.56 RET — RETURN
RET
PC  @SP
Operation:
SP  SP + 2
Typically, the RET instruction is used to return to the previously executed procedure at the end of
a procedure entered by a CALL instruction. The contents of location addressed by the stack
pointer are popped into the program counter. The next statement that is executed is the one that
is addressed by the new program counter value.
No flags are affected.
Flags:
Format:
opc
Given SP = 00FCH, (SP) = 101AH, and PC = 1234:
Example:
RET
The statement "RET" pops the contents of stack pointer location 00FCH (10H) into the high byte
of program counter. The stack pointer then pops the value in location 00FEH (1AH) to the PC's
low byte and the instruction at location 101AH is executed. The stack pointer now points to
memory location 00FEH.
PC = 101AH, SP = 00FEH
Bytes
1
8 (internal stack)
10 (internal stack)
6-69
6 INSTRUCTION SET
Cycles
Opcode (Hex)
AF

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents