mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Update HTML documentation
This commit is contained in:
@@ -49,10 +49,11 @@ All pseudo‐ops, mnemonics and registers (reserved keywords) are
|
||||
<div class="Pp"></div>
|
||||
There are two syntaxes for comments. In both cases, a comment ends at the end of
|
||||
the line. The most common one is: anything that follows a semicolon
|
||||
";" (that isn't inside a string) is a comment. There is another
|
||||
format: anything that follows a "*" that is placed right at the
|
||||
start of a line is a comment. The assembler removes all comments from the code
|
||||
before doing anything else.
|
||||
‘<code class="Li">;</code>’ (that isn't inside a string) is a
|
||||
comment. There is another format: anything that follows a
|
||||
‘<code class="Li">*</code>’ that is placed right at the start of
|
||||
a line is a comment. The assembler removes all comments from the code before
|
||||
doing anything else.
|
||||
<div class="Pp"></div>
|
||||
Sometimes lines can be too long and it may be necessary to split them. The
|
||||
syntax to do so is the following one:
|
||||
@@ -65,7 +66,7 @@ Sometimes lines can be too long and it may be necessary to split them. The
|
||||
</div>
|
||||
<div class="Pp"></div>
|
||||
This works anywhere in the code except inside of strings. To split strings it is
|
||||
needed to use <b class="Sy" title="Sy">STRCAT</b> like this:
|
||||
needed to use <b class="Fn" title="Fn">STRCAT</b>() like this:
|
||||
<div class="Pp"></div>
|
||||
<div class="Bd" style="margin-left: 5.00ex;">
|
||||
<pre class="Li">
|
||||
@@ -74,99 +75,140 @@ This works anywhere in the code except inside of strings. To split strings it is
|
||||
</pre>
|
||||
</div>
|
||||
<h2 class="Ss" title="Ss" id="Sections"><a class="selflink" href="#Sections">Sections</a></h2>
|
||||
<b class="Ic" title="Ic">SECTION</b> <var class="Ar" title="Ar">name</var>,
|
||||
<var class="Ar" title="Ar">type</var>
|
||||
<div class="Pp"></div>
|
||||
<b class="Ic" title="Ic">SECTION</b> <var class="Ar" title="Ar">name</var>,
|
||||
<var class="Ar" title="Ar">type</var>,
|
||||
<var class="Ar" title="Ar">options</var>
|
||||
<div class="Pp"></div>
|
||||
<b class="Ic" title="Ic">SECTION</b> <var class="Ar" title="Ar">name</var>,
|
||||
<var class="Ar" title="Ar">type</var>[<var class="Ar" title="Ar">addr</var>]
|
||||
<div class="Pp"></div>
|
||||
<b class="Ic" title="Ic">SECTION</b> <var class="Ar" title="Ar">name</var>,
|
||||
<var class="Ar" title="Ar">type</var>[<var class="Ar" title="Ar">addr</var>],
|
||||
<var class="Ar" title="Ar">options</var>
|
||||
<div class="Pp"></div>
|
||||
Before you can start writing code, you must define a section. This tells the
|
||||
assembler what kind of information follows and, if it is code, where to put
|
||||
it.
|
||||
<div class="Pp"></div>
|
||||
<div class="Bd" style="margin-left: 5.00ex;">
|
||||
<pre class="Li">
|
||||
SECTION "CoolStuff",ROMX
|
||||
</pre>
|
||||
</div>
|
||||
<var class="Ar" title="Ar">name</var> is a string enclosed in double quotes and
|
||||
can be a new name or the name of an existing section. All sections assembled
|
||||
at the same time that have the same name and type are considered to be the
|
||||
same section, and their code is put together in the object file generated by
|
||||
the assembler. All other sections must have a unique name, even in different
|
||||
source files, or the linker will treat it as an error.
|
||||
<div class="Pp"></div>
|
||||
This switches to the section called "CoolStuff" (or creates it if it
|
||||
doesn't already exist) and it defines it as a code section. All sections
|
||||
assembled at the same time that have the same name, type, etc, are considered
|
||||
to be the same one, and their code is put together in the object file
|
||||
generated by the assembler. All other sections must have a unique name, even
|
||||
in different source files, or the linker will treat it as an error.
|
||||
<div class="Pp"></div>
|
||||
Possible section types are as follows:
|
||||
Possible section <var class="Ar" title="Ar">type</var>s are as follows:
|
||||
<dl class="Bl-tag">
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><b class="Sy" title="Sy">ROM0</b></dt>
|
||||
<dd class="It-tag">A ROM section. Mapped to memory at $0000–$3FFF (or
|
||||
$0000-$7FFF if tiny ROM mode is enabled in
|
||||
<a class="Xr" title="Xr">rgblink(1)</a>).</dd>
|
||||
<dt class="It-tag"><a class="selflink" href="#ROM0"><b class="Cm" title="Cm" id="ROM0">ROM0</b></a></dt>
|
||||
<dd class="It-tag">A ROM section. <var class="Ar" title="Ar">addr</var> can
|
||||
range from $0000–$3FFF (or $0000–$7FFF if tiny ROM mode is
|
||||
enabled in <a class="Xr" title="Xr">rgblink(1)</a>).</dd>
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><b class="Sy" title="Sy">ROMX</b></dt>
|
||||
<dd class="It-tag">A banked ROM section. Mapped to memory at
|
||||
$4000–$7FFF. Valid banks range from 1 to 511. Not available if tiny
|
||||
ROM mode is enabled in <a class="Xr" title="Xr">rgblink(1)</a>.</dd>
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><b class="Sy" title="Sy">VRAM</b></dt>
|
||||
<dd class="It-tag">A banked video RAM section. Mapped to memory at
|
||||
$8000–$9FFF. Can only allocate memory, not fill it. Valid banks are
|
||||
0 and 1 but bank 1 isn't available if DMG mode is enabled in
|
||||
<dt class="It-tag"><a class="selflink" href="#ROMX"><b class="Cm" title="Cm" id="ROMX">ROMX</b></a></dt>
|
||||
<dd class="It-tag">A banked ROM section. <var class="Ar" title="Ar">addr</var>
|
||||
can range from $4000–$7FFF. <var class="Ar" title="Ar">bank</var>
|
||||
can range from 1 to 511. Not available if tiny ROM mode is enabled in
|
||||
<a class="Xr" title="Xr">rgblink(1)</a>.</dd>
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><b class="Sy" title="Sy">SRAM</b></dt>
|
||||
<dd class="It-tag">A banked external (save) RAM section. Mapped to memory at
|
||||
$A000–$BFFF. Can only allocate memory, not fill it. Valid banks
|
||||
range from 0 to 15.</dd>
|
||||
<dt class="It-tag"><a class="selflink" href="#VRAM"><b class="Cm" title="Cm" id="VRAM">VRAM</b></a></dt>
|
||||
<dd class="It-tag">A banked video RAM section.
|
||||
<var class="Ar" title="Ar">addr</var> can range from $8000–$9FFF.
|
||||
<var class="Ar" title="Ar">bank</var> can be 0 or 1 but bank 1 is
|
||||
unavailable if DMG mode is enabled in
|
||||
<a class="Xr" title="Xr">rgblink(1)</a>. Memory in this section can only
|
||||
be allocated with <b class="Sy" title="Sy">DS</b>, not filled with
|
||||
data.</dd>
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><b class="Sy" title="Sy">WRAM0</b></dt>
|
||||
<dd class="It-tag">A general-purpose RAM section. Mapped to memory at
|
||||
$C000–$CFFF, or $C000-$DFFF if DMG mode is enabled in
|
||||
<a class="Xr" title="Xr">rgblink(1)</a>. Can only allocate memory, not
|
||||
fill it.</dd>
|
||||
<dt class="It-tag"><a class="selflink" href="#SRAM"><b class="Cm" title="Cm" id="SRAM">SRAM</b></a></dt>
|
||||
<dd class="It-tag">A banked external (save) RAM section.
|
||||
<var class="Ar" title="Ar">addr</var> can range from $A000–$BFFF.
|
||||
<var class="Ar" title="Ar">bank</var> can range from 0 to 15. Memory in
|
||||
this section can only be allocated with <b class="Sy" title="Sy">DS</b>,
|
||||
not filled with data.</dd>
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><b class="Sy" title="Sy">WRAMX</b></dt>
|
||||
<dd class="It-tag">A banked general-purpose RAM section. Mapped to memory at
|
||||
$D000–$DFFF. Can only allocate memory, not fill it. Valid banks
|
||||
range from 1 to 7. Not available if DMG mode is enabled in
|
||||
<dt class="It-tag"><a class="selflink" href="#WRAM0"><b class="Cm" title="Cm" id="WRAM0">WRAM0</b></a></dt>
|
||||
<dd class="It-tag">A general-purpose RAM section.
|
||||
<var class="Ar" title="Ar">addr</var> can range from $C000–$CFFF,
|
||||
or $C000–$DFFF if DMG mode is enabled in
|
||||
<a class="Xr" title="Xr">rgblink(1)</a>. Memory in this section can only
|
||||
be allocated with <b class="Sy" title="Sy">DS</b>, not filled with
|
||||
data.</dd>
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><a class="selflink" href="#WRAMX"><b class="Cm" title="Cm" id="WRAMX">WRAMX</b></a></dt>
|
||||
<dd class="It-tag">A banked general-purpose RAM section.
|
||||
<var class="Ar" title="Ar">addr</var> can range from $D000–$DFFF.
|
||||
<var class="Ar" title="Ar">bank</var> can range from 1 to 7. Memory in
|
||||
this section can only be allocated with <b class="Sy" title="Sy">DS</b>,
|
||||
not filled with data. Not available if DMG mode is enabled in
|
||||
<a class="Xr" title="Xr">rgblink(1)</a>.</dd>
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><b class="Sy" title="Sy">OAM</b></dt>
|
||||
<dd class="It-tag">An object attributes RAM section. Mapped to memory at
|
||||
$FE00-$FE9F. Can only allocate memory, not fill it.</dd>
|
||||
<dt class="It-tag"><a class="selflink" href="#OAM"><b class="Cm" title="Cm" id="OAM">OAM</b></a></dt>
|
||||
<dd class="It-tag">An object attributes RAM section.
|
||||
<var class="Ar" title="Ar">addr</var> can range from $FE00-$FE9F. Memory
|
||||
in this section can only be allocated with
|
||||
<b class="Sy" title="Sy">DS</b>, not filled with data.</dd>
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><b class="Sy" title="Sy">HRAM</b></dt>
|
||||
<dd class="It-tag">A high RAM section. Mapped to memory at $FF80–$FFFE.
|
||||
Can only allocate memory, not fill it.
|
||||
<dt class="It-tag"><a class="selflink" href="#HRAM"><b class="Cm" title="Cm" id="HRAM">HRAM</b></a></dt>
|
||||
<dd class="It-tag">A high RAM section. <var class="Ar" title="Ar">addr</var>
|
||||
can range from $FF80–$FFFE. Memory in this section can only be
|
||||
allocated with <b class="Sy" title="Sy">DS</b>, not filled with data.
|
||||
<div class="Pp"></div>
|
||||
NOTE: If you use this method of allocating HRAM the assembler will NOT
|
||||
choose the short addressing mode in the LD instructions
|
||||
<b class="Sy" title="Sy">LD [$FF00+n8],A</b> and
|
||||
<b class="Sy" title="Sy">LD A,[$FF00+n8]</b> because the actual address
|
||||
calculation is done by the linker. If you find this undesirable you can
|
||||
use <b class="Ic" title="Ic">RSSET</b> <span class="No">/</span>
|
||||
<b class="Ic" title="Ic">RB</b> <span class="No">/</span>
|
||||
<b class="Ic" title="Ic">RW</b> instead or use the
|
||||
<b class="Sy" title="Sy">LDH [$FF00+n8],A</b> and
|
||||
<b class="Sy" title="Sy">Note</b>: If you use this method of allocating HRAM
|
||||
the assembler will <i class="Em" title="Em">not</i> choose the short
|
||||
addressing mode in the LD instructions <b class="Sy" title="Sy">LD
|
||||
[$FF00+n8],A</b> and <b class="Sy" title="Sy">LD A,[$FF00+n8]</b> because
|
||||
the actual address calculation is done by the linker. If you find this
|
||||
undesirable you can use <b class="Ic" title="Ic">RSSET</b>,
|
||||
<b class="Ic" title="Ic">RB</b>, or <b class="Ic" title="Ic">RW</b>
|
||||
instead or use the <b class="Sy" title="Sy">LDH [$FF00+n8],A</b> and
|
||||
<b class="Sy" title="Sy">LDH A,[$FF00+n8]</b> syntax instead. This forces
|
||||
the assembler to emit the correct instruction and the linker to check if
|
||||
the value is in the correct range. This optimization can be disabled by
|
||||
passing the <b class="Fl" title="Fl">-L</b> flag to
|
||||
<b class="Sy" title="Sy">rgbasm</b> as explained in
|
||||
<a class="Xr" title="Xr">rgbasm(1)</a>.</dd>
|
||||
</dl>
|
||||
<div class="Pp"></div>
|
||||
A section is usually defined as a floating one, but the code can restrict where
|
||||
the linker can place it.
|
||||
<var class="Ar" title="Ar">option</var>s are comma separated and may include:
|
||||
<dl class="Bl-tag">
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><a class="selflink" href="#BANK"><b class="Cm" title="Cm" id="BANK">BANK</b></a>[<var class="Ar" title="Ar">bank</var>]</dt>
|
||||
<dd class="It-tag">Specify which <var class="Ar" title="Ar">bank</var> for the
|
||||
linker to place the section.</dd>
|
||||
<dt class="It-tag"> </dt>
|
||||
<dd class="It-tag"> </dd>
|
||||
<dt class="It-tag"><a class="selflink" href="#ALIGN"><b class="Cm" title="Cm" id="ALIGN">ALIGN</b></a>[<var class="Ar" title="Ar">align</var>]</dt>
|
||||
<dd class="It-tag">Place the section at an address whose
|
||||
<var class="Ar" title="Ar">align</var> least‐significant bits are
|
||||
zero. It is a syntax error to use this option with
|
||||
<var class="Ar" title="Ar">addr</var>.</dd>
|
||||
</dl>
|
||||
<div class="Pp"></div>
|
||||
If a section is defined with no indications, it is a floating section. The
|
||||
linker will decide where to place it in the final binary and it has no
|
||||
obligation to follow any specific rules. The following example defines a
|
||||
section that can be placed anywhere in any ROMX bank:
|
||||
If [<var class="Ar" title="Ar">addr</var>] is not specified, the section is
|
||||
considered “floating”; the linker will automatically calculate
|
||||
an appropriate address for the section. Similarly, if
|
||||
<b class="Cm" title="Cm">BANK</b>[<var class="Ar" title="Ar">bank</var>] is
|
||||
not specified, the linker will automatically find a bank with enough space.
|
||||
<div class="Pp"></div>
|
||||
Sections can also be placed by using a linkerscript file. The format is
|
||||
described in <a class="Xr" title="Xr">rgblink(5)</a>. They allow the user to
|
||||
place floating sections in the desired bank in the order specified in the
|
||||
script. This is useful if the sections can't be placed at an address manually
|
||||
because the size may change, but they have to be together.
|
||||
<div class="Pp"></div>
|
||||
Section examples:
|
||||
<div class="Pp"></div>
|
||||
<div class="Bd" style="margin-left: 5.00ex;">
|
||||
<pre class="Li">
|
||||
@@ -174,8 +216,19 @@ If a section is defined with no indications, it is a floating section. The
|
||||
</pre>
|
||||
</div>
|
||||
<div class="Pp"></div>
|
||||
If it is needed, the following syntax can be used to fix the base address of the
|
||||
section:
|
||||
This switches to the section called “CoolStuff” (or creates it if
|
||||
it doesn't already exist) and defines it as a code section.
|
||||
<div class="Pp"></div>
|
||||
The following example defines a section that can be placed anywhere in any ROMX
|
||||
bank:
|
||||
<div class="Pp"></div>
|
||||
<div class="Bd" style="margin-left: 5.00ex;">
|
||||
<pre class="Li">
|
||||
SECTION "CoolStuff",ROMX
|
||||
</pre>
|
||||
</div>
|
||||
<div class="Pp"></div>
|
||||
If it is needed, the the base address of the section can be specified:
|
||||
<div class="Pp"></div>
|
||||
<div class="Bd" style="margin-left: 5.00ex;">
|
||||
<pre class="Li">
|
||||
@@ -183,8 +236,7 @@ If it is needed, the following syntax can be used to fix the base address of the
|
||||
</pre>
|
||||
</div>
|
||||
<div class="Pp"></div>
|
||||
It won't, however, fix the bank number, which is left to the linker. If you also
|
||||
want to specify the bank you can do:
|
||||
An example with a fixed bank:
|
||||
<div class="Pp"></div>
|
||||
<div class="Bd" style="margin-left: 5.00ex;">
|
||||
<pre class="Li">
|
||||
@@ -201,11 +253,7 @@ And if you only want to force the section into a certain bank, and not it's
|
||||
</pre>
|
||||
</div>
|
||||
<div class="Pp"></div>
|
||||
In addition, you can specify byte alignment for a section. This ensures that the
|
||||
section starts at a memory address where the given number of least-significant
|
||||
bits are 0. This can be used along with <b class="Ic" title="Ic">BANK</b>, if
|
||||
desired. However, if an alignment is specified, the base address must be left
|
||||
unassigned. This can be useful when using DMA to copy data or when it is
|
||||
Alignment examples: one use could be when using DMA to copy data or when it is
|
||||
needed to align the start of an array to 256 bytes to optimize the code that
|
||||
accesses it.
|
||||
<div class="Pp"></div>
|
||||
@@ -217,26 +265,23 @@ In addition, you can specify byte alignment for a section. This ensures that the
|
||||
</pre>
|
||||
</div>
|
||||
<div class="Pp"></div>
|
||||
HINT: If you think this is a lot of typing for doing a simple
|
||||
<b class="Ic" title="Ic">ORG</b> type thing you can quite easily write an
|
||||
<b class="Sy" title="Sy">Hint</b>: If you think this is a lot of typing for
|
||||
doing a simple “org” type thing you can quite easily write an
|
||||
intelligent macro (called <b class="Ic" title="Ic">ORG</b> for example) that
|
||||
uses <b class="Ic" title="Ic">@</b> for the section name and determines
|
||||
correct section type etc as arguments for
|
||||
<b class="Ic" title="Ic">SECTION</b>.
|
||||
<div class="Pp"></div>
|
||||
<h2 class="Ss" title="Ss" id="Section_Stack"><a class="selflink" href="#Section_Stack">Section
|
||||
Stack</a></h2>
|
||||
<b class="Ic" title="Ic">POPS</b> and <b class="Ic" title="Ic">PUSHS</b> provide
|
||||
the interface to the section stack. <b class="Ic" title="Ic">PUSHS</b> will
|
||||
push the current section context on the section stack.
|
||||
<b class="Ic" title="Ic">POPS</b> can then later be used to restore it. Useful
|
||||
for defining sections in included files when you don't want to destroy the
|
||||
section context for the program that included your file. The number of entries
|
||||
in the stack is limited only by the amount of memory in your machine.
|
||||
the interface to the section stack.
|
||||
<div class="Pp"></div>
|
||||
Sections can also be placed by using a linkerscript file. The format is
|
||||
described in <a class="Xr" title="Xr">rgblink(5)</a>. They allow the user to
|
||||
place floating sections in the desired bank in the order specified in the
|
||||
script. This is useful if the sections can't be placed at an address manually
|
||||
because the size may change, but they have to be together.
|
||||
<b class="Ic" title="Ic">PUSHS</b> will push the current section context on the
|
||||
section stack. <b class="Ic" title="Ic">POPS</b> can then later be used to
|
||||
restore it. Useful for defining sections in included files when you don't want
|
||||
to destroy the section context for the program that included your file. The
|
||||
number of entries in the stack is limited only by the amount of memory in your
|
||||
machine.
|
||||
<h1 class="Sh" title="Sh" id="SYMBOLS"><a class="selflink" href="#SYMBOLS">SYMBOLS</a></h1>
|
||||
<h2 class="Ss" title="Ss" id="Symbols"><a class="selflink" href="#Symbols">Symbols</a></h2>
|
||||
RGBDS supports several types of symbols:
|
||||
@@ -254,7 +299,7 @@ RGBDS supports several types of symbols:
|
||||
<dt class="It-hang"><b class="Sy" title="Sy">String equate</b>
|
||||
(<b class="Sy" title="Sy">EQUS</b>)</dt>
|
||||
<dd class="It-hang">Give a frequently used string a name. Can also be used as
|
||||
a mini-macro, like #define in C.</dd>
|
||||
a mini-macro, like <b class="Fd" title="Fd">#define</b> in C.</dd>
|
||||
<dt class="It-hang"><b class="Sy" title="Sy">MACRO</b></dt>
|
||||
<dd class="It-hang">A block of code or pseudo instructions that you invoke
|
||||
like any other mnemonic. You can give them arguments too.</dd>
|
||||
@@ -370,18 +415,14 @@ str_SIZEOF = 259
|
||||
There are four commands in the RS group of commands:
|
||||
<table class="Bl-column">
|
||||
<colgroup>
|
||||
<col style="width: 15.00ex;"/>
|
||||
<col style="min-width: 10.00ex;"/>
|
||||
<col style="min-width: 15.00ex;"/>
|
||||
</colgroup>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><b class="Sy" title="Sy">Command</b></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column"><b class="Sy" title="Sy">Meaning</b></td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#RSRESET"><b class="Ic" title="Ic" id="RSRESET">RSRESET</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Resets the _RS counter to zero.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
@@ -425,7 +466,7 @@ str_SIZEOF = 259
|
||||
<div class="Pp"></div>
|
||||
EQUS is used to define string-symbols. Wherever the assembler meets a string
|
||||
symbol its name is replaced with its value. If you are familiar with C you
|
||||
can think of it as the same as #define.
|
||||
can think of it as the same as <b class="Fd" title="Fd">#define .</b>
|
||||
<div class="Pp"></div>
|
||||
<div class="Bd" style="margin-left: 5.00ex;">
|
||||
<pre class="Li">
|
||||
@@ -604,11 +645,10 @@ ENDM
|
||||
</div>
|
||||
<div class="Pp"></div>
|
||||
<b class="Ic" title="Ic">SHIFT</b> is a special command only available in
|
||||
macros. Very useful in REPT-blocks. It will "shift" the
|
||||
arguments by one "to the left". <b class="Ic" title="Ic">\1</b>
|
||||
will get the value of <b class="Ic" title="Ic">\2</b>,
|
||||
<b class="Ic" title="Ic">\2</b> will get the value in
|
||||
<b class="Ic" title="Ic">\3</b> and so forth.
|
||||
macros. Very useful in REPT-blocks. It will shift the arguments by one to
|
||||
the left. <b class="Ic" title="Ic">\1</b> will get the value of
|
||||
<b class="Ic" title="Ic">\2</b>, <b class="Ic" title="Ic">\2</b> will get
|
||||
the value in <b class="Ic" title="Ic">\3</b> and so forth.
|
||||
<div class="Pp"></div>
|
||||
This is the only way of accessing the value of arguments from 10 to
|
||||
256.</dd>
|
||||
@@ -658,62 +698,52 @@ Note that string symbols that are part of a <b class="Ic" title="Ic">PURGE</b>
|
||||
The following symbols are defined by the assembler:
|
||||
<table class="Bl-column" style="margin-left: 6.00ex;">
|
||||
<colgroup>
|
||||
<col style="width: 15.00ex;"/>
|
||||
<col style="width: 15.00ex;"/>
|
||||
<col style="min-width: 10.00ex;"/>
|
||||
<col style="width: 7.80ex;"/>
|
||||
<col style="min-width: 18.00ex;"/>
|
||||
</colgroup>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><b class="Sy" title="Sy">Type</b></td>
|
||||
<td class="It-column"><b class="Sy" title="Sy">Name</b></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column"><b class="Sy" title="Sy">Contents</b></td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#@"><b class="Ic" title="Ic" id="@">@</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">PC value</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#_PI"><b class="Ic" title="Ic" id="_PI">_PI</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Fixed point π</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#SET"><b class="Ic" title="Ic" id="SET">SET</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#_RS"><b class="Ic" title="Ic" id="_RS">_RS</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">_RS Counter</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#_NARG"><b class="Ic" title="Ic" id="_NARG">_NARG</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Number of arguments passed to macro</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__LINE__"><b class="Ic" title="Ic" id="__LINE__">__LINE__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">The current line number</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQUS"><b class="Ic" title="Ic" id="EQUS">EQUS</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__FILE__"><b class="Ic" title="Ic" id="__FILE__">__FILE__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">The current filename</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQUS"><b class="Ic" title="Ic" id="EQUS">EQUS</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__DATE__"><b class="Ic" title="Ic" id="__DATE__">__DATE__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Today's date</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQUS"><b class="Ic" title="Ic" id="EQUS">EQUS</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__TIME__"><b class="Ic" title="Ic" id="__TIME__">__TIME__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">The current time</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
@@ -729,55 +759,46 @@ The following symbols are defined by the assembler:
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__UTC_YEAR__"><b class="Ic" title="Ic" id="__UTC_YEAR__">__UTC_YEAR__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Today's year</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__UTC_MONTH__"><b class="Ic" title="Ic" id="__UTC_MONTH__">__UTC_MONTH__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Today's month number, 1-12</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__UTC_DAY__"><b class="Ic" title="Ic" id="__UTC_DAY__">__UTC_DAY__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Today's day of the month, 1-31</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__UTC_HOUR__"><b class="Ic" title="Ic" id="__UTC_HOUR__">__UTC_HOUR__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Current hour, 0-23</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__UTC_MINUTE__"><b class="Ic" title="Ic" id="__UTC_MINUTE__">__UTC_MINUTE__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Current minute, 0-59</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__UTC_SECOND__"><b class="Ic" title="Ic" id="__UTC_SECOND__">__UTC_SECOND__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Current second, 0-59</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__RGBDS_MAJOR__"><b class="Ic" title="Ic" id="__RGBDS_MAJOR__">__RGBDS_MAJOR__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Major version number of RGBDS.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__RGBDS_MINOR__"><b class="Ic" title="Ic" id="__RGBDS_MINOR__">__RGBDS_MINOR__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Minor version number of RGBDS.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#EQU"><b class="Ic" title="Ic" id="EQU">EQU</b></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#__RGBDS_PATCH__"><b class="Ic" title="Ic" id="__RGBDS_PATCH__">__RGBDS_PATCH__</b></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">Patch version number of RGBDS.</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1039,15 +1060,15 @@ A great number of operators you can use in expressions are available (listed in
|
||||
order of precedence):
|
||||
<table class="Bl-column" style="margin-left: 6.00ex;">
|
||||
<colgroup>
|
||||
<col style="width: 15.00ex;"/>
|
||||
<col style="min-width: 10.00ex;"/>
|
||||
<col style="min-width: 8.00ex;"/>
|
||||
</colgroup>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><b class="Sy" title="Sy">Operator</b></td>
|
||||
<td class="It-column"><b class="Sy" title="Sy">Meaning</b></td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column">()</td>
|
||||
<td class="It-column"><a class="selflink" href="#(_)"><code class="Li" id="(_)">(
|
||||
)</code></a></td>
|
||||
<td class="It-column">Precedence override</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
@@ -1070,8 +1091,8 @@ A great number of operators you can use in expressions are available (listed in
|
||||
<td class="It-column">Shift left/right</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#&"><code class="Li" id="&">&</code></a>
|
||||
| <a class="selflink" href="#^"><code class="Li" id="^">^</code></a></td>
|
||||
<td class="It-column"><a class="selflink" href="#&_|_^"><code class="Li" id="&_|_^">&
|
||||
| ^</code></a></td>
|
||||
<td class="It-column">Binary and/or/xor</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
@@ -1096,7 +1117,7 @@ A great number of operators you can use in expressions are available (listed in
|
||||
<td class="It-column">Boolean and/or</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column">!</td>
|
||||
<td class="It-column"><a class="selflink" href="#!"><code class="Li" id="!">!</code></a></td>
|
||||
<td class="It-column">Unary Boolean not</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1127,57 +1148,90 @@ Some things are different for fixed-point math, though, which is why you have
|
||||
the following functions to use:
|
||||
<table class="Bl-column" style="margin-left: 6.00ex;">
|
||||
<colgroup>
|
||||
<col style="width: 15.00ex;"/>
|
||||
<col style="min-width: 10.00ex;"/>
|
||||
<col style="min-width: 11.00ex;"/>
|
||||
</colgroup>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><b class="Sy" title="Sy">Name</b></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column"><b class="Sy" title="Sy">Operation</b></td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#DIV(x,y)"><code class="Li" id="DIV(x,y)">DIV(x,y)</code></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">x/y</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">DIV</b>(<var class="Fa" title="Fa">x</var>,
|
||||
<var class="Fa" title="Fa">y</var>)</td>
|
||||
<td class="It-column">
|
||||
<math class="eqn">
|
||||
<mrow><mi>x</mi><mo>÷</mo><mi>y</mi></mrow>
|
||||
</math>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#MUL(x,y)"><code class="Li" id="MUL(x,y)">MUL(x,y)</code></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">x*y</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">MUL</b>(<var class="Fa" title="Fa">x</var>,
|
||||
<var class="Fa" title="Fa">y</var>)</td>
|
||||
<td class="It-column">
|
||||
<math class="eqn">
|
||||
<mrow><mi>x</mi><mo>×</mo><mi>y</mi></mrow>
|
||||
</math>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#SIN(x)"><code class="Li" id="SIN(x)">SIN(x)</code></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">sin(x)</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">SIN</b>(<var class="Fa" title="Fa">x</var>)</td>
|
||||
<td class="It-column">
|
||||
<math class="eqn">
|
||||
<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>
|
||||
</math>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#COS(x)"><code class="Li" id="COS(x)">COS(x)</code></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">cos(x)</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">COS</b>(<var class="Fa" title="Fa">x</var>)</td>
|
||||
<td class="It-column">
|
||||
<math class="eqn">
|
||||
<mrow><mi>cos</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>
|
||||
</math>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#TAN(x)"><code class="Li" id="TAN(x)">TAN(x)</code></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">tan(x)</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">TAN</b>(<var class="Fa" title="Fa">x</var>)</td>
|
||||
<td class="It-column">
|
||||
<math class="eqn">
|
||||
<mrow><mi>tan</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>
|
||||
</math>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#ASIN(x)"><code class="Li" id="ASIN(x)">ASIN(x)</code></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">arcsin(x)</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">ASIN</b>(<var class="Fa" title="Fa">x</var>)</td>
|
||||
<td class="It-column">
|
||||
<math class="eqn">
|
||||
<mrow><mi>asin</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>
|
||||
</math>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#ACOS(x)"><code class="Li" id="ACOS(x)">ACOS(x)</code></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">arccos(x)</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">ACOS</b>(<var class="Fa" title="Fa">x</var>)</td>
|
||||
<td class="It-column">
|
||||
<math class="eqn">
|
||||
<mrow><mi>acos</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>
|
||||
</math>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#ATAN(x)"><code class="Li" id="ATAN(x)">ATAN(x)</code></a></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column">arctan(x)</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">ATAN</b>(<var class="Fa" title="Fa">x</var>)</td>
|
||||
<td class="It-column">
|
||||
<math class="eqn">
|
||||
<mrow><mi>atan</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>
|
||||
</math>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#ATAN2(x,y)"><code class="Li" id="ATAN2(x,y)">ATAN2(x,y)</code></a></td>
|
||||
<td class="It-column">Angle between (x,y) and (1,0)</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">ATAN2</b>(<var class="Fa" title="Fa">x</var>,
|
||||
<var class="Fa" title="Fa">y</var>)</td>
|
||||
<td class="It-column">Angle between
|
||||
<math class="eqn">
|
||||
<mrow><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi><mo>)</mo></mrow>
|
||||
</math>
|
||||
and
|
||||
<math class="eqn">
|
||||
<mrow><mo>(</mo><mn>1</mn><mo>,</mo><mn>0</mn><mo>)</mo></mrow>
|
||||
</math>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="Pp"></div>
|
||||
@@ -1203,8 +1257,7 @@ The most basic string expression is any number of characters contained in double
|
||||
there are a number of commands you can use within a string:
|
||||
<table class="Bl-column" style="margin-left: 6.00ex;">
|
||||
<colgroup>
|
||||
<col style="width: 15.00ex;"/>
|
||||
<col style="min-width: 10.00ex;"/>
|
||||
<col style="min-width: 6.00ex;"/>
|
||||
</colgroup>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><b class="Sy" title="Sy">String</b></td>
|
||||
@@ -1258,7 +1311,7 @@ A funky feature is <b class="Sy" title="Sy">{symbol}</b> withing a string. This
|
||||
<div class="Pp"></div>
|
||||
HINT: The <b class="Sy" title="Sy">{symbol}</b> construct can also be used
|
||||
outside strings. The symbol's value is again inserted as a string. This is
|
||||
just a short way of doing "{symbol}".
|
||||
just a short way of doing “{symbol}”.
|
||||
<div class="Pp"></div>
|
||||
Whenever the macro-language expects a string you can actually use a string
|
||||
expression. This consists of one or more of these function (yes, you can nest
|
||||
@@ -1266,45 +1319,47 @@ Whenever the macro-language expects a string you can actually use a string
|
||||
used as part of an integer expression!
|
||||
<table class="Bl-column">
|
||||
<colgroup>
|
||||
<col style="width: 15.00ex;"/>
|
||||
<col style="min-width: 10.00ex;"/>
|
||||
<col style="min-width: 20.00ex;"/>
|
||||
</colgroup>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><b class="Sy" title="Sy">Name</b></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column"><b class="Sy" title="Sy">Operation</b></td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#STRLEN(string)"><code class="Li" id="STRLEN(string)">STRLEN(string)</code></a></td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">STRLEN</b>(<var class="Fa" title="Fa">string</var>)</td>
|
||||
<td class="It-column">Returns the number of characters in string</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#STRCAT(str1,str2)"><code class="Li" id="STRCAT(str1,str2)">STRCAT(str1,str2)</code></a></td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">STRCAT</b>(<var class="Fa" title="Fa">str1</var>,
|
||||
<var class="Fa" title="Fa">str2</var>)</td>
|
||||
<td class="It-column">Appends str2 to str1.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#STRCMP(str1,str2)"><code class="Li" id="STRCMP(str1,str2)">STRCMP(str1,str2)</code></a></td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">STRCMP</b>(<var class="Fa" title="Fa">str1</var>,
|
||||
<var class="Fa" title="Fa">str2</var>)</td>
|
||||
<td class="It-column">Returns negative if str1 is alphabetically lower than
|
||||
str2, zero if they match, positive if str1 is greater than str2.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#STRIN(str1,str2)"><code class="Li" id="STRIN(str1,str2)">STRIN(str1,str2)</code></a></td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">STRIN</b>(<var class="Fa" title="Fa">str1</var>,
|
||||
<var class="Fa" title="Fa">str2</var>)</td>
|
||||
<td class="It-column">Returns the position of str2 in str1 or zero if it's
|
||||
not present (first character is position 1).</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#STRSUB(str,pos,len)"><code class="Li" id="STRSUB(str,pos,len)">STRSUB(str,pos,len)</code></a></td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">STRSUB</b>(<var class="Fa" title="Fa">str</var>,
|
||||
<var class="Fa" title="Fa">pos</var>,
|
||||
<var class="Fa" title="Fa">len</var>)</td>
|
||||
<td class="It-column">Returns a substring from str starting at pos (first
|
||||
character is position 1) and with len characters.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#STRUPR(str)"><code class="Li" id="STRUPR(str)">STRUPR(str)</code></a></td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">STRUPR</b>(<var class="Fa" title="Fa">str</var>)</td>
|
||||
<td class="It-column">Converts all characters in str to capitals and returns
|
||||
the new string.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#STRLWR(str)"><code class="Li" id="STRLWR(str)">STRLWR(str)</code></a></td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">STRLWR</b>(<var class="Fa" title="Fa">str</var>)</td>
|
||||
<td class="It-column">Converts all characters in str to lower case and
|
||||
returns the new string.</td>
|
||||
</tr>
|
||||
@@ -1340,38 +1395,40 @@ CHARMAP "A", 128
|
||||
There are a few other functions that do various useful things:
|
||||
<table class="Bl-column">
|
||||
<colgroup>
|
||||
<col style="width: 15.00ex;"/>
|
||||
<col style="min-width: 10.00ex;"/>
|
||||
<col style="min-width: 9.00ex;"/>
|
||||
</colgroup>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><b class="Sy" title="Sy">Name</b></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column"></td>
|
||||
<td class="It-column"><b class="Sy" title="Sy">Operation</b></td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#BANK(@/str/lbl)"><code class="Li" id="BANK(@/str/lbl)">BANK(@/str/lbl)</code></a></td>
|
||||
<td class="It-column">Returns a bank number. If the argument is the symbol
|
||||
<b class="Ic" title="Ic">@,</b> this function returns the bank of the
|
||||
current section. If the argument is a string, it returns the bank of the
|
||||
section that has that name. If the argument is a label, it returns the
|
||||
bank number the label is in. For labels, as the linker has to resolve
|
||||
this, it can't be used when the expression has to be constant.</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">BANK</b>(<var class="Fa" title="Fa">arg</var>)</td>
|
||||
<td class="It-column">Returns a bank number. If
|
||||
<var class="Ar" title="Ar">arg</var> is the symbol
|
||||
<b class="Ic" title="Ic">@</b>, this function returns the bank of the
|
||||
current section. If <var class="Ar" title="Ar">arg</var> is a string, it
|
||||
returns the bank of the section that has that name. If
|
||||
<var class="Ar" title="Ar">arg</var> is a label, it returns the bank
|
||||
number the label is in. For labels, as the linker has to resolve this, it
|
||||
can't be used when the expression has to be constant.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#DEF(label)"><code class="Li" id="DEF(label)">DEF(label)</code></a></td>
|
||||
<td class="It-column">Returns TRUE if label has been defined.</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">DEF</b>(<var class="Fa" title="Fa">label</var>)</td>
|
||||
<td class="It-column">Returns TRUE if <var class="Ar" title="Ar">label</var>
|
||||
has been defined.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#HIGH(r16/cnst/lbl)"><code class="Li" id="HIGH(r16/cnst/lbl)">HIGH(r16/cnst/lbl)</code></a></td>
|
||||
<td class="It-column">Returns the top 8 bits of the operand if it is a label
|
||||
or constant, or the top 8-bit register if it is a 16-bit register.</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">HIGH</b>(<var class="Fa" title="Fa">arg</var>)</td>
|
||||
<td class="It-column">Returns the top 8 bits of the operand if
|
||||
<var class="Ar" title="Ar">arg</var> is a label or constant, or the top
|
||||
8-bit register if it is a 16-bit register.</td>
|
||||
</tr>
|
||||
<tr class="It-column">
|
||||
<td class="It-column"><a class="selflink" href="#LOW(r16/cnst/lbl)"><code class="Li" id="LOW(r16/cnst/lbl)">LOW(r16/cnst/lbl)</code></a></td>
|
||||
<td class="It-column">Returns the bottom 8 bits of the operand if it is a
|
||||
label or constant, or the bottom 8-bit register if it is a 16-bit register
|
||||
(AF isn't a valid register for this function).</td>
|
||||
<td class="It-column"><b class="Fn" title="Fn">LOW</b>(<var class="Fa" title="Fa">arg</var>)</td>
|
||||
<td class="It-column">Returns the bottom 8 bits of the operand if
|
||||
<var class="Ar" title="Ar">arg</var> is a label or constant, or the bottom
|
||||
8-bit register if it is a 16-bit register (AF isn't a valid register for
|
||||
this function).</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1 class="Sh" title="Sh" id="MISCELLANEOUS"><a class="selflink" href="#MISCELLANEOUS">MISCELLANEOUS</a></h1>
|
||||
@@ -1404,180 +1461,6 @@ The options that OPT can modify are currently: <b class="Sy" title="Sy">b</b>,
|
||||
want to destroy the options set by the program that included your file. The
|
||||
stacks number of entries is limited only by the amount of memory in your
|
||||
machine.
|
||||
<h1 class="Sh" title="Sh" id="ALPHABETICAL_LIST_OF_KEYWORDS"><a class="selflink" href="#ALPHABETICAL_LIST_OF_KEYWORDS">ALPHABETICAL
|
||||
LIST OF KEYWORDS</a></h1>
|
||||
<dl class="Bl-inset Bl-compact">
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#@">@</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__DATE__">__DATE__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__FILE__">__FILE__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__ISO_8601_LOCAL__">__ISO_8601_LOCAL__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__ISO_8601_UTC__">__ISO_8601_UTC__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__LINE__">__LINE__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__TIME__">__TIME__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__RGBDS_MAJOR__">__RGBDS_MAJOR__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__RGBDS_MINOR__">__RGBDS_MINOR__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__RGBDS_PATCH__">__RGBDS_PATCH__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__UTC_YEAR__">__UTC_YEAR__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__UTC_MONTH__">__UTC_MONTH__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__UTC_DAY__">__UTC_DAY__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__UTC_HOUR__">__UTC_HOUR__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__UTC_MINUTE__">__UTC_MINUTE__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#__UTC_SECOND__">__UTC_SECOND__</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#_NARG">_NARG</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#_PI">_PI</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#_RS">_RS</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ACOS">ACOS</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ASIN">ASIN</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ATAN">ATAN</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ATAN2">ATAN2</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#BANK">BANK</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#CHARMAP">CHARMAP</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#COS">COS</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#DB">DB</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#DEF">DEF</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#DIV">DIV</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#DL">DL</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#DS">DS</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#DW">DW</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ELIF">ELIF</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ELSE">ELSE</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ENDC">ENDC</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ENDM">ENDM</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ENDR">ENDR</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#EQU">EQU</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#EQUS">EQUS</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#EXPORT">EXPORT</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#FAIL">FAIL</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#GLOBAL">GLOBAL</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#HIGH">HIGH</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#HRAM">HRAM</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#IF">IF</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#INCBIN">INCBIN</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#INCLUDE">INCLUDE</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#LOW">LOW</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#MACRO">MACRO</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#MUL">MUL</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#OPT">OPT</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#POPO">POPO</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#POPS">POPS</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#PRINTF">PRINTF</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#PRINTI">PRINTI</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#PRINTT">PRINTT</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#PRINTV">PRINTV</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#PURGE">PURGE</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#PUSHO">PUSHO</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#PUSHS">PUSHS</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#REPT">REPT</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#RB">RB</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#RL">RL</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ROM0">ROM0</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#ROMX">ROMX</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#RSRESET">RSRESET</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#RSSET">RSSET</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#RW">RW</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#SECTION">SECTION</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#SET">SET</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#SHIFT">SHIFT</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#SIN">SIN</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#SRAM">SRAM</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#STRCAT">STRCAT</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#STRCMP">STRCMP</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#STRIN">STRIN</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#STRLEN">STRLEN</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#STRLWR">STRLWR</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#STRSUB">STRSUB</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#STRUPR">STRUPR</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#TAN">TAN</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#VRAM">VRAM</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#WRAM0">WRAM0</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#WRAMX">WRAMX</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
<dt class="It-inset"><a class="Sx" title="Sx" href="#WARN">WARN</a></dt>
|
||||
<dd class="It-inset"></dd>
|
||||
</dl>
|
||||
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
|
||||
ALSO</a></h1>
|
||||
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(1)</a>,
|
||||
|
||||
Reference in New Issue
Block a user