Skip to content

Commit d2b7678

Browse files
committed
document a30ac2c
better late than never i guess
1 parent 5abc89b commit d2b7678

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

docs/changelog/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ <h3>New features:</h3>
111111
<li>Variadic macro support (p4plus2)</li>
112112
<li>Support for global labels (p4plus2)</li>
113113
<li>Errors about crossing banks have been improved, now they print the exact line where the bank border was crossed instead of saying it was "somewhere before this point". (randomdude999)</li>
114+
<li>Add <code>fill align</code> and <code>skip align</code> (randomdude999)</li>
114115
</ul>
115116

116117
<h3>Bug fixes:</h3>

docs/manual/index.html

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,13 +1748,21 @@ <h4 id="base">base</h4>
17481748
base off
17491749
rtl</code></pre>
17501750
<h4 id="skip">skip</h4>
1751-
<pre><code class="65c816_asar">skip {num_bytes}</code></pre>
1752-
The skip command moves the pc by <code>num_bytes</code> bytes. By specifying a negative value, the pc can be moved backwards.
1751+
<pre><code class="65c816_asar">skip {num_bytes}
1752+
skip align {alignment} [offset {offset}]</code></pre>
1753+
The skip command moves the pc by <code>num_bytes</code> bytes. By specifying a negative value, the pc can be moved backwards. When <code>alignment</code> is given, skips to the next multiple of <code>alignment</code>, plus <code>offset</code> if it is specified. Note that the alignment must be a power of 2, if specified. Offset can also be negative, in that case it's treated exactly like <code>alignment+offset</code>. The seeked-to position will always be after the current SNES position, but it might be before the next multiple of <code>alignment</code>: see the last example.
17531754
<pre><code class="65c816_asar">org $008000
17541755
skip 5
17551756
; pc is now at $008005
17561757
skip -1
1757-
; pc is now at $008004</code></pre>
1758+
; pc is now at $008004
1759+
skip align 16
1760+
; pc is now at $008010
1761+
skip align 16 offset 5
1762+
; pc is now at $008015
1763+
skip align $20 offset $17
1764+
; pc is now at $008017
1765+
</code></pre>
17581766
<h4 id="warnpc">warnpc</h4>
17591767
<pre><code class="65c816_asar">warnpc {snes_address}</code></pre>
17601768
The warnpc command checks if the current pc is <code>&gt; snes_address</code>. If that's the case, it throws an error. This is useful for detecting overflow errors.
@@ -2945,11 +2953,16 @@ <h4 id="tables">Tables</h4>
29452953
db "something ""cool"""</code></pre>
29462954
<h4 id="fill">fillbyte/fill</h4>
29472955
<pre><code class="65c816_asar">fillbyte {byte}</code></pre>
2948-
<pre><code class="65c816_asar">fill {num}</code></pre>
2949-
The fillbyte and fill commands let you write a specific byte value to the ROM multiple times. The <code>byte</code> parameter of fillbyte specifies which value to write, wheres fill writes that value to the output ROM <code>num</code> times.
2956+
<pre><code class="65c816_asar">fill {num}
2957+
fill align {alignment} [offset {offset}]</code></pre>
2958+
The fillbyte and fill commands let you write a specific byte value to the ROM multiple times. The <code>byte</code> parameter of fillbyte specifies which value to write, wheres fill writes that value to the output ROM <code>num</code> times. If <code>alignment</code> is specified, the value will be written repeatedly until the SNES address has the specified alignment, similar to <code>skip align</code>.
29502959
<pre><code class="65c816_asar">fillbyte $FF
29512960
; This writes $FF $FF $FF $FF $FF $FF $FF $FF
2952-
fill 8</code></pre>
2961+
fill 8
2962+
org $008005
2963+
; this writes $FF until SNES address $00800A (=$8008 + 2)
2964+
fill align 8 offset 2
2965+
</code></pre>
29532966
It's also possible to write 16-bit, 24-bit or 32-bit values with the fill command by using <code>fillword</code>, <code>filllong</code> or <code>filldword</code> instead of fillbyte. Note that the <code>num</code> parameter of fill still specifies the number of bytes to write in those cases. Values might get truncated as needed to exactly reach the specified number of bytes to write.
29542967
<h4 id="pad">padbyte/pad</h4>
29552968
<pre><code class="65c816_asar">padbyte {byte}</code></pre>

0 commit comments

Comments
 (0)