Propeller Manual

Table Of Contents
RET – Assembly Language Reference
Page 342 · Propeller Manual v1.1
RET
Instruction: Return to previously recorded address.
RET
Opcode Table:
–INSTR– ZCRI –CON– –DEST– –SRC– Z Result C Result Result Clocks
010111 0001 1111 --------- ---------
Result = 0 --- Not Written 4
Concise Truth Table:
In Out
Destination
1
Source Z
C
Effects
Destination
2
Z C
3
$----_----; - $----_----; - -
-
wr wz wc
31:9 unchanged, 8:0 = PC+1
0 1
1
Destination is normally ignored for RET usage, however if the WR effect is given, the RET instruction becomes a CALL instruction
and Destination’s s-field (lowest 9 bits) are overwritten with the return address (PC+1).
2
Destination is not written unless the WR effect is given.
3
The C flag is set (1) unless PC+1 equals 0; very unlikely since it would require the RET to be executed from the top of cog RAM
($1FF; special purpose register VSCL).
Explanation
RET returns execution to a previously recorded address by setting the Program Counter (PC)
to that address. The
T
RET instruction is meant to be used along with a label in the form
label_ret” and a CALL instruction that targets RET’s routine, denoted by “label. See CALL
on page for more information. 268
RET is a subset of the T JMP instruction but with the i-field set and the s-field unspecified. It is
also closely related to the
CALL and JMPRETT commands; in fact, they are all the same opcode
but with different r-field and i-field values and varying assembler-driven and user-driven
d-field and s-field values.