Commodore 1541-II Podręcznik Użytkownika Strona 43

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 55
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 42
FORMAT FOR
THE
MEMORY-WRITE COMMAND:
PRINT#
15
,'
'M
-W' 'CHR$( <address)CHR$(>address)CHR$
(#
of
bytes)CHR$(data byte(s))
where
" < address" is the low order part, and "
>address"
is
the high order part
of
the
address in disk memory to begin writing,
"#
of
bytes"
is the number
of
memory
locations that
will be written (from 1-34), and
"data
byte" is I
or
more byte values
to
be
written into disk memory, each as a CHR$() value.
If
desired, a colon (:) may follow
M-
W within the quotation marks.
ALTERNATE
FORMAT:
PRINT#
15
,'
'M
-W:
''
CHR$(
<address)CHR$(>
address)CHR$
(#of
bytes)CHR$(data byte(s))
EXAMPLES:
We can use this line to turn off the
" bumps" when loading DOS-protected programs (i.e.,
programs that have been protected against being copied by creating and checking
for
specific disk errors).
PRINT#
15
,'
'M-W
' 'CHR$( 106)CHR$(0)CHR$( I )CHR$( 133)
The following line can be. used
to
recover bad sectors. such as when an important file h
as
been damaged and cannot be read norrnally.
PRINT#
15
,"
M-
W'
'CHR$( I 06)CHR$(0)CHR$(1 )CHR$(3 I)
The above two examples may be very useful under some circumstances. They are
the
equivalent
of
POKE 106,
133
and POKE 106,
31
respectively, but
in
disk memory,
not
inside the computer. As mentioned
in
the previous section's first example, location 106
in
the
1541
disk drive signifies three separate activities to the drive, all related to error
recovery. Bit 7 (the high bit),
if
set means
no
bumps (don't thump the drive back to tra
ck
I)
. Bit 6,
if
set, means no seeks. In that case, the drive won't attempt
to
read the half-tr
ack
above and below the assigned track
to
see if it can read the data that way.
The
bottom 6
bits are the count
of
how many times the disk will try to read each sector before and after
trying seeks and bumps before giving
up
. Since
31
is
the largest number that can
be
expressed in 6 bits, that is the maximum number
of
tries allowed.
From this example, you can see the value
of
knowing something about Peeks, Pokes,
and machine-language before using direct-access disk commands, as well as their poten-
tial power.
·
76
&fEMORY
-EXECQTE
Any routine in disk memory, either in RAM or ROM, can be executed with the
pJemory-Execute command. It is the equivalent
of
the Basic Sys call to a machine
1a11guage
program
or
subroutine, but works in disk memory instead
of
within the com-
puter.
pORMAT FOR
THE
MEMORY-EXECUTE COMMAND:
PRINT#
15
,'
'M-E"CHR$(
<address)CHR$(> address)
where
"<
address"
is the low order part, and "
>address"
is the high order part
of
the
adlfress in disk memory at which execution is to begin.
ALTERNATE
FORMAT:
PRINT#
15
,' ' M-E: " CHR$(
<address)CHR$(>
address)
EXAMPLE:
Here is a Memory-Execute command that does absolutely nothing. The first instruc-
tion
it executes is an RTS, which ends the command:
PRINT#l5,
' 'M-E' 'CHR$(88)CHR$(242)
A more plausible use for this command would be to artificially trigger an
errO( message.
Don't forget to check the error channel,
or
you'll miss the message:
PRINT#
15,' 'M-E" CHR$(201)CHR$(239)
However, mast uses require intimate knowledge
of
the inner workings
of
the DOS, and
preliminary setup with other commands, such as Memory-Write.
BLOCK-EXECUTE
This rarely-used command will load a sector containing a machine language routine
into
a memory buffer from diskette, and execute it from the first location within the
buffer, until a ReTurn from Subroutine
(RTS) instruction ends the command.
PoRMAT
FOR
THE
BLOCK-EXECUTI;: COMMAND:
PRINT#I5,
" B-E
";
channel # ;drive # ;track
#;sector#
'Nbcre
"channel
# " is the channel number specified when the file into which the block
'Nill
be loaded was opened, "
drive#
" is the drive number (always 0 on the
1541
),
and
"track
#"
and " sector # " are respectively the track and sector numbers containing the
desired block
of
data to be loaded into the file buffer and executed there.
77
Przeglądanie stron 42
1 2 ... 38 39 40 41 42 43 44 45 46 47 48 ... 54 55

Komentarze do niniejszej Instrukcji

Brak uwag