Chapter 8 Peripheral Devices 279
Note: The instruction
"M-R"
is
the only valid way to invoke this
instruction. Spelling out the instruction will cause
an
error.
After the
data
in
that
location are read, they can be transferred to the
computer through the error channel (#15).
To
read them from the error
channel
we
used the instruction GET#
15,
A$. The values were then avail-
able as variable A$, which
we
printed to the screen. Finally,
we
closed the
command (error) channel.
Since the
data
read from the 1540 memory are transmitted through the
error channel, you should not try to read
an
error condition from the error
channel again until you have closed it and reopened it.
If
you do not do this,
you will get the data which were transmitted instead of the error message.
MEMORY-EXECUTE
The MEMORY-EXECUTE instruction
is
used to run a machine lan-
guage program that has been entered into the 1540's memory. The program
must end with
an
R TS instruction so that the processor will return control
to VIC 20; otherwise the 1540's internal memory will probably go into an
endless
loop-if
not worse.
The format
of
the MEMORY-EXECUTE (M-E) instruction
is
essen-
tially the same as that
of
the
MEMORY-READ
instruction.
40
OPEN
15,8,15
50
PRINT#15,"M-E"CHRS(00)CHRS(03>
60
CLOSE
15
This sequence will send the DOS into a routine that begins at the 1540's
memory location 300
(768
decimal).
USER
COMMANDS
The 1540 makes use
of
a number
of
commands called user commands
(do not mistake these for USR routines, which are a part
of
BASIC). These
commands perform a number
of
convenient functions that are similar to the
other commands in this section.
U1
The UI command
is
similar to BLOCK-READ.
In
fact, its format
is
identical.
Look
at the BLOCK-READ command. B-R
is
simply replaced