
FAC-2
contains
the middle
8 bits
of mantissa
and
FAC-1
contains
the highest
7 bits
of mantissa
with
leading
1 suppressed
(implied).
Bit
7
is
the sign of the number
(O=positive,
1-negative).
FAC
is
the exponent
minus
128, and the binary
point
is
to the left of the most
significant
bit of the mantissa.
If ~e
argument
is
a double
precision
floating
point
number:
FAC-7
through
FAC-4
contain
four more
bytes
of mantissa
(FAC-7 contains
the lowest
8 bits).
If the
to
3
string
255).
8 bits
argument
is a string,
the
[D,El register
pair
points
bytes
called
the
"string
descriptor."
Byte
0 of the
descriptor
contains
the length
of the
string
(0
to
Bytes
1 and 2, respectively,
are the
lower
and upper
of the string
starting
address
in string
space.
CAUTION:
If
the
argument
is
a
string
literal
in
the
program,
the
string
descriptor
will
point
to program
text.
Be careful
not to alter
or destroy
your
program
this
way.
To
avoid
unpredictable
results,
add
+"
II
to
the string
literal
in the program.
Example:
This will
copy
the string
literal
into string
space
and will
prevent
alteration
of program
text during
a subroutine
call.
Usually,
the value
returned
by a USR
function
is
the
same
type
(integer,
string,
single
precision
or double
precision)
as the argument
that was passed
to it.
However,
calling
the
MAKINT
routine
returns
the integer
in
[H,LJ as the value
of
the function,
forcing
the value
returned
by the function
to
be
integer.
To execute
MAKINT,
use the following
sequence
to return
from
the subroutine:
POSH
LBLD
X'l'HL
H
xxx
1save value
to be returned
1get address
of MAKINT
routine
;save return
on stack
and
;get back
[H,Ll
1return
Also,
the argument
of the function,
regardless
of its
type,
may be forced
to an integer
by callinq
~~e FRCINT
routine
to
get the integer
value
of the argument
in
[H,LJ.
Execute
the
following
routine:
LXI
H
;get address
of subroutine
;continuation
PUSH
H
;place on stack
\~.
LHLD
xxx
;get address
of FRCINT
PCHL
SUB1 :
• •
.
•
.
Summary of Contents for Basic Interpreter Basic 80
Page 1: ...5IA iC intc tit tcl c t ...
Page 2: ......
Page 6: ... ...
Page 10: ......
Page 26: ......
Page 33: ...2 5 Intentially left blank ...
Page 37: ...BASIC SO COMMANDS AND STATEMENTS 2 9 Intentially left blank ...
Page 112: ......
Page 136: ......
Page 140: ......
Page 160: ......
Page 165: ......
Page 166: ......
Page 174: ......
Page 176: ......
Page 182: ......
Page 184: ......
Page 190: ......