EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 199

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
OUTport,
value
Outputs
a
byte value
to
the specified port. OUT is not
a
function but
a
statement
complete in itself. It
requires
two arguments separated by
a
comma (no
parenthesis): the port destination and
the byte value to
be
sent.
port
and
value are in the range to 255.
PEEK(address)
Returns the value stored at the specified byte
address (in decimal
form) . To use
this
function
,
you ' 11 need to refer to two sections of the Appendix : the Memory
Map
(so
you
' 11 know where to PEEK) and the Table of Function ASCII and Graphics Codes
(so you'll
know what
the values
represent).
If you're using PEEK to
examine object files, you'll also need
a
microprocessor
instruction
set manual (one is
included with the
TRS-80
Editor/Assembler
Instruction Manual).
PEEK is valuable for
linking machine
language routines
with Model III BASIC
programs. The
machine language
routine can store
information in
a
certain memory
location, and PEEK may be used inside your BASIC program to retrieve
the
information. For example,
A= PEEK
(17999)
returns the value stored at location 17999
and assigns that value to the variable A.
Peek may also
be
used to retrieve
information stored with
a
POKE statement. Using
PEEK and POKE allows
you
to set
up
very compact,
byte-oriented storage
systems.
Refer
to
the Memory
Map
in the Appendix to determine the appropriate locations
for this
type of storage. See POKE, USR.
POKE address,
value
Loads
a
value into
a
specified memory location. POKE is
not
a
function but
a
statement complete in itself. It requires two arguments: a byte address
(in
decimal
form) and
a
value. The value must be between and 255 inclusive. Refer to the
Memory
Map
in the Appendix to see which addresses you'd like to POKE.
To POKE (or
PEEK)
an address above 32767,
use the following formula:
—1
*
(65536-desired address)
=
POKEORPEEK
address.
For example,
to POKE
into
address
32769,
use POKE
-
32767,
value.
189

Other manuals for Radio Shack TRS-80 Model III

Related product manuals