Skip to content

Commit cf0fa08

Browse files
committed
Removed more deprecated stuff from manual
1 parent e7d6ef0 commit cf0fa08

File tree

1 file changed

+6
-48
lines changed

1 file changed

+6
-48
lines changed

docs/manual/index.html

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ <h1>Asar</h1>
6565
<li><a href="#xkas">xkas</a></li>
6666
<li><a href="#asar">asar</a></li>
6767
<li><a href="#warn-xkas">warn xkas</a></li>
68-
<li><a href="#math-pri">math pri</a></li>
69-
<li><a href="#math-round">math round</a></li>
7068
<li><a href="#namespace-nested">namespace nested</a></li>
7169
</ul>
7270
</li>
@@ -1666,34 +1664,6 @@ <h4 id="asar">asar</h4>
16661664
<h4 id="warn-xkas">warn xkas</h4>
16671665
<pre><code class="65c816_asar">warn xkas {on/off}</code></pre>
16681666
The <code class="65c816_asar">warn xkas</code> command determines whether Asar should throw warnings on behavior that is known to be different between xkas and Asar. Use <code>warn xkas on</code> to enable these warnings and <code>warn xkas off</code> to disable them. It's recommended to only enable them when not using <a href="#xkas">xkas compatibility mode</a>. Note that some behavioral changes throw warnings or errors regardless of this setting.
1669-
<h4 id="math-pri">math pri</h4>
1670-
<pre><code class="65c816_asar">math pri {on/off}</code></pre>
1671-
The <code class="65c816_asar">math pri</code> command tells Asar which order of operations to use in math experssions. When set to off (default), Asar uses left-to-right math, just like xkas v0.06. When set to on, Asar follows the conventional oder of operations (exponentiation before multiplication & division, multiplication & division before addition & subtraction etc.). Parentheses can be used in either mode and tell Asar to calculate the expression inside first. For most intents and purposes, working with this flag enabled is more practical and predictable. It is disabled by default solely for the purpose of xkas backwards compatibility, unless <code class="65c816_asar">@asar 1.9</code> or a higher version is specified at the start of the file, which will change the default to <code class="65c816_asar">math pri on</code>. When writing patches specifially for Asar, it is recommended to always enable this flag.
1672-
<pre><code class="65c816_asar">math pri off
1673-
db 1+(6/3)*5 ; db 15
1674-
1675-
math pri on
1676-
db 1+(6/3)*5 ; db 11</code></pre>
1677-
<h4 id="math-round">math round</h4>
1678-
<pre><code class="65c816_asar">math round {on/off}</code></pre>
1679-
The <code class="65c816_asar">math round</code> command tells Asar which rounding behavior to use in math expressions. When set to on (default), Asar truncates all numbers immediately, whereas when set to off, Asar only truncates numbers whenever they need to be cast to an integer type. Note that having this flag enabled will make it practically impossible to work with floating point numbers since calculations will lead to unexpected and impractical results. It is the default setting solely for the purpose of xkas backwards compatibility. When writing patches specifially for Asar, it is recommended to always disable this flag.
1680-
<pre><code class="65c816_asar">math round on
1681-
; 1.75 is immediately truncated to 1, resulting in (3/4)+1
1682-
; 3/4 would result in 0.75, which is immediately truncated to 0, resulting in 0+1
1683-
; Thus leading to the final result of &quot;db 1&quot;
1684-
db (3/4)+1.75
1685-
1686-
; !some_number contains 0 after this line
1687-
!some_number #= 0.75
1688-
1689-
math round off
1690-
; As expected will result in 0.75+1.75, which will result in 2.5
1691-
; 2.5 is truncated to 2
1692-
; Thus leading to the final result of &quot;db 2&quot;
1693-
db (3/4)+1.75
1694-
1695-
; !some_number contains 0.75 after this line
1696-
!some_number #= 0.75</code></pre>
16971667
<h4 id="namespace-nested">namespace nested</h4>
16981668
<pre><code class="65c816_asar">namespace nested {on/off}</code></pre>
16991669
The <code class="65c816_asar">namespace nested</code> command enables (<code class="65c816_asar">on</code>) or disables (<code class="65c816_asar">off</code>) nested namespaces. The default is <code class="65c816_asar">off</code>. See section <a href="#namespaces">Namespaces</a> for details.<br /><br />
@@ -1894,18 +1864,8 @@ <h4 id="arch-spc700-inline">The spc700-inline architecture</h4>
18941864
<a href="#contents">Return to top</a></div>
18951865
<hr />
18961866
<div id="math"><h3>Math</h3>
1897-
Math is supported in all opcodes, functions and labels. By default, Asar uses left-to-right math for backwards-compatibility with xkas which means that it ignores operator precedence.
1898-
<pre><code class="65c816_asar">lda #6*2+5 ; the same as &quot;lda #17&quot;
1899-
lda #5+6*2 ; the same as &quot;lda #22&quot;</code></pre>
1900-
This behavior can be changed by using the command <code class="65c816_asar">math pri on</code>, which makes Asar apply conventional prioritization rules in all math statements. (See <a href="#math-pri">math pri</a>)
1901-
<pre><code class="65c816_asar">math pri on
1902-
1903-
lda #6*2+5 ; the same as &quot;lda #17&quot;
1904-
lda #5+6*2 ; the same as &quot;lda #17&quot;</code></pre>
1905-
In both modes, Asar supports parentheses for explicit control over the order of operations.
1906-
<pre><code class="65c816_asar">math pri on
1907-
1908-
lda #5+6*2 ; the same as &quot;lda #17&quot;
1867+
Math is supported in all opcodes, functions and labels. Asar applies the conventional operator prioritization rules (PEMDAS) in math expressions and supports parentheses for explicit control over the order of operations.
1868+
<pre><code class="65c816_asar">lda #5+6*2 ; the same as &quot;lda #17&quot;
19091869
lda #(5+6)*2 ; the same as &quot;lda #22&quot;</code></pre>
19101870
Math statements in Asar support the following operators:<br/><br/>
19111871

@@ -2732,7 +2692,7 @@ <h4 id="built-ins">Built-in Functions</h4>
27322692
</tr>
27332693
<tr>
27342694
<td><code class="65c816_asar">sizeof(identifier)</code></td>
2735-
<td>Takes the identifier of a struct as a parameter and returns the base size of that struct (without any extension structs). Throws an error if a struct with that name doesn't exist. For backwards compatibility, the identifier can be surrounded with quotes.</td>
2695+
<td>Takes the identifier of a struct as a parameter and returns the base size of that struct (without any extension structs).</td>
27362696
<td><pre><code class="65c816_asar">struct parent $0000
27372697
.data1: skip 2
27382698
endstruct
@@ -2746,7 +2706,7 @@ <h4 id="built-ins">Built-in Functions</h4>
27462706
</tr>
27472707
<tr>
27482708
<td><code class="65c816_asar">objectsize(identifier)</code></td>
2749-
<td>Takes the identifier of a struct as a parameter and returns the object size of that struct. In the case of an extended struct, this will be the base size of the struct plus the size of its largest extension struct. Throws an error if a struct with that name doesn't exist. For backwards compatibility, the identifier can be surrounded with quotes.</td>
2709+
<td>Takes the identifier of a struct as a parameter and returns the object size of that struct. In the case of an extended struct, this will be the base size of the struct plus the size of its largest extension struct. Throws an error if a struct with that name doesn't exist.</td>
27502710
<td><pre><code class="65c816_asar">struct parent $0000
27512711
.data1: skip 2
27522712
endstruct
@@ -2760,7 +2720,7 @@ <h4 id="built-ins">Built-in Functions</h4>
27602720
</tr>
27612721
<tr>
27622722
<td><code class="65c816_asar">datasize(label)</code></td>
2763-
<td>Takes a given label and calculates the distance between it and the next label. It will throw a warning if the distance exceeds 0xFFFF or is the last label in the targeted assembly.</td>
2723+
<td>Takes a given label and calculates the distance between it and the next label. It will throw a warning if the distance exceeds 0xFFFF or is the last label in the targeted assembly.</td>
27642724
<td><pre><code class="65c816_asar">org $008000
27652725
main:
27662726

@@ -2789,8 +2749,6 @@ <h4 id="built-ins">Built-in Functions</h4>
27892749
endif</code></pre></td>
27902750
</tr>
27912751
</table><br/>
2792-
All built-in functions can be overridden by user-defined functions. Prepending an underscore (for example: <code class="65c816_asar">_read1()</code>) leads to the original function, which can be used to make an overridden function call its original function.
2793-
<pre><code class="65c816_asar">function read1(x) = _read1(x+$010000)</code></pre>
27942752
While user-defined functions can't use string parameters themselves, passthrough of string parameters to built-in functions is supported.
27952753
<pre><code class="65c816_asar">function readfilenormalized(filename, pos) = readfile4(filename, pos)/2147483648.0
27962754
db readfilenormalizd("datafile.bin", 0)</code></pre>
@@ -3295,7 +3253,7 @@ <h4 id="print">print</h4>
32953253
</tr>
32963254
<tr>
32973255
<td><code>double(x[, precision])</code></td>
3298-
<td>Prints x as a decimal number with precision decimal places (default: 5), where x can be any math statement. Affected by the <a href="#math-round">math round</a> setting.</td>
3256+
<td>Prints x as a decimal number with precision decimal places (default: 5), where x can be any math statement.</td>
32993257
</tr>
33003258
<tr>
33013259
<td><code>pc</code></td>

0 commit comments

Comments
 (0)