HP 9835A Programming Manual page 133

35 series desktop computer assembly development rom
Table of Contents

Advertisement

Communication Between BASIC and Assembly Language
115
Special Requirements:
• The location where it is to store the information must be adequate to hold all that may be
returned. For non-arrays, 3 words will suffice. For arrays, up to 30 words may be required
(as above). If you are writing a general routine, it may be wise to play it safe by setting
aside a full 30 words .
• An argument must have been passed by the ICALL (in the case of parameters) or a
corresponding BASIC COM declaration must exist (in the case of common declarations).
Calling Procedure:
1. Load register A with the address of the storage area for the information to be returned.
2. Load register B with the address of the parameter declaration corresponding to the
desired argument.
3. Call the utility.
Exit Conditions: There are no error exits from the utility.
It always returns to the instruction
following the JSM. Since there are no error exits, and there is no requirement that there be as
many arguments as there are parameter declarations, an argument must actually have been
passed by the ICALL in order for the utility to work correctly.
Following up on the example in the previous section, suppose the first thing that the Sort
routine does is check to see if the first parameter passed is an array. Then, by using the
Get_info utility, it is possible to have the instructions look as follows -
'::::Cii..,iPCE
:::OLij?C:E:
SOURCE
Ar~ay:
HNY
SOURCE
Number:
RE
:::::Ui.JF:C:E
:::::Oi.JRC:l:::
':::;(}.JF.'CE
':::U.JF.:CE
C:F'
=1.6
Is it
=
fi10
number~
Yes, indicate error
0
fif~;
.. '
' · ::L
>i
t
I. - I::
1;;:~ ~ :~ :~;
: : . . , ; "
t·· . . . :
~
'i 1
1
1
::J :
i
H • •
:::~.
!" :'
E' t
H
t-·
c=
~""
;::;

Advertisement

Table of Contents
loading

Table of Contents