Communication Between BASIC and Assembly Language 117 How each of these utilities is used is described in the immediately following pages. UTILITY: Get value General Procedure: The utility is given the address of the parameter declaration and the address of where the value of the argument is to be stored. It returns with that value stored in the indicated area. It works on simple variables, expressions, and individual elements of arrays (passed as arguments), of any type. Special Requirements: The storage area set aside for the value must be large enough to hold the value.
The size of the storage area must be - for a file number 1 word for an integer value 1 word for a short-precision value for a full-precision value 2 words 4 words for a string maximum length in bytes + 2 + 1 word (+ 1 additional word if the string length is odd) An argument must have been passed by the ICALL for the utility to work properly. Calling Procedure: 1. Load register A with the address of the storage area for the value. 2. Load register B with the address of the parameter declaration. 3. Call the utility. Exit Conditions: There are no error exits from the utility. It always returns to the instruction following the call.
Here is an example call to the utility, retrieving information from a full-precision argument- LD2 =P.::H···.3.rn'::·-::. Er· . .J::::;t'1 '.).3.'j U':::'