<article>
<title>Commodore Plus/4 specific information for cc65
-<author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
-<date>2003-12-14
+<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">
+<date>2014-04-12
<abstract>
An overview over the Plus/4 runtime system as it is implemented for the cc65 C
available drivers, and any pitfalls specific to that platform.
Please note that Plus/4 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 Plus/4 and the Commodore 16/116 are almost identical (the latter are
-missing the 6551 ACIA and do only have 16KB of memory), the <htmlurl
+missing the 6551 ACIA and do only have 16KB of memory), the <url
url="c16.html" name="C16 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 32K RAM.
<sect>Binary format<p>
The standard binary output format generated by the linker for the Plus/4
-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.
+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>
<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>
</itemize>
+<sect1>CBM specific CPU functions<p>
+
+Some CPU related functions are available for some of the Commodore
+machines. See the <url url="funcref.html" name="function reference"> for
+declaration and usage.
+
+<itemize>
+<item>fast
+<item>slow
+<item>isfast
+</itemize>
+
+
<sect1>Hardware access<p>
The following pseudo variables declared in the <tt/plus4.h/ header file do
<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 Plus/4.
No extended memory drivers are currently available for the Plus/4.
-
<sect1>Joystick drivers<p>
<descrip>
- <tag><tt/plus4-stdjoy.joy/</tag>
+ <tag><tt/plus4-stdjoy.joy (plus4_stdjoy_joy)/</tag>
Supports up to two joysticks connected to the standard joysticks port of
the Plus/4.
</descrip><p>
-
<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 Plus/4.
<sect1>RS232 device drivers<p>
<descrip>
- <tag><tt/plus4-stdser.ser/</tag>
+ <tag><tt/plus4-stdser.ser (plus4_stdser_ser)/</tag>
Driver for the 6551 ACIA chip built into the Plus/4. Supports up to 19200
baud, hardware flow control (RTS/CTS) and interrupt driven receives. Note
that because of the peculiarities of the 6551 chip transmits are not
interrupt driven, and the transceiver blocks if the receiver asserts flow
control because of a full buffer.
-
+
You need an adapter to use the builtin port, since the output levels
available at the user port don't follow the RS232 standard.
<sect1>Passing arguments to the program<p>
-Command line argument passing is currently not supported for the Plus/4.
+Command line arguments can be passed to <tt/main()/. Since this is not
+supported by BASIC, the following syntax was chosen:
+<tscreen><verb>
+ RUN:REM ARG1 " ARG2 IS QUOTED" ARG3 "" ARG5
+</verb></tscreen>
-<sect1>Interrupts<p>
+<enum>
+<item>Arguments are separated by spaces.
+<item>Arguments may be quoted.
+<item>Leading and trailing spaces around an argument are ignored. Spaces within
+ a quoted argument are allowed.
+<item>The first argument passed to <tt/main/ is the program name.
+<item>A maximum number of 10 arguments (including the program name) are
+ supported.
+</enum>
-The runtime for the Plus/4 uses routines marked as <tt/.CONDES/ type 2 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 <htmlurl url="ca65.html" name="assembler manual">.
+<sect1>Program return code<p>
-<sect>Bugs/Feedback<p>
+The program return code (low byte) is passed back to BASIC by use of the
+<tt/ST/ variable.
+
+
+<sect1>Interrupts<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 Plus/4 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">.
</enum>
</article>
-
-
-
-