]> git.sur5r.net Git - cc65/blobdiff - doc/cbm610.sgml
Added some more detail to the "Binary format" section of the CBM docs.
[cc65] / doc / cbm610.sgml
index f70757b26574ecbf4c7b43504a50b3d6c86fc146..55893cabfa58b300e3860c99a92b1215bbf21c90 100644 (file)
@@ -38,9 +38,10 @@ a builtin monitor).
 
 <sect>Binary format<p>
 
-The standard binary output format generated by the linker for the CBM610
-target is a machine language program with a short BASIC stub. This means that
-a program can be loaded as BASIC program and started with RUN. It is of course
+The standard binary output format generated by the linker for the Commodore
+610 target is a machine language program with a one line BASIC stub, which     
+transfers control to the machine language running in bank 1. 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.
 
@@ -48,10 +49,9 @@ config.
 <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
 &dollar;0002 and &dollar;FFF0 in bank 1 for the compiled program. Some space
@@ -89,7 +89,7 @@ url="funcref.html" name="function reference"> for declaration and usage.
 
 <itemize>
 <item>peekbsys
-<item>peewsys
+<item>peekwsys
 <item>pokebsys
 <item>pokewsys
 </itemize>
@@ -137,7 +137,7 @@ structures, accessing the struct fields will access the chip registers.
 
 <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!
 
@@ -249,6 +249,21 @@ Command line argument passing is currently not supported for the Commodore
 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>