Re: Re: [cc65] raw disk access (was: cr/lf translation?)

Date view Thread view Subject view

Date: 2002-07-12 19:46:13

Hi all,
block access is quite easy, you could do it yourself in some 30 minutes.
Go to and get the 1541 users manual.
Look at the chapter on disk access.
6.9 USER1 and USER2

The USER commands are generally designed to work with machine language
(see chapter 8 for more on this).  The USER1 and USER2 commands are
special versions of the BLOCK-READ and BLOCK-WRITE commands, but...
with an important difference: the way USER1 and USER2 work with the

The BLOCK-READ command reads up to 256 characters, but stops reading
when the buffer-pointer stored with the block says that block is
finished.  The USER1 command performs the BLOCK-READ operation, but
first forces the pointer to 255 in order to read the entire block of
data from the disk.


   PRINT#file#, "U1:" channel; drive; track; block


   PRINT#file#, "UA:" channel; drive; track; block

There is no difference between the U1 and UA designations for this

The BLOCK-WRITE command writes the contents of the buffer to the block
on the disk along with the value of the buffer-pointer.  The USER2
command writes the buffer without disturbing the buffer-pointer value
already stored on that block of the diskette.  This is useful when a
block is to be read in with BLOCK-READ, updated through the BUFFER-
POINTER and PRINT# statements, and then written back to the diskette
with USER2.


   PRINT#file#, "U2:" channel; drive; track; block


   PRINT#file#, "UB:" channel; drive; track; block

For a more complex sample program, see Appendix C.

Only one problem, how to access the disk drive from C?  There are the assembly
functions already present.  Try cbm_open(2, 8, CBM_READ, "data,s");
Look at include/cbm.h.

Communicate in total privacy.
Get your free encrypted email at

Looking for a good deal on a domain name?

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.

Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-07-12 19:46:26 CEST