EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 201

Radio Shack TRS-80 Model III
274 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BASIC
USR(*J
This function lets you
call a
machine-language
subroutine
and then continue
execution of your BASIC
program.
"Machine language"
is the
low-level language used
internally by
your Computer.
It
consists ofZ-80
microprocessor
instructions.
Machine-language subroutines
are
useful
for special applications
(things you
can't do in BASIC)
and simply because
they can do
things very fast
(like white-out the
Display).
Writing such
routines requires
familiarity
with
assembly-language
programming
and with the Z-80
instruction set.
For more
information on this
subject, see the
Radio Shack book, TRS-80
Assembly-Language
Programming, by
William Barden,
Jr. , and the
instruction manual for
Radio Shack's
EDITOR-ASSEMBLER (26-2002).
Getting the
USR routine
into memory
1
.
You
should first
reserve the area in
high memory
where the
routine will be
located. This is done
immediately after
power-up by
answering the
MEMORY
SIZE? question with
the address preceding the
start
address of your
USR
routine.
For example,
if your routine
starts at
32700,
then type 32699
in
response to
MEMORY SIZE?.
2
.
Then load
the routine into
memory
.
A. If it is stored
on
tape
in the
SYSTEM format
(created
with
EDITOR-ASSEMBLER), you must
load it
via the
SYSTEM command, as
described in
Chapter 2. After
the tape has
loaded press
(BREAK) to return to
the BASIC immediate mode.
B
.
If it is a
short routine, you may
simply
want to
POKE it into high
memory.
Telling
BASIC where the
USR routine
starts
Before you can
make the USR
call, you
have to tell
BASIC the
entry address to
the
routine. Simply
POKE the two-byte
address
into memory
locations
16526-16527:
least
significant byte
(LSB) into 16526,
most
significant byte
(MSB) into
16527.
For example,
if the
entry point is at
32700:
32700
decimal
=
7FBC
hexadecimal
LSB
=
BC
hexadecimal
=
188
decimal
MSB
=
7F
hexadecimal
=
127
decimal
So use
the statements:
POKE 16526,
188
POKE 16527,
127
to
tell BASIC that
the USR routine
entry is at
32700.
191

Other manuals for Radio Shack TRS-80 Model III

Related product manuals