Utility: Put-Element; Utility: Put_Element - HP 9835A Programming Manual

35 series desktop computer assembly development rom
Table of Contents

Advertisement

Communication Between BASIC and Assembly Language
123
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, passing information to an integer argument-
I :::; Ci
1...1 ~~
c:
E
1=/
.~,
1
i.A i:'~· ~
I :::; Ci
tJ
F: C: E
ISOURCE Parameter: INT
I ::; Ci i.J F:
i=:
E=' :
I:::; C!
tJ
F~:
C:
f:'
I::; Ci
ij
f~~
C:
E~
UTILITY: Put element
L.
I~
:B : : - . : F=
·~~i
r
o
'
.:::=~
rn
E:"
t
~::'
[,",
.J :::;
ft"i
F)
t·t
t
i.).:::t
1
t·i ~:'
General Procedure: This is similar to the "Put_value" utility. This utility changes the value
of a single element in an array passed as an argument. It works on elements of arrays of any
type.
Special Requirements:
• The value must have the appropriate data structure for the data type of the argument (see
"Data Structures" in Chapter
3).
• 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 for the array
(word 16 returned by "Get_info"). It should be remembered that the relative element
number of the element is dependent upon the number of dimensions in the array and the
length of each. A calculation may be necessary to arrive at the offset when accessing
multiple-dimension arrays.
Calling Procedure:
1. Store the element offset into the array information (word 16).
2. Load register A with the address of the storage area for the value.
3. Load register B with the address of word 0 of the information returned by the
"Get_info" utility (see description of that utility).
4. Call the utility.

Advertisement

Table of Contents
loading

Table of Contents