aboutsummaryrefslogtreecommitdiff
path: root/doc/casm.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/casm.html')
-rw-r--r--doc/casm.html81
1 files changed, 81 insertions, 0 deletions
diff --git a/doc/casm.html b/doc/casm.html
index 07b2c91..5628b8d 100644
--- a/doc/casm.html
+++ b/doc/casm.html
@@ -346,6 +346,13 @@ the skipped bytes unless the optional <i>fill</i> is supplied.
</td></tr>
<tr><td class="cmd">
+import <i>filename</i></code>
+</td>
+<td class="def">
+Includes a simple library file as generated by casm. See the <a href="#libout">section on simple library files</a> for more details.
+</td></tr>
+
+<tr><td class="cmd">
include <i>filename</i></code>
</td>
<td class="def">
@@ -926,6 +933,14 @@ A Nintendo Gameboy ROM file.
A SNES ROM file.
</td></tr>
+<tr><td class="cmd">
+<a href="#libout">lib</a>
+</td>
+<td class="def">
+A simple library format that allows the importing of pre-built memory and
+labels.
+</td></tr>
+
</table>
</td></tr>
@@ -1200,6 +1215,72 @@ driver would generate.
</table>
+<h3 id="libout">Simple Library Output Format</h3>
+
+<p>This mode produces a simple library file that can be imported using the
+<b>import</b> command. This is of use if you wish to split a large project
+into smaller assembly jobs, for example, to stop you needing to assemble large
+chunks of graphics data every time. The library contains all the memory from
+the assembled file and records the values of all global labels. Note that
+private macro variables and local labels aren't saved, but they'd be useless
+anyway.</p>
+
+<p>.e.g.</p>
+
+<b>Makefile</b>
+<pre class="codeblock">
+game.sfc: game.lib gfx.lib
+ casm link.asm
+
+game.lib: game.asm
+ casm game.asm
+
+gfx.lib: gfx.asm
+ casm gfx.asm
+</pre>
+
+<b>link.asm</b>
+<pre class="codeblock">
+ processor 65c816
+
+ option output-file,"game.sfc"
+ option output-format,snes
+
+ ; These labels actually come from game.asm
+ ;
+ option snes-irq,vbl,vbl_handler
+ option snes-irq,irq,irq_handler
+
+ import "game.lib"
+ import "gfx.lib"
+</pre>
+
+<b>game.asm</b>
+<pre class="codeblock">
+ processor 65c816
+
+ org $8000
+ bank 0
+
+ ;
+ ; Lots of code....
+ ;
+</pre>
+
+
+<b>gfx.asm</b>
+<pre class="codeblock">
+ processor 65c816
+
+ org $8000
+ bank 1
+
+ ;
+ ; Lots of gfx data....
+ ;
+</pre>
+
+
<h2>Listing</h2>
<p>