Download Print this page

Radio Shack TRS-80 Model II Reference Manual page 233

Disk operating system
Hide thumbs Also See for TRS-80 Model II:

Advertisement

Technical Information
LOOKUP
Look Up in a Table (function code 28)
This routine performs a lookup function on a table of three-byte entries. Each entry
looks like this:
Byte 1
Bytes 2-3
Search Key
Data, e.g., an address
in
LSB, MSB
sequence
At the end of the table, you must place one-byte
X'FF'.
Since
X'FF'
is the table
terminator, your search keys must be between
X'OO'
and
X'FE'.
Given a one-byte search argument, the routine locates the first matching entry in the
table. The routine uses a sequential search algorithm.
Entry Conditions
(HL)
=
First byte of table
B
=
Search argument
A
=
L.C
Exit Conditions
NZ
=
Search argument not found
If Z is set, then
HL
=
Data. H contains byte three, L contains byte two.
User Notes
Ifthe table contains search keys followed by addresses, then upon return from the
routine with the Z flag set, you can:
JP (HL)
to transfer control to the desired address.
269

Advertisement

loading