You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/changelog/index.html
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,7 @@ <h3>New features:</h3>
111
111
<li>Variadic macro support (p4plus2)</li>
112
112
<li>Support for global labels (p4plus2)</li>
113
113
<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>
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.
The warnpc command checks if the current pc is <code>> snes_address</code>. If that's the case, it throws an error. This is useful for detecting overflow errors.
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><codeclass="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>.
2950
2959
<pre><codeclass="65c816_asar">fillbyte $FF
2951
2960
; 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>
2953
2966
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.
0 commit comments