Machine Language Control Statements - Sharp mz-800 Owner's Manual

Hide thumbs Also See for mz-800:
Table of Contents

Advertisement

6.7
Machine Language Control Statements
PEEK
Format
PEEK <address>
Explanation
This function returns the contents of the specified address as a decimal number from
0 to 255. <address> may be a decimal number from 0 to 65535 or a 4-digit hex-
adecimal number from $0000 to $FFFF.
Example
The following program displays data stored in the area from 40960 ($A000) to 40975
($AO0F):
10 FOR AD=40960 TO 40975
20 PRINT PEEK (AD)
30 NEXT AD
40 END
POKE
Format
Explanat ion
POKE <address>, <data>[, <data>] ...
The POKE statement writes a consecutive number of data values starting at the speci-
fied address.
<address> may be a decimal number from 0 to 65535 or a 4-digit hexadecimal
number from $0000 to SFFFF, <datan>
may range from 0 to 255 or from $00
to $FF. This statement can write data to any memory location, regardless of the
limit set by the LIMIT statement. Therefore, careless use of this statement can des-
troy the monitor or BASIC interpreter.
POKE $D000,$5F .
POKE 53248,95 ...
The two statements above perform the same function.
.. Uses hexadecimal numbers.
.. Uses decimal numbers.
INP@
Format
Explanat ion
INP@
<port number>, <variable>
The INP@ statement reads 8-bit data from the input port specified in < port num-
ber >, converts it into a decimal number and assigns it to
<variable>. <port num-
ber> may be in the range 0 to 127 (hexadecimal $00 to $7F). Port addresses 128
to 255 ($80 to $FF) are reserved for optional peripheral devices.
=a fr
tes

Advertisement

Table of Contents
loading

Table of Contents