Re: [cc65] C64 drive direct access question

From: Spiro Trikaliotis <>
Date: 2005-10-23 13:37:54
Hello Raj,

* On Sat, Oct 22, 2005 at 08:59:55PM +0200 I wrote:
> In fact, I think your problem with the C code most probably is that
> you forget to send the CR after the line. (I would have to check again
> if this CR is really needed, but this is my guess).

I rechecked: Now, this is not the case. Your code somehow did not send
an EOI to the floppy.

Take for example the following:

OPEN 1,8,15

you see the floppy moving head immediately.

Now, take the following:
OPEN 1,8,15
PRINT CHR$(0)CHR$(0)CHR$(1)CHR$(176);
REM nothing happens yet
REM now, the floppy moves

That is, the floppy does not execute the command until it gets an
UNLISTEN or EOI (yes, now, I remember I have written this to cbm-hackers



for the C64 side, and the thread around

for a discussion on the floppy side.

The important part is not the UNLISTEN but the EOI which is send out
before the UNLISTEN.

Now, how can you "forget" to send an EOI? Whenever you send data via the
C64's kernal routines, every byte is sent "delayed". This is because the
EOI (end of information) has to be signalled *before* the last byte is
sent over. For this, the kernal buffers the last byte and sends it out
when the next byte is there. Now, if you send an UNLISTEN, UNTALK, or
something else with ATN, the last buffered byte is send with an EOI

Thus, in your case, you could try to UNLISTEN the floppy (which sends
the last byte and the EOI) to fix your program.

Now, if this does not help you, you might consider posting your complete
code (or, if it is too large, put it up somewhere and send a link, or
send it directly to me via mail), so I (and others) could have a look?


Spiro R. Trikaliotis
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Oct 23 13:38:16 2005

This archive was generated by hypermail 2.1.8 : 2005-10-23 13:38:19 CEST