Chapter
11
I
Technical Information
Technical Functions
When the USR function call
is
made, register AL contains a
value that specifies the type
of
argument that was given. The
value in AL may be one of the following:
Value in
AL
Type
of
Argument
2 2-byte integer (two’s complement)
3
String
4
Single precision floating-point number
8
Double precision floating-point number
If the argument
is
a string, the
DX
register pair points
to
the
“string descriptor.” See the section “Accessing String Variables”
in this chapter.
If the argument is a number, the
BX
register pair points
to
the
Floating-point Accumulator (FAC) where the argument is stored:
FAC is the exponent minus 128, and the binary point is
to
the left of the most significant bit of the mantissa.
FAC-1 contains the highest 7 bits of mantissa with leading
1
suppressed (implied). Bit 7
is
the sign of the number
(0
=positive,
1
=
negative).
If the argument
is
an integer:
FAC-2 contains the upper
8
bits of the argument.
FAC-3 contains the lower
8
bits of the argument.
If the argument is
a
single precision floating-point number:
FAC-2 contains the middle
8
bits of mantissa.
FAC-3 contains the lowest
8
bits of mantissa.
If the argument is a double precision floating-point number:
FAC-4 through FAC-7 contain 4 more bytes
of
mantissa
(FAC-7 contains the lowest
8
bits).
Exiting the Subroutine
The subroutine must execute
a
RET 7 statement
to
adjust the
stack to the start
of
the calling sequence.
356