278
The
VIC
20
User
Guide
equivalent, 255. The number 65536 would then be stored into the
1540's memory as CHR$(255)CHR$(255). Any number
that
can be
expressed in only one byte
(0
to 255) must be entered
that
way.
4.
You must indicate how many bytes are being transferred. This
should also be expressed as hexadecimal numbers converted to
decimal notation, as above.
5.
The MEMORY-WRITE instruction must be abbreviated "M-W".
No colon
or
other punctuation
is
allowed.
The code, then, to store
255
into memory location
768
($0300)
is
as
follows:
OPEN
15,8,15
PRINTI15,IM-W"CHR$(00)CHR$(03)CHR$(1)CHR$(255)
CLOSE
15
MEMORY-READ
It
is
possible to read any memory location in the
1540
using the
MEMORY-READ instruction. This instruction allows you to read one
byte at a time from the disk drive memory, similar to the way PEEK allows
you to read one byte
at
a time from the VIC 20's memory.
The BASIC instruction to read memory location
768
would be
PRINT
PEEK(768)
The same instruction using the MEMORY-READ instruction would look
like this.
40
OPEN
15,8,15
50
PRINTtl15,IM-R"CHR$(00)CHR$(03)
60
GEnUS,
A$
70
PRINT
R.
8e
CLOSE
15
This
is
what happened: First,
we
opened the command (error) channel
and then requested the MEMORY-READ instruction. On the same line
(with no additional punctuation) the byte to be read was specified (low byte
first, then high byte). This
is
memory location
300-the
same as
768
decimal.