+ <tag><tt/LC:/ Language Card memory area</tag>
+ From $D400 to $DFFF (3 KB)
+
+ <tag><tt/STARTADDRESS:/ Program start address</tag>
+ Variable (default: $800)
+
+ <tag><tt/HEADER:/ Binary file header</tag>
+ DOS 3.3 header (address and length)
+
+</descrip><p>
+
+
+<sect1><tt/apple2enh-reboot.cfg/<p>
+
+Configuration optimized for a binary program running on ProDOS 8 without
+BASIC.SYSTEM. Intended to be used with <bf/LOADER.SYSTEM - an
+Apple ][ ProDOS 8 loader for cc65 programs/ (see above) together
+with the function <tt/rebootafterexit()/.
+
+If a ProDOS 8 system program doesn't quit to the ProDOS 8 dispatcher but rather
+reboots the machine after exit then a plain vanilla ProDOS 8 doesn't make use of
+the Language Card bank 2 at all.
+
+This setup makes nearly 50 KB available to a cc65 program - on a 64 KB machine!
+
+<descrip>
+
+ <tag><tt/RAM:/ Main memory area</tag>
+ From $800 to $BEFF (45.75 KB)
+
+ <tag><tt/LC:/ Language Card memory area</tag>
+ From $D000 to $DFFF (4 KB)
+
+ <tag><tt/STARTADDRESS:/ Program start address</tag>
+ Variable (default: $800)
+
+ <tag><tt/HEADER:/ Binary file header</tag>
+ DOS 3.3 header (address and length)
+
+</descrip><p>
+
+
+
+<sect>ProDOS 8 system programs<p>
+
+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.
+
+
+<sect1>LOADER.SYSTEM<p>
+
+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
+<htmlurl url="apple2enh-4.html#ss4.4" name="apple2enh-loader.cfg"> with start address
+$800 and load it with <bf/LOADER.SYSTEM - an Apple ][
+ProDOS 8 loader for cc65 programs/. The program then works like a system program
+(i.e. quits to the ProDOS dispatcher).
+
+Using LOADER.SYSTEM is as simple as copying it to the ProDOS 8 directory of the
+program to load under name <program>.SYSTEM as a system program. For
+example the program <tt/MYPROG/ is loaded by <tt/MYPROG.SYSTEM/.
+
+
+<sect1>Heap<p>
+
+If the cc65 program can be successully linked as system program using the linker
+configuration <htmlurl url="apple2enh-4.html#ss4.3" name="apple2enh-system.cfg"> 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
+<tt/_heapadd ((void *) 0x0800, 0x1800);/ at the beginning of <tt/main()/.
+
+
+<sect1>ProDOS 8 I/O buffers<p>
+
+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
+<tt/posix_memalign()/. While this is generally the best solution it means quite
+some overhead for (especially rather small) cc65 programs which do open files
+but don't make use of the heap otherwise.
+
+The apple2enh package comes with the alternative ProDOS 8 I/O buffer allocation
+module <tt/apple2enh-iobuf-0800.o/ which uses the memory between $800 and
+the program start address for the 1 KB I/O buffers. For system programs (with
+start address $2000) this results in up to 6 I/O buffers and thus up to 6
+concurrently open files.
+
+While using <tt/_heapadd()/ as described in the section above together with the
+default I/O buffer allocation basically yields the same placement of I/O buffers
+in memory the primary benefit of <tt/apple2enh-iobuf-0800.o/ is a reduction in code
+size - and thus program file size - of more than 1400 bytes.
+
+Using <tt/apple2enh-iobuf-0800.o/ is as simple as placing it on the linker command
+line like this:
+
+<tscreen><verb>
+cl65 -t apple2enh -C apple2enh-system.cfg myprog.c apple2enh-iobuf-0800.o
+</verb></tscreen>