Utility: Get-Element; Utility: Get_Element - HP 9835A Programming Manual

35 series desktop computer assembly development rom
Table of Contents

Advertisement

118 Communication Between BASIC and Assembly Language
UTILITY: Get element
General Procedure: This is similar to the "Get_value" utility. This utility retrieves a value
from an element of an array passed as an argument. It works on arrays of any type.
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
for a short-precision value
for a full-precision value
for a string
1 word
2 words
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.

Advertisement

Table of Contents
loading

Table of Contents