]> git.sur5r.net Git - cc65/blobdiff - doc/atari.sgml
Replaced Apple II specific solution with implementation of recently introduced mass...
[cc65] / doc / atari.sgml
index ccf2ec323ec1627ddeab54829b367dbb085b86d7..44bf65671da3797f121e507e7cb7002b887361c3 100644 (file)
@@ -6,7 +6,7 @@
 <author>Shawn Jefferson, <htmlurl
 url="mailto:shawnjefferson@24fightingchickens.com"
 name="shawnjefferson@24fightingchickens.com"> and
-Christian Groessler, <htmlurl url="mailto:cpg@aladdin.de" name="cpg@aladdin.de">
+Christian Groessler, <htmlurl url="mailto:chris@groessler.org" name="chris@groessler.org">
 <date>03-Jan-2006
 
 <abstract>
@@ -39,13 +39,14 @@ The standard binary output format generated by the linker for the
 Atari target is a machine language program with a standard executable
 header (FF FF &lt;2 byte start address&gt; &lt;2 bytes end address&gt;
 &lsqb;program bytes&rsqb;). These values are calculated in the crt0.s
-file from the __CODE_LOAD__ and __BSS_LOAD__ values, so keep this in
-mind if you create a custom linker config file and start moving
-segments around (see section <ref name="Reserving a memory area inside the program" id="memhole">).  You can
-override this behaviour by creating your own crt0.s file and linking
-it into your program.  A run vector is added to the end of the file
-(&dollar;02E0 &lt;run vector&gt;) and is calculated using
-__CODE_LOAD__ in crt0.s.
+file from the __STARTUP_LOAD__ and __ZPSAVE_LOAD__ values, so keep
+this in mind if you create a custom linker config file and start
+moving segments around (see section
+<ref name="Reserving a memory area inside the program" id="memhole">).
+You can override this behaviour by creating your own crt0.s file and
+linking it into your program.  A run vector is added to the end of the
+file (&dollar;02E0 &lt;run vector&gt;) and is calculated using
+__STARTUP_LOAD__ in crt0.s.
 
 
 <sect>Memory layout<p>
@@ -56,11 +57,12 @@ the BASIC cartridge unplugged). This gives a usable memory range from
 current memory configuration, which depends on the size of the
 installed memory and cartridges present, by inspecting the value in
 the MEMTOP (&dollar;2E5) variable. Then the initial stack pointer,
-which indicates the upper bound of memory used, is adjusted. The load
-address of &dollar;2E00 was chosen to accommodate having a DOS loaded
-and a driver that resides in low memory such as the 850 R: handler.
-You can override this behaviour by creating a custom linker config
-file.
+which indicates the upper bound of memory used, is adjusted. The
+default load address of &dollar;2E00 was chosen to accommodate having
+a DOS loaded and a driver that resides in low memory such as the 850
+R: handler. You can override this behaviour by creating a custom
+linker config file or by using the "--start-addr" cl65 command line
+argument or the "--start-addr" or "-S" ld65 command line arguments.
 
 Special locations:
 
@@ -94,12 +96,13 @@ header file.
 
 <sect1>Atari specific functions<p>
 
-The functions listed below are special for the Atari. See the <htmlurl
-url="funcref.html" name="function reference"> for declaration and usage.
+The functions and global variable listed below are special for the Atari.
+See the <htmlurl url="funcref.html" name="function reference"> for declaration and usage.
 
 <itemize>
 <item>get_ostype
 <item>get_tv
+<item>_dos_type
 <item>_gtia_mkcolor
 <item>_getcolor
 <item>_getdefdev
@@ -204,7 +207,7 @@ graphics mode|reserved memory@<hline>
 25|7146@
 26|7146@
 27|7146@
-28|160@
+28|162@
 29|1@
 30|3304@
 31|7146
@@ -269,10 +272,34 @@ or f80.com software is missing. Of course you may use stdio.h functions.
 
 <sect>Other hints<p>
 
+
 <sect1>Function keys<p>
 
 Function keys are mapped to Atari + number key.
 
+
+<sect1>Passing arguments to the program<p>
+
+Command line arguments can be passed to <tt/main()/ when DOS supports it.
+
+<enum>
+<item>Arguments are separated by spaces.
+<item>Leading and trailing spaces around an argument are ignored.
+<item>The first argument passed to <tt/main/ is the program name.
+<item>A maximum number of 16 arguments (including the program name) are
+      supported.                                                       
+</enum>
+
+
+<sect1>Interrupts<p>
+
+The runtime for the Atari 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 VBI 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>Reserving a memory area inside a program<label id="memhole"><p>
 
 The Atari 130XE maps its additional memory into CPU memory in 16K
@@ -501,8 +528,8 @@ defines the location of the stack by initializing sp.
 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"> or <htmlurl url="mailto:cpg@aladdin.de"
-name="cpg@aladdin.de">).
+name="uz@cc65.org"> or <htmlurl url="mailto:chris@groessler.org"
+name="chris@groessler.org"> ).