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
The rep command lets you compile any bit of code <code>num</code> times. It functions similarly to <ahref="#pseudo-opcodes">pseudo opcodes</a>, but without being limited to certain opcodes only. Instead, you can repeat almost any bit of code supported by Asar, even macro calls. Note that in xkas compatibility mode, <code>rep 0</code> will compile the following code once, whereas <code>rep -1</code> (or any number <code>< 0</code>) won't compile the following code at all. This is to keep compatibility with old patches, which occasionally used the rep command as a replacement for conditionals. Also note that stacking multiple rep commands is not supported (only the most recent rep will take effect).
By default, each character in a Unicode string used in in a table maps onto the respective Unicode code point. This mapping can be customized via the table command:
Where <code>filename</code> specifies the path to a table file (enclose in double quotes to use file names with spaces, see section <ahref="#includes">Includes</a> for details on Asar's handling of file names) and ltr/rtl specifies whether that file is in left-to-right or right-to left format (default: left-to-right).<br/>
2890
-
Format of left-to-right table files:
2891
-
<pre><code>{character}={value}
2892
-
[character=value...]</code></pre>
2893
-
Format of right-to-left table files:
2894
-
<pre><code>{value}={character}
2895
-
[value=character...]</code></pre>
2896
-
where <code>character</code> represents a Unicode character (only single code points at this time - e.g., a precomposed "Ä" will work, while a split "¨" and an "A" will throw an error) and <code>value</code> represents a hexadecimal number literal (without a prefix) to map to that character. Characters not mapped in a table will still map to their respective Unicode code point. It's also possible to directly map characters inline without using a table file by using the syntax
2897
-
<pre><code>'{character}' = {value}</code></pre>
2898
-
where <code>value</code> can be any number literal or math statement.<br/>
2899
-
To reset the current table mapping to a direct Unicode code point mapping, use the command <code>cleartable</code>. Additionally, the <code>pushtable</code> command lets you push the current table mapping to the stack, whereas the <code>pulltable</code> command lets you restore the mapping from the stack.
2900
-
<pre><codeclass="65c816_asar">; Contents of table1.txt:
2901
-
;A=1A
2902
-
;B=1B
2903
-
;C=1C
2904
-
;日=2A
2905
-
;本=2B
2906
-
;語=2C
2907
-
2908
-
; Contents of table2.txt:
2909
-
;1D=A
2910
-
;1E=B
2911
-
;1F=C
2912
-
;2D=日
2913
-
;2E=本
2914
-
;2F=語
2874
+
By default, each character in a Unicode string used in a table maps onto the respective Unicode code points it's composed of. This mapping can be customized via character literal assignments:
Where <code>character</code> is a Unicode code point and <code>value</code> is any math expression, specifying what value that code point will be remapped to. Only single code points can be remappe at this time - e.g., a precomposed "Ä" will work, while a split "¨" and an "A" will throw an error.<br/>
2877
+
To reset all mappings to a direct Unicode code point mapping, use the command <code>cleartable</code>. Additionally, the <code>pushtable</code> command lets you push all current mappings onto a stack, whereas the <code>pulltable</code> command lets you restore the mappings from that stack.
2878
+
<pre><codeclass="65c816_asar">; Contents of table1.asm:
The <codeclass="65c816_asar">check bankcross</code> command enables (<codeclass="65c816_asar">on</code>) or disables (<codeclass="65c816_asar">off</code>) throwing errors when a bank border is crossed while assembling a file. The default is <codeclass="65c816_asar">on</code>. Use this with caution as some features may not behave correctly with bank border checking disabled and some places may still check for bank borders, anyways.
The <codeclass="65c816_asar">check bankcross</code> command enables or disables throwing errors when a bank border is crossed while assembling a file. The default is <codeclass="65c816_asar">full</code>, which will throw an error after crossing full bank borders only. A value of <codeclass="65c816_asar">half</code> will throw an error at crossing half banks (aka multiples of 0x8000). <codeclass="65c816_asar">off</code>code> will disable checks entirely. Use this setting with caution as some features may not behave correctly with bank border checking disabled, and some places may check for bank borders, anyways.
3316
3294
<pre><codeclass="65c816_asar">check bankcross off
3317
3295
3318
3296
org $80FFFF
3319
3297
3320
3298
db $00,$00
3321
3299
3322
-
check bankcross on
3300
+
check bankcross full
3323
3301
3324
3302
print pc ; Will print 818001 when using LoROM mapper</code></pre>
0 commit comments