EasyManua.ls Logo

Radio Shack TRS-80 Model 3 - Page 199

Radio Shack TRS-80 Model 3
276 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...
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 0 to 255.
PEEK(address)
Returns the value stored at the specified byte address (in decimal form).
To
use this
function,
you'll
need to referto two sections
ofthe
Appendix: the Memory Map (so
you'll
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 beused inside yourBASIC programto retrieve the
information. For example,
A = PEEK (17999)
returns the value stored at location 17999 and assigns that value to the variable A.
Peekmay 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.
Referto 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
statementcomplete in itself.
It
requires two arguments: a byte address (in decimal
form) and a value. The value mustbe between 0 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) =
POKE
OR
PEEK
address. Forexample, to
POKE
into
address 32769, use
POKE
-32767,
value.
8/5

Related product manuals