Programming The Disk Controller; Block-Execute; Memory-Read - Commodore 1541 User Manual

Disk drive
Hide thumbs Also See for 1541:
Table of Contents

Advertisement

8,
PROGRAMMING THE DISK CONTROLLER
The expert programmer can actually design routines that reside and operate on the
disk controller. DOS routines can be added that come from the diskette. Routines can
be added much the same way as the DOS Support Program is "wedged" into your
memory.
BLOCK-EXECUTE
This command will load a block from the diskette containing a machine language
routine, and begin executing it at location 0 in the buffer until a RTS (ReTurn from
Subroutine) command is encountered.
FORMAT FOR BLOCK-EXECUTE:
PRINT#file#, "B-E:" channel; drive; track; block
MEMORY-READ
There is 16K of ROM in the disk drive as well as 2K of RAM. You can get direct
access to these, or to the buffers that the DOS has set up in the RAM, by using the
MEMORY commands. MEMORY-READ allows you to select which byte to read,
through the error channel.
FORMAT FOR MEMORY-READ:
PRINT#file#, "M-R" CHR$(low byte of address) CHR$(high byte)
(no abbreviation!)
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# to the error channel will give peculiar results when you're using this
command. This can be cleared up by any other command to the disk (aside from a
memory command).
PROGRAM TO READ THE DISK CONTROLLER'S MEMORY:
10
OPEN15,8,15
20
INPUT"LOCATION PLEASE";A
25
FORL=lTO50
30
A1 = INT(A/256):A2 = A-A1*256
40
PRINT#15,"M - R"CHR$(A2)CHR$(A1)
50
GET#1
60
PRINT ASC(A$ + CHR$(0));
70
A=A+1
80
NEXT
90
INPUT "CONTINUE";A$
100 IF LEFT$(A$,1)= "Y" THEN 25
110 GOTO20
45
GET CHARACTERS
FROM ERROR
CHANNEL

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents