Introduce command PRINTI to print integers

PRINTV prints integers in hexadecimal, PRINTI prints them in signed
decimal. For example:

    PRINTT "Error at line "
    PRINTI __LINE__
    PRINTT "\n"

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2018-02-23 00:16:30 +00:00
parent 3623638be7
commit d243bd04ef
4 changed files with 28 additions and 10 deletions

View File

@@ -791,17 +791,20 @@ These three instructions type text and values to stdout. Useful for debugging
<div class="Bd" style="margin-left: 5.00ex;">
<pre class="Li">
PRINTT &quot;I'm the greatest programmer in the whole wide world\n&quot;
PRINTV (2+3)/5
PRINTF MUL(3.14,3987.0)
PRINTI (2 + 3) / 5
PRINTV $FF00 + $F0
PRINTF MUL(3.14, 3987.0)
</pre>
</div>
<dl class="Bl-inset">
<dt class="It-inset"><a class="selflink" href="#PRINTT"><b class="Ic" title="Ic" id="PRINTT">PRINTT</b></a></dt>
<dd class="It-inset">prints out a string.</dd>
<dt class="It-inset"><a class="selflink" href="#PRINTV"><b class="Ic" title="Ic" id="PRINTV">PRINTV</b></a></dt>
<dd class="It-inset">prints out an integer value or, as in the example, the
result of a calculation. Unsurprisingly, you can also print out a constant
symbols value.</dd>
<dd class="It-inset">prints out an integer value in hexadecimal or, as in the
example, the result of a calculation. Unsurprisingly, you can also print
out a constant symbols value.</dd>
<dt class="It-inset"><a class="selflink" href="#PRINTI"><b class="Ic" title="Ic" id="PRINTI">PRINTI</b></a></dt>
<dd class="It-inset">prints out a signed integer value.</dd>
<dt class="It-inset"><a class="selflink" href="#PRINTF"><b class="Ic" title="Ic" id="PRINTF">PRINTF</b></a></dt>
<dd class="It-inset">prints out a fixed point value.</dd>
</dl>
@@ -1377,6 +1380,8 @@ The options that OPT can modify are currently: <b class="Sy" title="Sy">b</b>,
<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>