hewlett-packard HP 9835A — 118

118 Communication Between BASIC and Assembly Language UTILITY: Get element from an element of an array passed as an argument. It works on arrays of any type. General Procedure: This is similar to the "Get_value" utility. This utility retrieves a value Special Requirements: The storage area set aside for the value must be large enough to hold the value. Resultant, the size of the storage area must be - for an integer 1 word for a short-precision value 2 words for a string for a full-precision value 4 words maximum length in bytes 2 + word (+ 1 additional word if the string length is odd) The array information must be retrieved with the "Get_info" utility before calling this utility.

The offset of the element in the array must be correct in the array information (word 16 returned by "Get_info"). It should be remembered that the offset of the element is dependent upon the number of dimensions in the array and the length of each. A calcula- tion may be necessary to arrive at the offset when accessing multiple-dimension arrays. The offset is in terms of number of elements. Calling Procedure: 1. Store the element offset within the array information (word 16 returned by "Get-info"). 2. Load register A with the address of the storage area for the value. 3.

Load register B with the address of word a of the information returned by the "Get_info" utility (see description of that utility). 4. Call the utility. Exit Conditions: There are no error exits from the utility. It always returns to the instruction following the call.