Download Print this page

Radio Shack TRS-80 model III Owner's Manual page 115

Mini-disk operation, trsdos disk operating system, disk basic programming language
Hide thumbs Also See for TRS-80 model III:

Advertisement

TRS-80
MODEL
III
DISK
SYSTEM
1
.
Define
usr
as a routine
with an
entry point
at
hex
7D00
(line 10).
2.
Transfer control
to
the routine; the
value
x can be
passed
to
the routine
if
the
routine
makes
the
call
described
below
(line
100).
3.
When
the routine returns
to
basic,
the variable
a
may
contain
the
value
passed
back from
the routine
(if
your
routine
makes
the
jump
described
below); otherwise
a
will
be assigned
the
value of
x
(line
100).
Passing
arguments
to
and from
USR
routines
There
are several
ways
to
pass
arguments back and
forth
between your
basic
main program and
your
usr
routines: the
two
major
ways
are
listed
below.
1.
poke
the
argument(s)
into fixed
ram
locations.
The
machine-language
routine
can
then access these values
and
place
results in
other
ram
locations.
When
the routine returns control to
basic,
your program can peek
into
these
addresses
to
pick
up
the
"output"
values.
This
is
the only
way
to
pass
two
or
more
arguments back and
forth.
2.
Pass
one argument
to
the routine
as the
argument
in
the
usRn
call,
then use
special
rom
calls to
access
this
argument and
return a
value
to
basic.
This
method
is
limited
to
sending
one
argument and
returning
one
value
(both
are integers).
rom
Calls
call
0A7FH
Puts
the
usr argument
into the
hl
register
pair;
h
contains
msb,
l
contains lsb. This
call
should be
the
first
instruction
in
your
usr
routine.
jp
oa9ah
Use
this
jump
to
return
to
basic;
the integer
in
hl becomes
the
output of
the
usr
call. If
you
don't care
about
returning hl, then
execute
a
simple RETurn
instruction instead
of
this
jump.
Listed
below
is
an
assembled program
to
white out
the display (an
"inverse"
clear
key!).
Don't
type
it
in.
Type
in
the
basic
program
that
follows
it.
7D00
3C00
00BF
03FF
00100
00110
00120
00130
00140
00150
00160
00170
00180
00130
00200
00210
00220
ZAP
OUT SCREEN USR FUNCTION
ORG
EQUATES
MI
DEO
WHITE
COUNT
EQU
EQU
EQU
7D00H
3C00H
0BFH
3FFH
5
start
of
mi
deo ram
;all
white graphics byte
i
NUMBER
OF
BYTES
TO
HOME
PROGRAM CHAIN MOVES
X'BF'
INTO ALL OF
VIDEO RAM
114

Advertisement

loading