Skip to content

Commit

Permalink
Update RGBDS master documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Action committed Oct 22, 2024
1 parent d6b8f73 commit 1f676d0
Show file tree
Hide file tree
Showing 15 changed files with 262 additions and 225 deletions.
250 changes: 134 additions & 116 deletions docs/gbz80.7.html

Large diffs are not rendered by default.

47 changes: 31 additions & 16 deletions docs/gbz80.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,58 @@ export const toc = [
"level": 2,
},
{
"value": "8-bit Arithmetic and Logic Instructions",
"id": "8-bit_Arithmetic_and_Logic_Instructions",
"value": "Load instructions",
"id": "Load_instructions",
"level": 3,
},
{
"value": "16-bit Arithmetic Instructions",
"id": "16-bit_Arithmetic_Instructions",
"value": "8-bit arithmetic instructions",
"id": "8-bit_arithmetic_instructions",
"level": 3,
},
{
"value": "Bit Operations Instructions",
"id": "Bit_Operations_Instructions",
"value": "16-bit arithmetic instructions",
"id": "16-bit_arithmetic_instructions",
"level": 3,
},
{
"value": "Bit Shift Instructions",
"id": "Bit_Shift_Instructions",
"value": "Bitwise logic instructions",
"id": "Bitwise_logic_instructions",
"level": 3,
},
{
"value": "Load Instructions",
"id": "Load_Instructions",
"value": "Bit flag instructions",
"id": "Bit_flag_instructions",
"level": 3,
},
{
"value": "Jumps and Subroutines",
"id": "Jumps_and_Subroutines",
"value": "Bit shift instructions",
"id": "Bit_shift_instructions",
"level": 3,
},
{
"value": "Stack Operations Instructions",
"id": "Stack_Operations_Instructions",
"value": "Jumps and subroutine instructions",
"id": "Jumps_and_subroutine_instructions",
"level": 3,
},
{
"value": "Miscellaneous Instructions",
"id": "Miscellaneous_Instructions",
"value": "Carry flag instructions",
"id": "Carry_flag_instructions",
"level": 3,
},
{
"value": "Stack manipulation instructions",
"id": "Stack_manipulation_instructions",
"level": 3,
},
{
"value": "Interrupt-related instructions",
"id": "Interrupt-related_instructions",
"level": 3,
},
{
"value": "Miscellaneous instructions",
"id": "Miscellaneous_instructions",
"level": 3,
},
{
Expand Down
Binary file modified docs/gbz80.7.pdf
Binary file not shown.
Binary file modified docs/rgbasm.1.pdf
Binary file not shown.
150 changes: 77 additions & 73 deletions docs/rgbasm.5.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ <h3 class="Ss" id="Symbol_interpolation"><a class="permalink" href="#Symbol_inte
</div>
<p class="Pp">Although, for these examples, <code class="Ic">STRFMT</code> would
be more appropriate; see <a class="Sx" href="#String_expressions">String
expressions</a> further below.</p>
expressions</a> below.</p>
</section>
</section>
<section class="Sh">
Expand All @@ -262,7 +262,7 @@ <h2 class="Sh" id="EXPRESSIONS"><a class="permalink" href="#EXPRESSIONS">EXPRESS
case, unless a label is involved, as explained in the
<a class="Sx" href="#SYMBOLS">SYMBOLS</a> section. However, some operators
can be constant even with non-constant operands, as explained in
<a class="Sx" href="#Operators">Operators</a> further below.</p>
<a class="Sx" href="#Operators">Operators</a> below.</p>
<p class="Pp">The instructions in the macro-language generally require constant
expressions.</p>
<section class="Ss">
Expand Down Expand Up @@ -1200,15 +1200,17 @@ <h3 class="Ss" id="RAM_code"><a class="permalink" href="#RAM_code">RAM
the current <code class="Ic">LOAD</code> block before performing its own
function.</p>
<p class="Pp"><code class="Ic">LOAD</code> blocks can use the
<code class="Ic">UNION</code> modifier as described below, but not the
<code class="Ic">FRAGMENT</code> modifier.</p>
<code class="Ic">UNION</code> modifier as described in
<a class="Sx" href="#Unionized_sections">Unionized sections</a> below, but
not the <code class="Ic">FRAGMENT</code> modifier.</p>
</section>
<section class="Ss">
<h3 class="Ss" id="Unionized_sections"><a class="permalink" href="#Unionized_sections">Unionized
sections</a></h3>
<p class="Pp">When you're tight on RAM, you may want to define overlapping
static memory allocations, as explained in the
<a class="Sx" href="#Unions">Unions</a> section. However, a
<a class="Sx" href="#Allocating_overlapping_spaces_in_RAM">Allocating
overlapping spaces in RAM</a> section. However, a
<code class="Ic">UNION</code> only works within a single file, so it can't
be used e.g. to define temporary variables across several files, all of
which use the same statically allocated memory. Unionized sections solve
Expand Down Expand Up @@ -1237,8 +1239,9 @@ <h3 class="Ss" id="Unionized_sections"><a class="permalink" href="#Unionized_sec
</ul>
<p class="Pp">Different declarations of the same unionized section are not
appended, but instead overlaid on top of each other, just like
<a class="Sx" href="#Unions">Unions</a>. Similarly, the size of an unionized
section is the largest of all its declarations.</p>
<a class="Sx" href="#Allocating_overlapping_spaces_in_RAM">Allocating
overlapping spaces in RAM</a>. Similarly, the size of an unionized section
is the largest of all its declarations.</p>
</section>
<section class="Ss">
<h3 class="Ss" id="Section_fragments"><a class="permalink" href="#Section_fragments">Section
Expand Down Expand Up @@ -1335,8 +1338,8 @@ <h3 class="Ss" id="Labels"><a class="permalink" href="#Labels">Labels</a></h3>
<a class="permalink" href="#global"><i class="Em" id="global">global</i></a>
(not to be mistaken with &#x201C;exported&#x201D;, explained in
<a class="Sx" href="#Exporting_and_importing_symbols">Exporting and
importing symbols</a> further below). More than one dot in label names is
not allowed.</p>
importing symbols</a> below). More than one dot in label names is not
allowed.</p>
<p class="Pp">For convenience, local labels can use a shorthand syntax: when a
symbol name starting with a dot is found (for example, inside an expression,
or when declaring a label), then the current &#x201C;label scope&#x201D; is
Expand Down Expand Up @@ -1853,39 +1856,6 @@ <h3 class="Ss" id="Predeclared_symbols"><a class="permalink" href="#Predeclared_
<h2 class="Sh" id="DEFINING_DATA"><a class="permalink" href="#DEFINING_DATA">DEFINING
DATA</a></h2>
<section class="Ss">
<h3 class="Ss" id="Statically_allocating_space_in_RAM"><a class="permalink" href="#Statically_allocating_space_in_RAM">Statically
allocating space in RAM</a></h3>
<p class="Pp"><code class="Ic">DS</code> statically allocates a number of empty
bytes. This is the preferred method of allocating space in a RAM section.
You can also use <code class="Ic">DB</code>, <code class="Ic">DW</code> and
<code class="Ic">DL</code> without any arguments instead (see
<a class="Sx" href="#Defining_constant_data_in_ROM">Defining constant data
in ROM</a> below).</p>
<div class="Bd Pp Bd-indent Li">
<pre>DS 42 ;&#x00A0;Allocates 42 bytes</pre>
</div>
<p class="Pp">Empty space in RAM sections will not be initialized. In ROM
sections, it will be filled with the value passed to the
<code class="Fl">-p</code> command-line option, except when using overlays
with <code class="Fl">-O</code>.</p>
<p class="Pp">Instead of an exact number of bytes, you can specify
<code class="Ic">ALIGN</code>[<var class="Ar">align</var>,
<var class="Ar">offset</var>] to allocate however many bytes are required to
align the subsequent data. Thus, &#x2018;<code class="Ic">DS
ALIGN</code>[<var class="Ar">align</var>, <var class="Ar">offset</var>],
<span class="No">...</span>&#x2019; is equivalent to
&#x2018;<code class="Ic">DS</code> <var class="Ar">n</var>,
<span class="No">...</span>&#x2019; followed by
&#x2018;<code class="Ic">ALIGN</code>[<var class="Ar">align</var>,
<var class="Ar">offset</var>]&#x2019;, where <var class="Ar">n</var> is the
minimum value needed to satisfy the <code class="Ic">ALIGN</code> constraint
(see <a class="Sx" href="#Requesting_alignment">Requesting alignment</a>
below). Note that <code class="Ic">ALIGN</code>[<var class="Ar">align</var>]
is a shorthand for
<code class="Ic">ALIGN</code>[<var class="Ar">align</var>,
<span class="No">0</span>].</p>
</section>
<section class="Ss">
<h3 class="Ss" id="Defining_constant_data_in_ROM"><a class="permalink" href="#Defining_constant_data_in_ROM">Defining
constant data in ROM</a></h3>
<p class="Pp"><code class="Ic">DB</code> defines a list of bytes that will be
Expand Down Expand Up @@ -1927,8 +1897,8 @@ <h3 class="Ss" id="Defining_constant_data_in_ROM"><a class="permalink" href="#De
<code class="Ic">VRAM</code> / <code class="Ic">SRAM</code> section.</p>
</section>
<section class="Ss">
<h3 class="Ss" id="Including_binary_files"><a class="permalink" href="#Including_binary_files">Including
binary files</a></h3>
<h3 class="Ss" id="Including_binary_data_files"><a class="permalink" href="#Including_binary_data_files">Including
binary data files</a></h3>
<p class="Pp">You probably have some graphics, level data, etc. you'd like to
include. Use <code class="Ic">INCBIN</code> to include a raw binary file as
it is. If the file isn't found in the current directory, the include-path
Expand All @@ -1949,7 +1919,41 @@ <h3 class="Ss" id="Including_binary_files"><a class="permalink" href="#Including
be included.</p>
</section>
<section class="Ss">
<h3 class="Ss" id="Unions"><a class="permalink" href="#Unions">Unions</a></h3>
<h3 class="Ss" id="Statically_allocating_space_in_RAM"><a class="permalink" href="#Statically_allocating_space_in_RAM">Statically
allocating space in RAM</a></h3>
<p class="Pp"><code class="Ic">DS</code> statically allocates a number of empty
bytes. This is the preferred method of allocating space in a RAM section.
You can also use <code class="Ic">DB</code>, <code class="Ic">DW</code> and
<code class="Ic">DL</code> without any arguments instead (see
<a class="Sx" href="#Defining_constant_data_in_ROM">Defining constant data
in ROM</a> below).</p>
<div class="Bd Pp Bd-indent Li">
<pre>DS 42 ;&#x00A0;Allocates 42 bytes</pre>
</div>
<p class="Pp">Empty space in RAM sections will not be initialized. In ROM
sections, it will be filled with the value passed to the
<code class="Fl">-p</code> command-line option, except when using overlays
with <code class="Fl">-O</code>.</p>
<p class="Pp">Instead of an exact number of bytes, you can specify
<code class="Ic">ALIGN</code>[<var class="Ar">align</var>,
<var class="Ar">offset</var>] to allocate however many bytes are required to
align the subsequent data. Thus, &#x2018;<code class="Ic">DS
ALIGN</code>[<var class="Ar">align</var>, <var class="Ar">offset</var>],
<span class="No">...</span>&#x2019; is equivalent to
&#x2018;<code class="Ic">DS</code> <var class="Ar">n</var>,
<span class="No">...</span>&#x2019; followed by
&#x2018;<code class="Ic">ALIGN</code>[<var class="Ar">align</var>,
<var class="Ar">offset</var>]&#x2019;, where <var class="Ar">n</var> is the
minimum value needed to satisfy the <code class="Ic">ALIGN</code> constraint
(see <a class="Sx" href="#Requesting_alignment">Requesting alignment</a>
below). Note that <code class="Ic">ALIGN</code>[<var class="Ar">align</var>]
is a shorthand for
<code class="Ic">ALIGN</code>[<var class="Ar">align</var>,
<span class="No">0</span>].</p>
</section>
<section class="Ss">
<h3 class="Ss" id="Allocating_overlapping_spaces_in_RAM"><a class="permalink" href="#Allocating_overlapping_spaces_in_RAM">Allocating
overlapping spaces in RAM</a></h3>
<p class="Pp">Unions allow multiple static memory allocations to overlap, like
unions in C. This does not increase the amount of memory available, but
allows re-using the same memory region for different purposes.</p>
Expand Down Expand Up @@ -1999,6 +2003,34 @@ <h3 class="Ss" id="Unions"><a class="permalink" href="#Unions">Unions</a></h3>
<a class="Sx" href="#Statically_allocating_space_in_RAM">Statically
allocating space in RAM</a>).</p>
</section>
<section class="Ss">
<h3 class="Ss" id="Requesting_alignment"><a class="permalink" href="#Requesting_alignment">Requesting
alignment</a></h3>
<p class="Pp">While <code class="Ic">ALIGN</code> as presented in
<a class="Sx" href="#SECTIONS">SECTIONS</a> is often useful as-is, sometimes
you instead want a particular piece of data (or code) in the middle of the
section to be aligned. This is made easier through the use of mid-section
<code class="Ic">ALIGN</code> <var class="Ar">align</var>,
<var class="Ar">offset</var>. It will retroactively alter the section's
attributes to ensure that the location the <code class="Ic">ALIGN</code>
directive is at, has its <var class="Ar">align</var> lower bits equal to
<var class="Ar">offset</var>.</p>
<p class="Pp">If the constraint cannot be met (for example because the section
is fixed at an incompatible address), an error is produced. Note that
<code class="Ic">ALIGN</code> <var class="Ar">align</var> is a shorthand for
<code class="Ic">ALIGN</code> <var class="Ar">align</var>,
<span class="No">0</span>.</p>
<p class="Pp">There may be times when you don't just want to specify an
alignment constraint at the current location, but also skip ahead until the
constraint can be satisfied. In that case, you can use <code class="Ic">DS
ALIGN</code>[<var class="Ar">align</var>, <var class="Ar">offset</var>] to
allocate however many bytes are required to align the subsequent data.</p>
<p class="Pp">If the constraint cannot be met by skipping any amount of space,
an error is produced. Note that
<code class="Ic">ALIGN</code>[<var class="Ar">align</var>] is a shorthand
for <code class="Ic">ALIGN</code>[<var class="Ar">align</var>,
<span class="No">0</span>].</p>
</section>
</section>
<section class="Sh">
<h2 class="Sh" id="THE_MACRO_LANGUAGE"><a class="permalink" href="#THE_MACRO_LANGUAGE">THE
Expand Down Expand Up @@ -2480,34 +2512,6 @@ <h3 class="Ss" id="Changing_options_while_assembling"><a class="permalink" href=
POPO</pre>
</div>
</section>
<section class="Ss">
<h3 class="Ss" id="Requesting_alignment"><a class="permalink" href="#Requesting_alignment">Requesting
alignment</a></h3>
<p class="Pp">While <code class="Ic">ALIGN</code> as presented in
<a class="Sx" href="#SECTIONS">SECTIONS</a> is often useful as-is, sometimes
you instead want a particular piece of data (or code) in the middle of the
section to be aligned. This is made easier through the use of mid-section
<code class="Ic">ALIGN</code> <var class="Ar">align</var>,
<var class="Ar">offset</var>. It will alter the section's attributes to
ensure that the location the <code class="Ic">ALIGN</code> directive is at,
has its <var class="Ar">align</var> lower bits equal to
<var class="Ar">offset</var>.</p>
<p class="Pp">If the constraint cannot be met (for example because the section
is fixed at an incompatible address), an error is produced. Note that
<code class="Ic">ALIGN</code> <var class="Ar">align</var> is a shorthand for
<code class="Ic">ALIGN</code> <var class="Ar">align</var>,
<span class="No">0</span>.</p>
<p class="Pp">There may be times when you don't just want to specify an
alignment constraint at the current location, but also skip ahead until the
constraint can be satisfied. In that case, you can use <code class="Ic">DS
ALIGN</code>[<var class="Ar">align</var>, <var class="Ar">offset</var>] to
allocate however many bytes are required to align the subsequent data.</p>
<p class="Pp">If the constraint cannot be met by skipping any amount of space,
an error is produced. Note that
<code class="Ic">ALIGN</code>[<var class="Ar">align</var>] is a shorthand
for <code class="Ic">ALIGN</code>[<var class="Ar">align</var>,
<span class="No">0</span>].</p>
</section>
</section>
<section class="Sh">
<h2 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
Expand Down
26 changes: 13 additions & 13 deletions docs/rgbasm.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,28 @@ export const toc = [
"level": 2,
},
{
"value": "Statically allocating space in RAM",
"id": "Statically_allocating_space_in_RAM",
"value": "Defining constant data in ROM",
"id": "Defining_constant_data_in_ROM",
"level": 3,
},
{
"value": "Defining constant data in ROM",
"id": "Defining_constant_data_in_ROM",
"value": "Including binary data files",
"id": "Including_binary_data_files",
"level": 3,
},
{
"value": "Statically allocating space in RAM",
"id": "Statically_allocating_space_in_RAM",
"level": 3,
},
{
"value": "Including binary files",
"id": "Including_binary_files",
"value": "Allocating overlapping spaces in RAM",
"id": "Allocating_overlapping_spaces_in_RAM",
"level": 3,
},
{
"value": "Unions",
"id": "Unions",
"value": "Requesting alignment",
"id": "Requesting_alignment",
"level": 3,
},
{
Expand Down Expand Up @@ -210,11 +215,6 @@ export const toc = [
"id": "Changing_options_while_assembling",
"level": 3,
},
{
"value": "Requesting alignment",
"id": "Requesting_alignment",
"level": 3,
},
{
"value": "SEE ALSO",
"id": "SEE_ALSO",
Expand Down
Binary file modified docs/rgbasm.5.pdf
Binary file not shown.
10 changes: 5 additions & 5 deletions docs/rgbds.5.html
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ <h3 class="Ss" id="Sections"><a class="permalink" href="#Sections">Sections</a><
<dt id="BYTE~8"><a class="permalink" href="#BYTE~8"><code class="Cm">BYTE</code></a>
<var class="Ar">RPNExpr</var>[RPNSize]</dt>
<dd>The patch's value, encoded as a RPN expression (see
<a class="Sx" href="#RPN_EXPRESSIONS">RPN
EXPRESSIONS</a>).</dd>
<a class="Sx" href="#RPN_expressions">RPN
expressions</a>).</dd>
</dl>
</dd>
<dt id="ENDR~3"><a class="permalink" href="#ENDR~3"><code class="Cm">ENDR</code></a></dt>
Expand Down Expand Up @@ -446,7 +446,7 @@ <h3 class="Ss" id="Assertions"><a class="permalink" href="#Assertions">Assertion
<dt id="BYTE~10"><a class="permalink" href="#BYTE~10"><code class="Cm">BYTE</code></a>
<var class="Ar">RPNExpr</var>[RPNSize]</dt>
<dd>The patch's value, encoded as a RPN expression (see
<a class="Sx" href="#RPN_EXPRESSIONS">RPN EXPRESSIONS</a>).</dd>
<a class="Sx" href="#RPN_expressions">RPN expressions</a>).</dd>
<dt id="STRING~4"><a class="permalink" href="#STRING~4"><code class="Cm">STRING</code></a>
<var class="Ar">Message</var></dt>
<dd>The message displayed if the expression evaluates to a non-zero value.
Expand All @@ -458,8 +458,8 @@ <h3 class="Ss" id="Assertions"><a class="permalink" href="#Assertions">Assertion
</dl>
</section>
<section class="Ss">
<h3 class="Ss" id="RPN_EXPRESSIONS"><a class="permalink" href="#RPN_EXPRESSIONS">RPN
EXPRESSIONS</a></h3>
<h3 class="Ss" id="RPN_expressions"><a class="permalink" href="#RPN_expressions">RPN
expressions</a></h3>
<p class="Pp">Expressions in the object file are stored as RPN, or
&#x201C;Reverse Polish Notation&#x201D;, which is a notation that allows
computing arbitrary expressions with just a simple stack. For example, the
Expand Down
4 changes: 2 additions & 2 deletions docs/rgbds.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export const toc = [
"level": 3,
},
{
"value": "RPN EXPRESSIONS",
"id": "RPN_EXPRESSIONS",
"value": "RPN expressions",
"id": "RPN_expressions",
"level": 3,
},
{
Expand Down
Binary file modified docs/rgbds.5.pdf
Binary file not shown.
Binary file modified docs/rgbds.7.pdf
Binary file not shown.
Binary file modified docs/rgbfix.1.pdf
Binary file not shown.
Binary file modified docs/rgbgfx.1.pdf
Binary file not shown.
Binary file modified docs/rgblink.1.pdf
Binary file not shown.
Binary file modified docs/rgblink.5.pdf
Binary file not shown.

0 comments on commit 1f676d0

Please sign in to comment.