Re: [cc65] CBM units

From: Oliver Schmidt <>
Date: 2010-02-03 23:36:40

>> 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).

> 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.

Things are obviously more complicated :-( When a cc65 main() is
entered the zeropage location $BA doesn't contain the number of the
unit the program was loaded from (anymore). This is BTW the code I

  _curunit = *(unsigned char *)0xBA;

Best, 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 23:36:55 2010

This archive was generated by hypermail 2.1.8 : 2010-02-03 23:36:57 CET