User's Manual
HARSFEN0602
7.7.39 USRSUBJ – jump To User Subroutine
Purpose:
Call to user subroutine (push relevant function data to stack).
SEE 8.2
Algorithm:
BP
(SP) (save base pointer)
SP
SP + 1
OP2
(SP) (save return address)
SP
SP + 1
FuncIndex
(SP) (save function index)
SP
SP + 1
NArgIn
(SP) (save number of input arguments)
7.7.39.1.1.1.1.1 SP SP + 1
NActArgOut (SP) (save number of actual output arguments)
SP
SP + 1
SP
BP (update base pointer)
PC
FuncAddr (jump to user subroutine)
Attributes
Attribute Value Comment
Op code May change in future
versions
Number of arguments 2
Argument type1 Unsigned short integer Lower 8 bits :
Actual ouput arguments
Upper 8 bits :
Subroutine Index
Argument type1 Unsigned short integer Return Address
Addressing mode1 Immediate2
Addressing mode1 Immediate2
Promotion N.A.
Output type N.A.
Imposes end of line Yes jump address is out of the
present executing line.
7.7.40 USRSUBRT – Return from user subroutine
Purpose:
Return from user subroutine - restore stack to its state before function call, save output arguments in stack
and jump to return address.
See 8.2
Algorithm:
7.7.40.1.1.1.1.1 (SP-1) nActArgOut (number of actual output arguments)
(SP-2) nArgIn (num of input arguments)
(SP-4)
RtAddr (return address)
SP
BP – 5 - nArgIn
(save output arguments from subroutine)
(SP-5)
BP (base pointer)
PC
RtAddr (return from user subroutine)