MEMORY
-READ
The disk contains 32K
of
ROM (Read-Only Memory),
as
well as 4K of RAM (Read-
Write Memory)
of
which only 2K is used. You can get direct access
to
any location within
these, or to the buffers that the DOS has set
up
in
RAM,
by
using memory commands.
MEMORY-READ allows you
to
select which byte or bytes
to
read from disk memory into
the computer. The MEMORY-READ command
is
the equivalent of the BASIC PeekO
function, but reads the disk's memory instead
of
the computer's memory.
NOTE: Unlike other disk commands, those in this chapter cannot be spelled out
in
full. Thus, M-R is correct, but MEMORY-READ
is
not a permitted alternate
wording.
FORMAT FOR THE MEMORY-READ COMMAND:
PRINT#15,
"M-R"CHR$(
<address)CHR$(>address)CHR$(# of bytes)
where
"<address"
is
the low order part, and
">address"
is
the high order part of the
address in disk memory
to
be read.
If
the optional
"#
of
bytes"
is
specified, it selects
how many memory locations will be read in, from 1-255. Otherwise, 1 character will be
read.
ALTERNATE FORMAT:
PRINT # 15,
"M
-R' 'CHR$( <address )CHR$( > address )CHR$( # of bytes)
The next byte read using the
GET#
statement through channel
#15
(the error
channel), will be from that address
in
the disk controller's memory, and successive bytes
will be from successive memory locations.
Any
INPUT#
from the error channel will give peculiar results when you're using
this command. This can
be
cleared
up
by
sending any other command
to
the disk, except
another memory command.
EXAMPLES:
To see how many tries the disk will make
to
read a particular sector, and whether
"seeks"
one-half track
to
each side will be attempted if a read fails, and whether
"bumps"
to
track one and back will be attempted before declaring the sector unreadable,
you can use the following lines. They will read a special variable
in
the zero page
of
disk
memory, called REVCNT. It
is
located at $6A hexadecimal.
75