Propeller Manual

Table Of Contents
3: Assembly Language Reference – CALL
Propeller Manual v1.1 · Page 269
instruction is really just a JMP instruction without a hard-coded destination address, and this
run-time action provides it with the “return” address to jump back to. After storing the return
address,
CALL jumps to the destination address; Symbol.
The diagram below uses a short program example to demonstrate the
CALL instruction’s run-
time behavior; the store operation (left) and the jump-execute-return operation (right).
Figure 3-1: Run-time CALL Procedure
Store operation Jump, execute and return operation
this example, the following occurs when the
CALL instruction is reached at run time:
source
y leading to the
Routine_ret line.
rce
In
The cog stores the return address (PC+1; that of
<next instruction>) into the
(s-field) of the register at
Routine_ret (see left image).
The cog jumps to Routine (see right image).
Routine’s instructions are executed, eventuall
Since the
Routine_ret location contains a RET instruction with an updated sou
(s-field), which is the return address written by step 1, it returns, or jumps, back to
the
<next instruction> line.