CALL (CA.)
A statement to call a machine code subroutine.
CALL Muldiv,A,B,C,D
CALL &FFE3
CALL 12340,A$,M,J$The processor’s A, B, C, D, E, F, H and L registers are initialised to the least significant words of A%, B%, C%, D%, E%, F%, H% and L% respectively (see also USR).
Parameter Table
CALL sets up a table in RAM containing details of the parameters. The IX register is set to the address of this parameter table.
Variables included in the parameter list need not have been declared before the CALL statement. The parameter types are:
| Code No | Parameter Type | |
| 0: 4: 5: 128: 129: | byte (8 bits) word (32 bits) real (40 bits) fixed string movable string | eg ?A% eg !A% or A% eg A eg $A% eg A$ |
| Number of parameters | 1 byte (at IX) |
| Parameter type Parameter address | 1 byte (at IX+1) 2 bytes (at IX+2 IX+3 LSB first) |
| Parameter type Parameter address | ) repeated as often as necessary. ) |
Except in the case of a movable string (normal string variable), the parameter address given is the absolute address at which the item is stored. In the case of movable strings (type 129), it is the address of a parameter block containing the current length, the maximum length and the start address of the string, in that order
Parameter Formats
Integer variables are stored in two’s complement format with their least significant byte first.
Fixed strings are stored as the characters of the string followed by a carriage return (&0D).
Floating point variables are stored in binary floating point format with their least significant byte first. The fifth byte is the exponent. The mantissa is stored as a binary fraction in sign and magnitude format. Bit 7 of the most significant byte is the sign bit and, for the purposes of calculating the magnitude of the number, this bit is assumed to be set to one. The exponent is stored as a positive integer in excess 127 format. (To find the exponent subtract 127 from the value in the fifth byte.)
If the exponent of a floating point number is zero, the number is stored in integer format in the mantissa. If the exponent is not zero, then the variable has a floating point value. Thus, an integer can be stored in two different formats in a real variable. For example, 5 can be stored as
& 00 00 00 05 00 Integer 5or
& 20 00 00 00 82 (.5+.125) * 2^3 = 5(the &20 becomes &A0 because the MSB is always assumed)
In the case of a movable string (normal string variable), the parameter address points to the ‘string descriptor’. This descriptor gives the current length of the string, the number of bytes allocated to the string (the maximum length of the string) and the address of the start of the string (LSB first).
See the Annex entitled ‘Format of Program and Variables in Memory’ for details of how parameters are stored.
Syntax
CALL <numeric>{,<n-var>|<s-var>}Associated Keywords
USR