Calling |
To return a
240 A# = USR #15 (VARPTR(L#), A1)
In this example, the sharp sign (#) following USR tells
Your subroutine must interpret the first parameter passed to it as the storage address of A#, and it must also place the result of USR #15 there.
References to string parameters are handled in a similar manner. VARPTR of a string is the address of the string descriptor, not the string data. Thus if a user subroutine returns a string then the user should code USR$[n]. BASIC allocates a
Array variables are passed as parameters by referencing the first element of the array.
To code in 8080/S0S5 assembly language, you must know the Intel format for representing integer,
~~D~ESS | ILS_f_I~~I________________1_5_B_IT_S_O_F_DA_T_A________________~ | ADDRESS | ||||
|
|
|
|
|
| LOW |
|
|
| INTEGER REPRESENTATION: 2 BYTES, 16 BITS, LOW ORDER BYTE FIRST |
| ||
|
|
|
|
|
|
|
|
|
| 8 EXPONENT BITS | 23 MANTISSA BITS |
| |
|
|
|
|
|
| |
|
|
|
| |||
|
|
| 4 BYTES, 32 BITS, LOW ORDER BYTE FIRST |
| ||
|
|
|
|
|
|
|
|
|
| 11 EXPONENT BITS | 52 MANTISSA BITS |
| |
|
|
|
|
|
| |
|
|
|
| |||
|
|
| 8 BYTES, 84 BITS, LOW ORDER BYTE FIRST |
| ||
|
|
|
|
|
|
|
|
|
| LENGTH | ADDRESS |
|
STRING DESCRIPTOR REPRESENTATION: 8 BITS, STRING LENGTH: 16 BITS, STRING ADDRESS.
DATADATADATADATA
STRING DATA REPRESENTATION: 8 BIT BYTES.