Syntax
CALL Label
|
Unconditional CALL
|
CALL value16
|
Unconditional CALL
|
CALL VAR16
|
Unconditional CALL
|
CALL Label, VAR, Flag
|
CALL if VAR Flag 0
|
CALL value16, VAR, Flag
|
CALL if VAR Flag 0
|
CALL VAR16, VAR, Flag
|
CALL if VAR Flag 0
|
Operands | Label: a label providing the 16-bit value of a TML function address |
Value16: immediate 16-bit of a TML function address
VAR16: integer variable containing the TML function address
VAR: 16 or 32-bit TML test variable compared with 0
Flag: one of the conditions: EQ, NEQ, LT, LEQ, GT, GEQ
Binary code
Description | Calls a TML function (subroutine). A TML function is a set of TML commands which starts with a label and ends with the RET instruction. The label gives the TML function address and name. TML function address may also be specified by an immediate value or by the value of a 16-bit TML variable. The call can be unconditional or unconditional. In a conditional call, a condition is tested. If the condition is true the TML function is executed, else the next TML command is carried out. The condition is specified by a 16-bit or 32-bit test variable (VT=0 for 16-bit variable and VT = 1 for 32-bit variable) and a test condition added after the label with the TML function address. The test variable is always compared with zero. The possible test conditions are: |
EQ if VAR = 0
NEQ if VAR ≠ 0
LT if VAR < 0
LEQ if VAR ≤ 0
GT if VAR > 0
GEQ if VAR ≥ 0
Example
CALL Function1, var1, GEQ; //call Function1 if i_var1 >= 0
CALL Function1, var1, EQ; //call Function1, if i_var1 = 0
CALL Function1, var1, NEQ; //call Function1, if i_var1 != 0
CALL Function1; //call Function1 unconditionally
...
END; // end of TML program main section
Function1:
...
RET;
|