Memory-Execute - Commodore 1551 User Manual

Table of Contents

Advertisement

ALTERNATE FORMAT:
PRINT# 15,' 'M-W:"CHR$( <address)CHR$(>address)CHR$
(# of bytes)CHR$(data byte(s))
EXAMPLES:
We can use this line to tum 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 has
been damaged and cannot be read normally.
PRINT# 15, "M-W"CHR$(l06)CHR$(0)CHR$( I )CHR$(3I)
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 track
I).
Bit 6. if set, means no seeks. In that case, the dri ve won' t attempt to read the hal f-track
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.
MEMORY -EXECUTE
Any routine in disk memory, either in RAM or ROM, can be executed with the
Memory-Execute command. It is the equivalent of the Basic Sys call to a machine
language program or subroutine. but works in disk memory instead of within the com-
puter.
FORMAT 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
address in disk memory at which execution is to begin.
66

Advertisement

Table of Contents
loading

Table of Contents