<article>
<title>Commodore 16/116 specific information for cc65
-<author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
-<date>2003-12-15
+<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">
+<date>2014-04-10
<abstract>
An overview over the C16 runtime system as it is implemented for the cc65 C
files, available drivers, and any pitfalls specific to that platform.
Please note that C16 specific functions are just mentioned here, they are
-described in detail in the separate <htmlurl url="funcref.html" name="function
+described in detail in the separate <url url="funcref.html" name="function
reference">. Even functions marked as "platform dependent" may be available on
more than one platform. Please see the function reference for more
information.
Since the C16/C116 and the Commodore Plus/4 are almost identical (the former
-don't have the 6551 ACIA and only 16KB of memory), the <htmlurl
+don't have the 6551 ACIA and only 16KB of memory), the <url
url="plus4.html" name="Plus/4 documentation"> is also worth a look. The
difference between both cc65 targets is that the Plus/4 runtime uses banking
to support full 64K RAM, while the C16 does not use banking and supports up to
<sect>Binary format<p>
-The standard binary output format generated by the linker for the C16/C116
-target is a machine language program with a one line BASIC stub. This means
-that a program can be loaded as BASIC program and started with RUN. It is of
-course possible to change this behaviour by using a modified startup file and
-linker config.
+The standard binary output format generated by the linker for the C16/116
+target is a machine language program with a one line BASIC stub which, calls
+the machine language part via SYS. This means that a program can be loaded as
+BASIC program and started with RUN. It is of course possible to change this
+behaviour by using a modified startup file and linker config.
<sect>Memory layout<p>
cc65 generated programs with the default setup run with the kernal and basic
-banked out. This gives a usable memory range of $1000 - $4000
-(or $8000 i the machine is equipped with 32K RAM or more). Having the
-kernal and basic ROMs banked out means, that no ROM entry points may be called
+banked in. This gives a usable memory range of $1000 - $4000
+(or $8000 if the machine is equipped with 32K RAM or more). Having the
+kernal and basic ROMs banked in means, that ROM entry points may be called
directly from user code.
Special locations:
<sect1>CBM specific functions<p>
Some functions are available for all (or at least most) of the Commodore
-machines. See the <htmlurl url="funcref.html" name="function reference"> for
+machines. See the <url url="funcref.html" name="function reference"> for
declaration and usage.
<itemize>
<sect>Loadable drivers<p>
+The names in the parentheses denote the symbols to be used for static linking of the drivers.
+
+
<sect1>Graphics drivers<p>
No graphics drivers are currently available for the C16/C116.
<descrip>
- <tag><tt/c16-ram.emd/</tag>
+ <tag><tt/c16-ram.emd (c16_ram_emd)/</tag>
A driver for the hidden RAM below the BASIC and KERNAL ROMs. Supports 125
pages with 256 bytes each if the machine is equipped with 64K of memory
(a Plus/4 or a memory extended C16/116).
<descrip>
- <tag><tt/c16-stdjoy.joy/</tag>
+ <tag><tt/c16-stdjoy.joy (c16_stdjoy_joy)/</tag>
Supports up to two joysticks connected to the standard joysticks port of
the Commodore 16/116.
<sect1>Mouse drivers<p>
-Currently no drivers available (in fact, the API for loadable mouse drivers
-does not exist).
+No mouse drivers are currently available for the C16/C116.
<sect1>RS232 device drivers<p>
<tt/ST/ variable.
+<sect1>Interrupts<p>
-<sect>Bugs/Feedback<p>
-
-If you have problems using the library, if you find any bugs, or if you're
-doing something interesting with it, I would be glad to hear from you. Feel
-free to contact me by email (<htmlurl url="mailto:uz@cc65.org"
-name="uz@cc65.org">).
+The runtime for the C16 uses routines marked as <tt/.INTERRUPTOR/ for
+interrupt handlers. Such routines must be written as simple machine language
+subroutines and will be called automatically by the interrupt handler code
+when they are linked into a program. See the discussion of the <tt/.CONDES/
+feature in the <url url="ca65.html" name="assembler manual">.