HP 9835A Programming Manual page 139

35 series desktop computer assembly development rom
Table of Contents

Advertisement

Communication Between BASIC and Assembly Language 121
Calling Procedure:
1.
Store the number of the starting byte of the substring desired into the first word of the
storage area set aside for the substring. (Note that bytes 0 and 1 are the length word of
the string.)
2. Store the number of bytes in the substring into the second word of the storage area.
3. Store the offset within the array information.
4. Load register A with the address of the storage area for the value.
5. Load register B with the address of word 0 of the information returned by the
"Get_info" utility (see description of that utility).
6. Call the utility.
Exit Conditions: There are no error exits from the utility. It always returns to the instruction
following the call. The substring is returned starting with the third word of the storage area.
(Note: since the second word contains the length of the substring, you have a string data
structure starting with the second word!)
For example -
DAT 2
DAT 10
I
:3Cd)~:C:E
E;::;::; 5
:::;lJt!:::.tt-
y
l
r-j!;i
:::.tt)r"·~:3.i;JE· ·a.f-·E··~
I ::;CUPCE An---a.',..' i
nf
0:
IS::;
30
I ::;CUFCE E
-i
eiii~:r;t- :
EOU AtT"-':!.')
i
nf
0+
16
!
E 1 E-mE-nt off :=-E"t
I
:::;CI~.JF:~C:E:
;:;tJE:
I
=::;()!J
F;:C:E
F~.3.t"·.:if;"!E·t ~::'f-.
:
::;TF.: (
' * )
I':;OUFCE
I::{ii...iFCE
I::;OUF:CE
I
::;C(if~:CE
LIlA
=Ar"r""::t::_"~
i
nf.:o
[_DE
=F'.::tr-""::tmet-er"
LIlA =2
::;TA E 1 E"went- .
LJ):B =Ar . .
t· ...
~::
..
~
..
i
r-!f'c:
.J::;tI1
F:l_~t._
E'1
E'f[~
C!:)tE'::;'
In this example, Value is the storage area. Since 2 has already been generated and stored in the
first word, and lOin the second, the first 10 bytes of the string element are transferred. Of
course, the string element must contain at least 10 characters - or the bytes which are re-
turned may be nonsense.

Advertisement

Table of Contents
loading

Table of Contents