aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2016-05-03 15:55:29 +0100
committerIan C <ianc@noddybox.co.uk>2016-05-03 15:55:29 +0100
commit9b4f1b54a5b340ae094d33c7ef0eff49b86af489 (patch)
tree102daa4d64ee900526d1a93533e5ab46c6296b4c
parentabe5c9e61c26ef241c9fc769a2f340595d543d93 (diff)
Updated documentation to include 65c816.
-rw-r--r--doc/README2
-rw-r--r--doc/casm.html151
2 files changed, 151 insertions, 2 deletions
diff --git a/doc/README b/doc/README
index 4ab3ec7..8291204 100644
--- a/doc/README
+++ b/doc/README
@@ -1,7 +1,7 @@
casm - A portable cross assembler
=================================
- Copyright 2003-2015 Ian Cowburn
+ Copyright 2003-2015 Ian Cowburn
This program is free software: you can redistribute it and/or modify
diff --git a/doc/casm.html b/doc/casm.html
index f7f05c2..469456a 100644
--- a/doc/casm.html
+++ b/doc/casm.html
@@ -154,6 +154,9 @@ http://www.gnu.org/licenses/gpl-3.0.html)</a></p>
<p>
<a href="#gbcpu">Gameboy Z80</a> - The Gameboy Z80 derivative processor.
</p>
+<p>
+<a href="#65c816">65c816</a> - 65c816 processor support, as used in the SNES.
+</p>
<h1 id="casm">CASM</h1>
@@ -295,7 +298,7 @@ Sets the program counter (PC) to <i>value</i>. The PC defaults to zero on
initialisation. If the optional second argument is passed the current memory
bank in use is set to <i>bank</i>. Note that it also possible to set the
bank by passing a 24-bit address. This was added for convenience when using the
-65c618 processor.
+65c816 processor.
</td></tr>
<tr><td class="cmd">
@@ -1240,6 +1243,15 @@ down to a single blank line in the listing.
<h1 id="z80">Z80 CPU</h1>
+<h2>Using the Z80</h2>
+
+The Z80 processor can be selected by passing <b>z80</b> to the processor
+directive, i.e.
+
+<pre class="codeblock">
+ processor z80
+</pre>
+
<h2>Opcodes</h2>
<p>
@@ -1341,6 +1353,15 @@ The Z80 assembler has no options.
<h1 id="6502">6502 CPU</h1>
+<h2>Using the 6502</h2>
+
+The 6502 processor can be selected by passing <b>6502</b> to the processor
+directive, i.e.
+
+<pre class="codeblock">
+ processor 6502
+</pre>
+
<h2>Opcodes</h2>
The 6502 assembler uses the standard Motorola opcodes.
@@ -1410,6 +1431,15 @@ e.g.
<h1 id="gbcpu">Gameboy Z80 derivative CPU</h1>
+<h2>Using the Gameboy Z80 derivative</h2>
+
+The Gameboy Z80 derivative processor can be selected by passing <b>gameboy</b>
+to the processor directive, i.e.
+
+<pre class="codeblock">
+ processor gameboy
+</pre>
+
<h2>Opcodes</h2>
<p>
@@ -1517,6 +1547,125 @@ it is used as an address:
The Gameboy CPU assembler has no options.
+
+<h1 id="65c816">65c816 CPU</h1>
+
+<h2>Using the 65c816 processor</h2>
+
+The 65c816 processor can be selected by passing <b>65c816</b>
+to the processor directive, i.e.
+
+<pre class="codeblock">
+ processor 65c816
+</pre>
+
+<h2>Opcodes</h2>
+
+The 65c816 assembler uses the standard opcodes. As an addition some implicit
+opcodes are generally followed by a byte that can be used, e.g. in the case
+of a BRK interrupt. In these cases the following byte is automatically set to
+zero unless a argument is supplied (in any addressing mode) and this is written
+out as the following byte. e.g.
+
+<pre class="codeblock">
+ processor 65c618
+
+ brk ; Produces the bytes 0x00 0x00
+ brk $ff ; Produces the bytes 0x00 0xff
+
+ wdm ; Produces the bytes 0x42 0x00
+ wdm $80 ; Produces the bytes 0x42 0x80
+</pre>
+
+
+<h2>Additional Directives</h2>
+
+The 65c618 assembler has some addition directives. As with the built-in
+directives, these can be preceded by an optional period (.) character.
+
+<table>
+
+<thead><tr><td class="head">Directive</td>
+<td class="head">Description</td></tr></thead>
+<tr>
+
+<td class="cmd">
+m8
+</td>
+
+<td class="def">
+Sets the assembler to produce 8-bit immediate values for the Accumulator in the
+appropriate instructions.
+</td></tr>
+
+<td class="cmd">
+m16
+</td>
+
+<td class="def">
+Sets the assembler to produce 16-bit immediate values for the Accumulator in the
+appropriate instructions.
+</td></tr>
+
+<td class="cmd">
+x8
+</td>
+
+<td class="def">
+Sets the assembler to produce 8-bit immediate values for the index registers X
+and Y in the appropriate instructions.
+</td></tr>
+
+<td class="cmd">
+x16
+</td>
+
+<td class="def">
+Sets the assembler to produce 16-bit immediate values for the index registers X
+and Y in the appropriate instructions.
+</td></tr>
+
+<tr><td class="cmd">
+mx <i>accumulator-size</i>, <i>index-size</i>
+</td>
+
+<td class="def">
+Sets the Accumulator and index register sizes for immediate values to either
+8 or 16 bits.
+</td></tr>
+
+</table>
+
+<h2>Options</h2>
+
+The 65c618 assembler has the following options.
+
+<table>
+
+<thead><tr><td class="head">65c618 Option</td>
+<td class="head">Description</td></tr></thead>
+
+<tr><td class="cmd">
+option a16, &lt;on|off&gt;
+</td>
+<td class="def">
+Switches on or off the generation of 16-bit absolute values for the Accumulator.
+Note that this can also be done using the directives described in the previous
+section.
+</td></tr>
+
+<tr><td class="cmd">
+option i16, &lt;on|off&gt;
+</td>
+<td class="def">
+Switches on or off the generation of 16-bit absolute values for the index
+registers X and Y.
+Note that this can also be done using the directives described in the previous
+section.
+</td></tr>
+
+</table>
+
<!-- vim: ai sw=4 ts=8 expandtab spell
-->
</body>