Re: [cc65] CBM units

From: Oliver Schmidt <>
Date: 2010-02-03 22:55:42
Hi Uz,

> The _curunit variable is part of the common CBM library, while the zeropage
> variable is machine specific. And I'm not even sure that all CBM machines have
> such a variable. This is of course nothing that prevents such a constructor,
> it just complicates things. Which was probably the reason why the module that
> defines _curunit does not also have such a constructor.

I see. Now having access to the repository I notice the file
cbm/filevars.s. I seems quite easy to "unshare" that file for the
different CBM machines and provide an individual constructor for the
machines with a well known current unit zeropage location.

If the information in question can be brought up in this thread I'm
willing to do the changes - if necessary.

> The kernal has no such thing. You have to specify a unit each time, a file is
> loaded. On the C64 there is just a variable where the kernal remembers the
> unit from the last LOAD. It is not used for anything else (CBM hackers: please
> correct me if this is wrong).

I see. If there's no explicitly user-modifyable current unit then in
my opinion performing all disk I/O by default on the same unit the
program was loaded from is the best solution.

According to some research in the net and verification with VICE the
location is $BA both on the C64 and C128 (native mode). I'll add the
setting of _curunit based on $BA to the Contiki framework until cc65
2.14 (hopefully) does this.

Thanks for the CBM crash course, Oliver
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Feb 3 22:55:46 2010

This archive was generated by hypermail 2.1.8 : 2010-02-03 22:55:48 CET