<sect>Memory layout<p>
cc65 generated programs for the Commodore 610 run in bank 1, the memory bank
-reserved for BASIC programs. Since there are no ROMs in this memory bank, the
-program has almost full 64K for its own. A disadvantage is that kernal
-subroutines cannot be called (at least not in a fast and effective manner), so
-the runtime has replace kernal functionality.
+reserved for BASIC programs. Since there are no ROMs in this memory bank,
+kernal subroutines are either emulated or called by bank switching, which has
+the disadvantage of being slow compared to a direct call.
The default memory configuration for the CBM 610 allocates all memory between
$0002 and $FFF0 in bank 1 for the compiled program. Some space
<itemize>
<item>peekbsys
-<item>peewsys
+<item>peekwsys
<item>pokebsys
<item>pokewsys
</itemize>
<bf>Note:</bf> All I/O chips are located in the system bank (bank 15) and can
therefore not be accessed like on other platforms. Please use one of the
-<tt/peekbsys/, <tt/peewsys/, <tt/pokebsys/ and <tt/pokewsys/ functions to
+<tt/peekbsys/, <tt/peekwsys/, <tt/pokebsys/ and <tt/pokewsys/ functions to
access the I/O chips. Direct reads and writes to the structures named below
will <em>not</em> work!
quite an impact on performance: A cross bank call has an extra 300µs
penalty added by the wrapper.
+<sect1>Interrupts<p>
+
+Compiled programs contain an interrupt handler that runs in the program bank.
+This has several advantages, one of them being performance (see cross bank
+call overhead mentioned above). However, this introduces one problem:
+Interrupts are lost while the CPU executes code in the kernal bank. As a
+result, the clock may go wrong and (worse) serial interrupts may get lost.
+
+Since the cc65 runtime does only call the kernal for disk I/O, this means that
+a program should not do file I/O while it depends on interrupts.
<sect>Other hints<p>
610.
+<sect1>Program return code<p>
+
+The program return code (low byte) is passed back to BASIC by use of the
+<tt/ST/ variable.
+
+
+<sect1>Interrupt handlers<p>
+
+The runtime for the Commodore 610 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">.
+
+
<sect>Bugs/Feedback<p>