Re: [cc65] Questions for CBM guys

From: Spiro Trikaliotis <>
Date: 2008-03-03 08:44:10

* On Sun, Mar 02, 2008 at 06:51:10PM +0100 wrote:
> On 2008-03-02, at 13:11, Oliver Schmidt wrote:
> >- The C64 (and C128 ?) Kernal allows for 15 open files,
> This is suspicious, probably wrong. The LAT, FAT, and SAT tables in  
> the 64 are only big enough to accommodate maximum ten files open  
> simultaneously. Since I remember that those ten do not count keyboard  
> (stdin) and screen (stdout), we are at the level of 12 files  
> altogether.

Now, you are missing nothing - you are absolutely right.

The number 15 must be a misunderstanding of the (theoretically) 15
possible open channels, defined by the secondary address (the X in open
1,8,x, with x=15 being the special command channel). I do not know where
this limitation comes from: The IEC bus would allow for secondary
addresses of even 0-30 (I am not totally sure about 31, so I will keep
it out).

But, as already stated, the KERNAL allows for up to 10 files, but the
floppy (DOS) allows for up to 3 files open.

BTW: Oliver, perhaps you are confused because there was a mentioning of
the DOS. Unlike on other machines, the DOS is built-in into the flopy
drive on the CBM series, as it is its own computer (6502 CPU, VIA 6522,
...). Thus, we have limitations of the KERNAL (inside of the C64) and of
the DOS (inside of the floppy).

BTW: The two special devices for screen (3) and keyboard (0) are
normally handled specially; thus, they do not count in the KERNAL as
open files. Nevertheless, if you like to, it is possible to open them
specifically (OPEN 1,3 for the screen, OPEN 1,0 for the keyboard) - in
which case, they occupy place in the internal KERNAL tables, and they
would count.

> >- There are Kernal entry points available both for the C64 and C128 to
> >allow for direct printing to the screen bypassing the file/channel
> >abstraction layer.
> Screen - yes. It's the easiest and somewhat privileged output channel.

On the C64, $F15B reads from the keyboard (but: It only reads-in WHOLE
LINES! Thus, no single keystrokes), and $F16A reads in from the current
position of the screen.

To get a character from the keyboard buffer, use $E5B4.


Spiro R. Trikaliotis                               
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Mar 3 08:44:31 2008

This archive was generated by hypermail 2.1.8 : 2008-03-03 08:44:35 CET