Binary format
-The standard binary output format generated by the linker for the
-Apple ][ target is a machine language program with a 4 byte DOS
-3.3 header containing the load address and load size. The standard load address
-is $803.
-
-The DOS 3.3 header is in its own segment named
- HEADER: start = $0000, size = $0004, file = %O;
-
-
-to
-
-
- HEADER: start = $0000, size = $0004, file = "";
-
-
-in the linker configuration to have the linker remove it.
+The standard binary file format generated by the linker for the
+Apple ][ target is a binary program with a 4 byte DOS 3.3 header
+containing the load address and load length. The default load address is
+$803.
) includes an option ) includes the option for those programs
+omits the DOS 3.3 header.
Memory layout
In the standard setup, cc65 generated programs use the memory from
-$803 to $95FF, so 35.5KB of RAM are available. While running
-
+
-Enabling the Language Card allows to use it as additional memory for executable
-code. Actually doing so requires either to compile code with the option
-.
-
- LC: start = $D400, size = $0C00, define = yes;
-
-to
-
- LC: start = $D000, size = $3000, define = yes;
-
+Linker configurations
+
+The ld65 linker comes with a builtin config file for the Apple ][,
+which is used via /.
+
+
+builtin config file
+
+Default configuration optimized for a binary program running on ProDOS 8 with
+BASIC.SYSTEM. A plain vanilla ProDOS 8 doesn't actually use the Language Card
+bank 2 memory from $D400 to $DFFF.
+
+
+
+
+ From $803 to $95FF (35.5 KB)
+
+
+ From $D400 to $DFFF (3 KB)
+
+
+ Variable (default: $803)
+
+
+ DOS 3.3 header (address and length)
+
+
+
+
+
+
+Configuration optimized for a binary program running on DOS 3.3. A plain
+vanilla DOS 3.3 doesn't make use of the Language Card at all.
+
+
+
+
+ From $803 to $95FF (35.5 KB)
+
+
+ From $D000 to $FFFF (12 KB)
+
+
+ Variable (default: $803)
+
+
+ DOS 3.3 header (address and length)
+
+
+
+
+
+
+Configuration for a system program running on ProDOS 8.
+
+
+
+
+ From $2000 to $BEFF (39.75 KB)
+
+
+ From $D400 to $DFFF (3 KB)
+
+
+ Fixed ($2000)
-in the linker configuration to define the whole 12KB Language Card address
-space as memory area for executable code.
+
+ None
+
+
+
+
+
+
+Configuration optimized for a binary program running on ProDOS 8 without
+BASIC.SYSTEM. Intended to be used with
+
+
+ From $800 to $BEFF (45.75 KB)
+
+
+ From $D400 to $DFFF (3 KB)
+
+
+ Variable (default: $800)
+
+
+ DOS 3.3 header (address and length)
+
+
+
+
+
+
+Configuration optimized for a binary program running on ProDOS 8 without
+BASIC.SYSTEM. Intended to be used with
+
+
+ From $800 to $BEFF (45.75 KB)
+
+
+ From $D000 to $DFFF (4 KB)
+
+
+ Variable (default: $800)
+
+
+ DOS 3.3 header (address and length)
+
+
+
+
+
+ProDOS 8 system programs
+
+ProDOS 8 system programs are always loaded to the start adress $2000.
+For cc65 programs this means that the 6 KB from $800 to $2000 are
+by default unused. There are however several options to make use of that memory
+range.
+
+
+LOADER.SYSTEM
+
+The easiest (and for really large programs in fact the only) way to have a cc65
+program use the memory from $800 to $2000 is to link it as binary
+(as opposed to system) program using the linker configuration
+ with start address
+$800 and load it with Heap
+
+If the cc65 program can be successully linked as system program using the linker
+configuration but
+uses the heap either explicitly or implicitly (i.e. by loading a driver) then
+the memory from $800 to $2000 can be added to the heap by calling
+ProDOS 8 I/O buffers
+
+ProDOS 8 requires for every open file a page-aligned 1 KB I/O buffer. By default
+these buffers are allocated by the cc65 runtime system on the heap using
+
+cl65 -t apple2 -C apple2-system.cfg myprog.c apple2-iobuf-0800.o
+
@@ -155,7 +320,7 @@ you cannot do it, it just means that there's no help.
Interrupts
+ generally works with all ProDOS 8
devices, the function
-simply always return 280 (which is only correct for a 140KB disk).
+simply always return 280 (which is only correct for a 140 KB disk).
Direct console I/O
- Color
+ ,
and
have no effect.
- Cursor
+ has no effect.