This commit is contained in:
Kartik K. Agaram 2021-07-16 08:38:43 -07:00
parent 44d26b77c4
commit 78357b8852
241 changed files with 18714 additions and 9394 deletions

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 101screen.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,14 +16,14 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -67,7 +67,7 @@ if ('onhashchange' in window) {
<span id="L10" class="LineNr">10 </span> 55/push-ebp
<span id="L11" class="LineNr">11 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L12" class="LineNr">12 </span> <span class="subxComment">#</span>
<span id="L13" class="LineNr">13 </span> (<a href='101screen.subx.html#L21'>pixel-on-screen-buffer</a> *<span class="SpecialChar"><a href='boot.subx.html#L650'>Video-memory-addr</a></span> *(ebp+8) *(ebp+0xc) *(ebp+0x10) 0x400 0x300)
<span id="L13" class="LineNr">13 </span> (<a href='101screen.subx.html#L21'>pixel-on-screen-buffer</a> *<span class="SpecialChar"><a href='boot.subx.html#L651'>Video-memory-addr</a></span> *(ebp+8) *(ebp+0xc) *(ebp+0x10) 0x400 0x300)
<span id="L14" class="LineNr">14 </span><span class="Constant">$pixel-on-real-screen:end</span>:
<span id="L15" class="LineNr">15 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L16" class="LineNr">16 </span> 89/&lt;- %esp 5/r32/ebp

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 102keyboard.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,14 +16,14 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 103grapheme.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,14 +16,14 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -76,7 +76,7 @@ if ('onhashchange' in window) {
<span id="L19" class="LineNr"> 19 </span> 55/push-ebp
<span id="L20" class="LineNr"> 20 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L21" class="LineNr"> 21 </span> <span class="subxComment">#</span>
<span id="L22" class="LineNr"> 22 </span> (<a href='103grapheme.subx.html#L74'>draw-grapheme-on-screen-buffer</a> *<span class="SpecialChar"><a href='boot.subx.html#L650'>Video-memory-addr</a></span> *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) 0x80 0x30)
<span id="L22" class="LineNr"> 22 </span> (<a href='103grapheme.subx.html#L74'>draw-grapheme-on-screen-buffer</a> *<span class="SpecialChar"><a href='boot.subx.html#L651'>Video-memory-addr</a></span> *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) 0x80 0x30)
<span id="L23" class="LineNr"> 23 </span><span class="Constant">$draw-grapheme-on-real-screen:end</span>:
<span id="L24" class="LineNr"> 24 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L25" class="LineNr"> 25 </span> 89/&lt;- %esp 5/r32/ebp
@ -148,7 +148,7 @@ if ('onhashchange' in window) {
<span id="L91" class="LineNr"> 91 </span> 0f 8d/jump-if-&gt;= $draw-grapheme-on-screen-buffer:end/disp32
<span id="L92" class="LineNr"> 92 </span> <span class="subxComment"># var letter-bitmap/esi = font[g]</span>
<span id="L93" class="LineNr"> 93 </span> c1 4/subop/shift-left %esi 4/imm8
<span id="L94" class="LineNr"> 94 </span> 81 0/subop/add %esi <span class="SpecialChar"><a href='boot.subx.html#L671'>Font</a></span>/imm32
<span id="L94" class="LineNr"> 94 </span> 81 0/subop/add %esi <span class="SpecialChar"><a href='boot.subx.html#L672'>Font</a></span>/imm32
<span id="L95" class="LineNr"> 95 </span> <span class="subxComment"># var ycurr/edx: int = y*16</span>
<span id="L96" class="LineNr"> 96 </span> 8b/-&gt; *(ebp+0x14) 2/r32/edx
<span id="L97" class="LineNr"> 97 </span> c1 4/subop/shift-left %edx 4/imm8

18
html/104test.subx.html generated
View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 104test.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,14 +16,14 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 105string-equal.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,16 +17,16 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 106stream.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 108write.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,16 +17,16 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 109stream-equal.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 112read-byte.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxMinorFunction { color: #875f5f; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -106,12 +106,12 @@ if ('onhashchange' in window) {
<span id="L47" class="LineNr"> 47 </span><span class="subxMinorFunction">_test-input-stream</span>: <span class="subxComment"># (stream byte)</span>
<span id="L48" class="LineNr"> 48 </span> <span class="subxComment"># current write index</span>
<span id="L49" class="LineNr"> 49 </span> 0/imm32
<span id="L50" class="LineNr"> 50 </span> <span class="subxComment"># current read index</span>
<span id="L51" class="LineNr"> 51 </span> 0/imm32
<span id="L52" class="LineNr"> 52 </span> <span class="subxComment"># size</span>
<span id="L53" class="LineNr"> 53 </span> 0x400/imm32 <span class="subxComment"># 1024 bytes</span>
<span id="L54" class="LineNr"> 54 </span> <span class="subxComment"># data (64 lines x 16 bytes/line)</span>
<span id="L55" class="LineNr"> 55 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L50" class="LineNr"> 50 </span><span class="Constant">$_test-input-stream-&gt;read</span>:
<span id="L51" class="LineNr"> 51 </span> <span class="subxComment"># current read index</span>
<span id="L52" class="LineNr"> 52 </span> 0/imm32
<span id="L53" class="LineNr"> 53 </span> <span class="subxComment"># size</span>
<span id="L54" class="LineNr"> 54 </span> 0x400/imm32 <span class="subxComment"># 1024 bytes</span>
<span id="L55" class="LineNr"> 55 </span> <span class="subxComment"># data (64 lines x 16 bytes/line)</span>
<span id="L56" class="LineNr"> 56 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L57" class="LineNr"> 57 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L58" class="LineNr"> 58 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
@ -175,8 +175,9 @@ if ('onhashchange' in window) {
<span id="L116" class="LineNr">116 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L117" class="LineNr">117 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L118" class="LineNr">118 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L119" class="LineNr">119 </span>
<span id="L120" class="LineNr">120 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L119" class="LineNr">119 </span> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<span id="L120" class="LineNr">120 </span>
<span id="L121" class="LineNr">121 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 113write-stream.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,16 +17,16 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -123,7 +123,7 @@ if ('onhashchange' in window) {
<span id="L63" class="LineNr"> 63 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L64" class="LineNr"> 64 </span> <span class="subxS1Comment"># . clear-stream(_test-stream2)</span>
<span id="L65" class="LineNr"> 65 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L66" class="LineNr"> 66 </span> 68/push <a href='113write-stream.subx.html#L163'>_test-stream2</a>/imm32
<span id="L66" class="LineNr"> 66 </span> 68/push <a href='113write-stream.subx.html#L210'>_test-stream2</a>/imm32
<span id="L67" class="LineNr"> 67 </span> <span class="subxS2Comment"># . . call</span>
<span id="L68" class="LineNr"> 68 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L69" class="LineNr"> 69 </span> <span class="subxS2Comment"># . . discard args</span>
@ -131,14 +131,14 @@ if ('onhashchange' in window) {
<span id="L71" class="LineNr"> 71 </span> <span class="subxS1Comment"># . write(_test-stream2, &quot;Ab&quot;)</span>
<span id="L72" class="LineNr"> 72 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L73" class="LineNr"> 73 </span> 68/push <span class="Constant">&quot;Ab&quot;</span>/imm32
<span id="L74" class="LineNr"> 74 </span> 68/push <a href='113write-stream.subx.html#L163'>_test-stream2</a>/imm32
<span id="L74" class="LineNr"> 74 </span> 68/push <a href='113write-stream.subx.html#L210'>_test-stream2</a>/imm32
<span id="L75" class="LineNr"> 75 </span> <span class="subxS2Comment"># . . call</span>
<span id="L76" class="LineNr"> 76 </span> e8/call <a href='108write.subx.html#L11'>write</a>/disp32
<span id="L77" class="LineNr"> 77 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L78" class="LineNr"> 78 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
<span id="L79" class="LineNr"> 79 </span> <span class="subxComment"># write-stream(_test-stream, _test-stream2)</span>
<span id="L80" class="LineNr"> 80 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L81" class="LineNr"> 81 </span> 68/push <a href='113write-stream.subx.html#L163'>_test-stream2</a>/imm32
<span id="L81" class="LineNr"> 81 </span> 68/push <a href='113write-stream.subx.html#L210'>_test-stream2</a>/imm32
<span id="L82" class="LineNr"> 82 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L83" class="LineNr"> 83 </span> <span class="subxS2Comment"># . . call</span>
<span id="L84" class="LineNr"> 84 </span> e8/call <a href='113write-stream.subx.html#L8'>write-stream</a>/disp32
@ -167,7 +167,7 @@ if ('onhashchange' in window) {
<span id="L107" class="LineNr">107 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L108" class="LineNr">108 </span> <span class="subxS1Comment"># . clear-stream(_test-stream2)</span>
<span id="L109" class="LineNr">109 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L110" class="LineNr">110 </span> 68/push <a href='113write-stream.subx.html#L163'>_test-stream2</a>/imm32
<span id="L110" class="LineNr">110 </span> 68/push <a href='113write-stream.subx.html#L210'>_test-stream2</a>/imm32
<span id="L111" class="LineNr">111 </span> <span class="subxS2Comment"># . . call</span>
<span id="L112" class="LineNr">112 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L113" class="LineNr">113 </span> <span class="subxS2Comment"># . . discard args</span>
@ -175,7 +175,7 @@ if ('onhashchange' in window) {
<span id="L115" class="LineNr">115 </span> <span class="subxS1Comment"># . write(_test-stream2, &quot;C&quot;)</span>
<span id="L116" class="LineNr">116 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L117" class="LineNr">117 </span> 68/push <span class="Constant">&quot;C&quot;</span>/imm32
<span id="L118" class="LineNr">118 </span> 68/push <a href='113write-stream.subx.html#L163'>_test-stream2</a>/imm32
<span id="L118" class="LineNr">118 </span> 68/push <a href='113write-stream.subx.html#L210'>_test-stream2</a>/imm32
<span id="L119" class="LineNr">119 </span> <span class="subxS2Comment"># . . call</span>
<span id="L120" class="LineNr">120 </span> e8/call <a href='108write.subx.html#L11'>write</a>/disp32
<span id="L121" class="LineNr">121 </span> <span class="subxS2Comment"># . . discard args</span>
@ -183,7 +183,7 @@ if ('onhashchange' in window) {
<span id="L123" class="LineNr">123 </span> <span class="subxComment"># first write</span>
<span id="L124" class="LineNr">124 </span> <span class="subxS1Comment"># . write-stream(_test-stream, _test-stream2)</span>
<span id="L125" class="LineNr">125 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L126" class="LineNr">126 </span> 68/push <a href='113write-stream.subx.html#L163'>_test-stream2</a>/imm32
<span id="L126" class="LineNr">126 </span> 68/push <a href='113write-stream.subx.html#L210'>_test-stream2</a>/imm32
<span id="L127" class="LineNr">127 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L128" class="LineNr">128 </span> <span class="subxS2Comment"># . . call</span>
<span id="L129" class="LineNr">129 </span> e8/call <a href='113write-stream.subx.html#L8'>write-stream</a>/disp32
@ -193,14 +193,14 @@ if ('onhashchange' in window) {
<span id="L133" class="LineNr">133 </span> <span class="subxS1Comment"># . write(_test-stream2, &quot;D&quot;)</span>
<span id="L134" class="LineNr">134 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L135" class="LineNr">135 </span> 68/push <span class="Constant">&quot;D&quot;</span>/imm32
<span id="L136" class="LineNr">136 </span> 68/push <a href='113write-stream.subx.html#L163'>_test-stream2</a>/imm32
<span id="L136" class="LineNr">136 </span> 68/push <a href='113write-stream.subx.html#L210'>_test-stream2</a>/imm32
<span id="L137" class="LineNr">137 </span> <span class="subxS2Comment"># . . call</span>
<span id="L138" class="LineNr">138 </span> e8/call <a href='108write.subx.html#L11'>write</a>/disp32
<span id="L139" class="LineNr">139 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L140" class="LineNr">140 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
<span id="L141" class="LineNr">141 </span> <span class="subxS1Comment"># . write-stream(_test-stream, _test-stream2)</span>
<span id="L142" class="LineNr">142 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L143" class="LineNr">143 </span> 68/push <a href='113write-stream.subx.html#L163'>_test-stream2</a>/imm32
<span id="L143" class="LineNr">143 </span> 68/push <a href='113write-stream.subx.html#L210'>_test-stream2</a>/imm32
<span id="L144" class="LineNr">144 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L145" class="LineNr">145 </span> <span class="subxS2Comment"># . . call</span>
<span id="L146" class="LineNr">146 </span> e8/call <a href='113write-stream.subx.html#L8'>write-stream</a>/disp32
@ -218,19 +218,66 @@ if ('onhashchange' in window) {
<span id="L158" class="LineNr">158 </span> <span class="subxS1Comment"># . end</span>
<span id="L159" class="LineNr">159 </span> c3/return
<span id="L160" class="LineNr">160 </span>
<span id="L161" class="LineNr">161 </span>== data
<span id="L162" class="LineNr">162 </span>
<span id="L163" class="LineNr">163 </span><span class="subxMinorFunction">_test-stream2</span>: <span class="subxComment"># (stream byte)</span>
<span id="L164" class="LineNr">164 </span> <span class="subxComment"># current write index</span>
<span id="L165" class="LineNr">165 </span> 4/imm32
<span id="L166" class="LineNr">166 </span> <span class="subxComment"># current read index</span>
<span id="L167" class="LineNr">167 </span> 1/imm32
<span id="L168" class="LineNr">168 </span> <span class="subxComment"># size</span>
<span id="L169" class="LineNr">169 </span> 8/imm32
<span id="L170" class="LineNr">170 </span> <span class="subxComment"># data</span>
<span id="L171" class="LineNr">171 </span> 41/A 42/B 43/C 44/D 00 00 00 00 <span class="subxComment"># 8 bytes</span>
<span id="L172" class="LineNr">172 </span>
<span id="L173" class="LineNr">173 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L161" class="LineNr">161 </span><span class="subxComment"># like write-stream, but don't update s-&gt;read</span>
<span id="L162" class="LineNr">162 </span><span class="subxComment"># is there a better name for this?</span>
<span id="L163" class="LineNr">163 </span><span class="subxFunction">write-stream-immutable</span>: <span class="subxComment"># f: (addr stream byte), s: (addr stream byte)</span>
<span id="L164" class="LineNr">164 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L165" class="LineNr">165 </span> 55/push-ebp
<span id="L166" class="LineNr">166 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span>
<span id="L167" class="LineNr">167 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L168" class="LineNr">168 </span> 50/push-eax
<span id="L169" class="LineNr">169 </span> 56/push-esi
<span id="L170" class="LineNr">170 </span> 57/push-edi
<span id="L171" class="LineNr">171 </span> <span class="subxComment"># edi = f</span>
<span id="L172" class="LineNr">172 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 7/r32/edi 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to edi</span>
<span id="L173" class="LineNr">173 </span> <span class="subxComment"># esi = s</span>
<span id="L174" class="LineNr">174 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> 6/r32/esi 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+12) to esi</span>
<span id="L175" class="LineNr">175 </span> <span class="subxComment"># eax = _append-4(&amp;f-&gt;data[f-&gt;write], &amp;f-&gt;data[f-&gt;size], &amp;s-&gt;data[s-&gt;read], &amp;s-&gt;data[s-&gt;write])</span>
<span id="L176" class="LineNr">176 </span> <span class="subxS2Comment"># . . push &amp;s-&gt;data[s-&gt;write]</span>
<span id="L177" class="LineNr">177 </span> 8b/copy 0/mod/indirect 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *esi to eax</span>
<span id="L178" class="LineNr">178 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+eax+12 to eax</span>
<span id="L179" class="LineNr">179 </span> 50/push-eax
<span id="L180" class="LineNr">180 </span> <span class="subxS2Comment"># . . push &amp;s-&gt;data[s-&gt;read]</span>
<span id="L181" class="LineNr">181 </span> 8b/copy 1/mod/*+disp8 6/rm32/esi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(esi+4) to eax</span>
<span id="L182" class="LineNr">182 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy esi+eax+12 to eax</span>
<span id="L183" class="LineNr">183 </span> 50/push-eax
<span id="L184" class="LineNr">184 </span> <span class="subxS2Comment"># . . push &amp;f-&gt;data[f-&gt;size]</span>
<span id="L185" class="LineNr">185 </span> 8b/copy 1/mod/*+disp8 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(edi+8) to eax</span>
<span id="L186" class="LineNr">186 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/edi 0/index/eax <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy edi+eax+12 to eax</span>
<span id="L187" class="LineNr">187 </span> 50/push-eax
<span id="L188" class="LineNr">188 </span> <span class="subxS2Comment"># . . push &amp;f-&gt;data[f-&gt;write]</span>
<span id="L189" class="LineNr">189 </span> 8b/copy 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *edi to eax</span>
<span id="L190" class="LineNr">190 </span> 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/edi 0/index/eax <span class="Normal"> . </span> 0/r32/eax 0xc/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy edi+eax+12 to eax</span>
<span id="L191" class="LineNr">191 </span> 50/push-eax
<span id="L192" class="LineNr">192 </span> <span class="subxS2Comment"># . . call</span>
<span id="L193" class="LineNr">193 </span> e8/call <a href='108write.subx.html#L257'>_append-4</a>/disp32
<span id="L194" class="LineNr">194 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L195" class="LineNr">195 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x10/imm32 <span class="subxComment"># add to esp</span>
<span id="L196" class="LineNr">196 </span> <span class="subxComment"># f-&gt;write += eax</span>
<span id="L197" class="LineNr">197 </span> 01/add 0/mod/indirect 7/rm32/edi <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># add eax to *edi</span>
<span id="L198" class="LineNr">198 </span><span class="Constant">$write-stream-immutable:end</span>:
<span id="L199" class="LineNr">199 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L200" class="LineNr">200 </span> 5f/pop-to-edi
<span id="L201" class="LineNr">201 </span> 5e/pop-to-esi
<span id="L202" class="LineNr">202 </span> 58/pop-to-eax
<span id="L203" class="LineNr">203 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L204" class="LineNr">204 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span>
<span id="L205" class="LineNr">205 </span> 5d/pop-to-ebp
<span id="L206" class="LineNr">206 </span> c3/return
<span id="L207" class="LineNr">207 </span>
<span id="L208" class="LineNr">208 </span>== data
<span id="L209" class="LineNr">209 </span>
<span id="L210" class="LineNr">210 </span><span class="subxMinorFunction">_test-stream2</span>: <span class="subxComment"># (stream byte)</span>
<span id="L211" class="LineNr">211 </span> <span class="subxComment"># current write index</span>
<span id="L212" class="LineNr">212 </span> 4/imm32
<span id="L213" class="LineNr">213 </span> <span class="subxComment"># current read index</span>
<span id="L214" class="LineNr">214 </span> 1/imm32
<span id="L215" class="LineNr">215 </span> <span class="subxComment"># size</span>
<span id="L216" class="LineNr">216 </span> 8/imm32
<span id="L217" class="LineNr">217 </span> <span class="subxComment"># data</span>
<span id="L218" class="LineNr">218 </span> 41/A 42/B 43/C 44/D 00 00 00 00 <span class="subxComment"># 8 bytes</span>
<span id="L219" class="LineNr">219 </span>
<span id="L220" class="LineNr">220 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 115write-byte.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,16 +17,16 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 117write-int-hex.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,16 +17,16 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Constant { color: #008787; }
.subxS1Comment { color: #0000af; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.Constant { color: #008787; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 118parse-hex-int.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,33 +1,33 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 120allocate.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS2Comment { color: #8a8a8a; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 121new-stream.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 123slice.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,17 +17,17 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.Folded { color: #080808; background-color: #949494; }
.Constant { color: #008787; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -1071,7 +1071,7 @@ if ('onhashchange' in window) {
<span id="L1010" class="LineNr">1010 </span> 8b/copy 1/mod/*+disp8 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebx+4) to eax</span>
<span id="L1011" class="LineNr">1011 </span> <span class="subxComment"># skip payload-&gt;allocid</span>
<span id="L1012" class="LineNr">1012 </span> 05/add-to-eax 4/imm32
<span id="L1013" class="Folded">1013 </span><span class="Folded">+-- 26 lines: #? # dump eax ---------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1013" class="Folded">1013 </span><span class="Folded">+-- 26 lines: #? # dump eax --------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1039" class="LineNr">1039 </span> <span class="subxComment"># eax = string-equal?(eax, &quot;Abc&quot;)</span>
<span id="L1040" class="LineNr">1040 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L1041" class="LineNr">1041 </span> 68/push <span class="Constant">&quot;Abc&quot;</span>/imm32

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 124next-token.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 126write-int-decimal.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,17 +17,17 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.Folded { color: #080808; background-color: #949494; }
.Constant { color: #008787; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -286,7 +286,7 @@ if ('onhashchange' in window) {
<span id="L225" class="LineNr">225 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L226" class="LineNr">226 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L227" class="LineNr">227 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
<span id="L228" class="Folded">228 </span><span class="Folded">+-- 26 lines: #? # dump _test-stream ------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L228" class="Folded">228 </span><span class="Folded">+-- 26 lines: #? # dump _test-stream -----------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L254" class="LineNr">254 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;-9&quot;, msg)</span>
<span id="L255" class="LineNr">255 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L256" class="LineNr">256 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-negative&quot;</span>/imm32
@ -299,163 +299,194 @@ if ('onhashchange' in window) {
<span id="L263" class="LineNr">263 </span> <span class="subxS1Comment"># . end</span>
<span id="L264" class="LineNr">264 </span> c3/return
<span id="L265" class="LineNr">265 </span>
<span id="L266" class="LineNr">266 </span><span class="subxTest">test-write-int32-decimal-negative-multiple-digits</span>:
<span id="L267" class="LineNr">267 </span> <span class="subxH1Comment"># - check that a multi-digit number converts correctly</span>
<span id="L268" class="LineNr">268 </span> <span class="subxComment"># setup</span>
<span id="L269" class="LineNr">269 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L270" class="LineNr">270 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L271" class="LineNr">271 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L272" class="LineNr">272 </span> <span class="subxS2Comment"># . . call</span>
<span id="L273" class="LineNr">273 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L274" class="LineNr">274 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L275" class="LineNr">275 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L276" class="LineNr">276 </span> <span class="subxComment"># write-int32-decimal(_test-stream, -10)</span>
<span id="L277" class="LineNr">277 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L278" class="LineNr">278 </span> 68/push -0xa/imm32
<span id="L279" class="LineNr">279 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L280" class="LineNr">280 </span> <span class="subxS2Comment"># . . call</span>
<span id="L281" class="LineNr">281 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L282" class="LineNr">282 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L283" class="LineNr">283 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
<span id="L284" class="LineNr">284 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;-10&quot;, msg)</span>
<span id="L285" class="LineNr">285 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L286" class="LineNr">286 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-negative-multiple-digits&quot;</span>/imm32
<span id="L287" class="LineNr">287 </span> 68/push <span class="Constant">&quot;-10&quot;</span>/imm32
<span id="L288" class="LineNr">288 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L289" class="LineNr">289 </span> <span class="subxS2Comment"># . . call</span>
<span id="L290" class="LineNr">290 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L291" class="LineNr">291 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L292" class="LineNr">292 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L293" class="LineNr">293 </span> <span class="subxS1Comment"># . end</span>
<span id="L294" class="LineNr">294 </span> c3/return
<span id="L295" class="LineNr">295 </span>
<span id="L296" class="LineNr">296 </span><span class="subxFunction">decimal-digit?</span>: <span class="subxComment"># c: grapheme -&gt; result/eax: boolean</span>
<span id="L297" class="LineNr">297 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L298" class="LineNr">298 </span> 55/push-ebp
<span id="L299" class="LineNr">299 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span>
<span id="L300" class="LineNr">300 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L301" class="LineNr">301 </span> 51/push-ecx
<span id="L302" class="LineNr">302 </span> <span class="subxComment"># ecx = c</span>
<span id="L303" class="LineNr">303 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ecx</span>
<span id="L304" class="LineNr">304 </span> <span class="subxComment"># result = false</span>
<span id="L305" class="LineNr">305 </span> b8/copy-to-eax 0/imm32/false
<span id="L306" class="LineNr">306 </span> <span class="subxComment"># return false if c &lt; '0'</span>
<span id="L307" class="LineNr">307 </span> 81 7/subop/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x30/imm32 <span class="subxComment"># compare ecx</span>
<span id="L308" class="LineNr">308 </span> 7c/jump-if-&lt; $decimal-digit?:end/disp8
<span id="L309" class="LineNr">309 </span> <span class="subxComment"># return (c &lt;= '9')</span>
<span id="L310" class="LineNr">310 </span> 81 7/subop/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x39/imm32 <span class="subxComment"># compare ecx</span>
<span id="L311" class="LineNr">311 </span> 7f/jump-if-&gt; $decimal-digit?:end/disp8
<span id="L312" class="LineNr">312 </span><span class="Constant">$decimal-digit?:true</span>:
<span id="L313" class="LineNr">313 </span> b8/copy-to-eax 1/imm32/true
<span id="L314" class="LineNr">314 </span><span class="Constant">$decimal-digit?:end</span>:
<span id="L315" class="LineNr">315 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L316" class="LineNr">316 </span> 59/pop-to-ecx
<span id="L317" class="LineNr">317 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L318" class="LineNr">318 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span>
<span id="L319" class="LineNr">319 </span> 5d/pop-to-ebp
<span id="L320" class="LineNr">320 </span> c3/return
<span id="L321" class="LineNr">321 </span>
<span id="L322" class="LineNr">322 </span><span class="subxTest">test-decimal-digit-below-0</span>:
<span id="L323" class="LineNr">323 </span> <span class="subxComment"># eax = decimal-digit?(0x2f)</span>
<span id="L324" class="LineNr">324 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L325" class="LineNr">325 </span> 68/push 0x2f/imm32
<span id="L326" class="LineNr">326 </span> <span class="subxS2Comment"># . . call</span>
<span id="L327" class="LineNr">327 </span> e8/call <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a>/disp32
<span id="L328" class="LineNr">328 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L329" class="LineNr">329 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L330" class="LineNr">330 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span>
<span id="L331" class="LineNr">331 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L332" class="LineNr">332 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-below-0&quot;</span>/imm32
<span id="L333" class="LineNr">333 </span> 68/push 0/imm32/false
<span id="L334" class="LineNr">334 </span> 50/push-eax
<span id="L335" class="LineNr">335 </span> <span class="subxS2Comment"># . . call</span>
<span id="L336" class="LineNr">336 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L337" class="LineNr">337 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L338" class="LineNr">338 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L339" class="LineNr">339 </span> c3/return
<span id="L340" class="LineNr">340 </span>
<span id="L341" class="LineNr">341 </span><span class="subxTest">test-decimal-digit-0-to-9</span>:
<span id="L342" class="LineNr">342 </span> <span class="subxComment"># eax = decimal-digit?(0x30)</span>
<span id="L343" class="LineNr">343 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L344" class="LineNr">344 </span> 68/push 0x30/imm32
<span id="L345" class="LineNr">345 </span> <span class="subxS2Comment"># . . call</span>
<span id="L346" class="LineNr">346 </span> e8/call <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a>/disp32
<span id="L347" class="LineNr">347 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L348" class="LineNr">348 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L349" class="LineNr">349 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L350" class="LineNr">350 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L351" class="LineNr">351 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-at-0&quot;</span>/imm32
<span id="L352" class="LineNr">352 </span> 68/push 1/imm32/true
<span id="L353" class="LineNr">353 </span> 50/push-eax
<span id="L354" class="LineNr">354 </span> <span class="subxS2Comment"># . . call</span>
<span id="L355" class="LineNr">355 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L356" class="LineNr">356 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L357" class="LineNr">357 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L358" class="LineNr">358 </span> <span class="subxComment"># eax = decimal-digit?(0x39)</span>
<span id="L359" class="LineNr">359 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L360" class="LineNr">360 </span> 68/push 0x39/imm32
<span id="L361" class="LineNr">361 </span> <span class="subxS2Comment"># . . call</span>
<span id="L362" class="LineNr">362 </span> e8/call <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a>/disp32
<span id="L363" class="LineNr">363 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L364" class="LineNr">364 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L365" class="LineNr">365 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L366" class="LineNr">366 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L367" class="LineNr">367 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-at-9&quot;</span>/imm32
<span id="L368" class="LineNr">368 </span> 68/push 1/imm32/true
<span id="L369" class="LineNr">369 </span> 50/push-eax
<span id="L370" class="LineNr">370 </span> <span class="subxS2Comment"># . . call</span>
<span id="L371" class="LineNr">371 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L372" class="LineNr">372 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L373" class="LineNr">373 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L374" class="LineNr">374 </span> c3/return
<span id="L375" class="LineNr">375 </span>
<span id="L376" class="LineNr">376 </span><span class="subxTest">test-decimal-digit-above-9</span>:
<span id="L377" class="LineNr">377 </span> <span class="subxComment"># eax = decimal-digit?(0x3a)</span>
<span id="L378" class="LineNr">378 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L379" class="LineNr">379 </span> 68/push 0x3a/imm32
<span id="L380" class="LineNr">380 </span> <span class="subxS2Comment"># . . call</span>
<span id="L381" class="LineNr">381 </span> e8/call <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a>/disp32
<span id="L382" class="LineNr">382 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L383" class="LineNr">383 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L384" class="LineNr">384 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span>
<span id="L385" class="LineNr">385 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L386" class="LineNr">386 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-above-9&quot;</span>/imm32
<span id="L387" class="LineNr">387 </span> 68/push 0/imm32/false
<span id="L388" class="LineNr">388 </span> 50/push-eax
<span id="L389" class="LineNr">389 </span> <span class="subxS2Comment"># . . call</span>
<span id="L390" class="LineNr">390 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L391" class="LineNr">391 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L392" class="LineNr">392 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L393" class="LineNr">393 </span> c3/return
<span id="L394" class="LineNr">394 </span>
<span id="L395" class="LineNr">395 </span><span class="subxFunction">to-decimal-digit</span>: <span class="subxComment"># in: grapheme -&gt; out/eax: int</span>
<span id="L396" class="LineNr">396 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L397" class="LineNr">397 </span> 55/push-ebp
<span id="L398" class="LineNr">398 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span>
<span id="L399" class="LineNr">399 </span> <span class="subxComment"># eax = in</span>
<span id="L400" class="LineNr">400 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to eax</span>
<span id="L401" class="LineNr">401 </span><span class="Constant">$to-decimal-digit:check0</span>:
<span id="L402" class="LineNr">402 </span> <span class="subxComment"># if (eax &lt; '0') goto abort</span>
<span id="L403" class="LineNr">403 </span> 3d/compare-eax-with 0x30/imm32/0
<span id="L404" class="LineNr">404 </span> 7c/jump-if-&lt; $to-decimal-digit:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L405" class="LineNr">405 </span><span class="Constant">$to-decimal-digit:check1</span>:
<span id="L406" class="LineNr">406 </span> <span class="subxComment"># if (eax &gt; '9') goto abort</span>
<span id="L407" class="LineNr">407 </span> 3d/compare-eax-with 0x39/imm32/f
<span id="L408" class="LineNr">408 </span> 7f/jump-if-&gt; $to-decimal-digit:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L409" class="LineNr">409 </span><span class="Constant">$to-decimal-digit:digit</span>:
<span id="L410" class="LineNr">410 </span> <span class="subxComment"># return eax - '0'</span>
<span id="L411" class="LineNr">411 </span> 2d/subtract-from-eax 0x30/imm32/0
<span id="L412" class="LineNr">412 </span><span class="Constant">$to-decimal-digit:end</span>:
<span id="L413" class="LineNr">413 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L414" class="LineNr">414 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span>
<span id="L415" class="LineNr">415 </span> 5d/pop-to-ebp
<span id="L416" class="LineNr">416 </span> c3/return
<span id="L417" class="LineNr">417 </span>
<span id="L418" class="LineNr">418 </span><span class="Constant">$to-decimal-digit:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L419" class="LineNr">419 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;to-decimal-digit: not a digit character&quot;</span>)
<span id="L420" class="LineNr">420 </span> <span class="subxComment"># never gets here</span>
<span id="L421" class="LineNr">421 </span>
<span id="L422" class="LineNr">422 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
<span id="L266" class="LineNr">266 </span><span class="subxComment"># There's a special bit pattern that corresponds to no 2's complement integer.</span>
<span id="L267" class="LineNr">267 </span><span class="subxComment"># There doesn't seem to be a widespread convention for representing it.</span>
<span id="L268" class="LineNr">268 </span><span class="subxTest">test-write-int32-decimal-indefinite-integer</span>:
<span id="L269" class="LineNr">269 </span> <span class="subxComment"># setup</span>
<span id="L270" class="LineNr">270 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L271" class="LineNr">271 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L272" class="LineNr">272 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L273" class="LineNr">273 </span> <span class="subxS2Comment"># . . call</span>
<span id="L274" class="LineNr">274 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L275" class="LineNr">275 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L276" class="LineNr">276 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L277" class="LineNr">277 </span> <span class="subxComment"># write-int32-decimal(_test-stream, 0x80000000)</span>
<span id="L278" class="LineNr">278 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L279" class="LineNr">279 </span> 68/push 0x80000000/imm32
<span id="L280" class="LineNr">280 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L281" class="LineNr">281 </span> <span class="subxS2Comment"># . . call</span>
<span id="L282" class="LineNr">282 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L283" class="LineNr">283 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L284" class="LineNr">284 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
<span id="L285" class="LineNr">285 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;-(&quot;, msg)</span>
<span id="L286" class="LineNr">286 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L287" class="LineNr">287 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-indefinite-integer&quot;</span>/imm32
<span id="L288" class="LineNr">288 </span> 68/push <span class="Constant">&quot;-(&quot;</span>/imm32
<span id="L289" class="LineNr">289 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L290" class="LineNr">290 </span> <span class="subxS2Comment"># . . call</span>
<span id="L291" class="LineNr">291 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L292" class="LineNr">292 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L293" class="LineNr">293 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L294" class="LineNr">294 </span> <span class="subxS1Comment"># . end</span>
<span id="L295" class="LineNr">295 </span> c3/return
<span id="L296" class="LineNr">296 </span>
<span id="L297" class="LineNr">297 </span><span class="subxTest">test-write-int32-decimal-negative-multiple-digits</span>:
<span id="L298" class="LineNr">298 </span> <span class="subxH1Comment"># - check that a multi-digit number converts correctly</span>
<span id="L299" class="LineNr">299 </span> <span class="subxComment"># setup</span>
<span id="L300" class="LineNr">300 </span> <span class="subxS1Comment"># . clear-stream(_test-stream)</span>
<span id="L301" class="LineNr">301 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L302" class="LineNr">302 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L303" class="LineNr">303 </span> <span class="subxS2Comment"># . . call</span>
<span id="L304" class="LineNr">304 </span> e8/call <a href='106stream.subx.html#L20'>clear-stream</a>/disp32
<span id="L305" class="LineNr">305 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L306" class="LineNr">306 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L307" class="LineNr">307 </span> <span class="subxComment"># write-int32-decimal(_test-stream, -10)</span>
<span id="L308" class="LineNr">308 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L309" class="LineNr">309 </span> 68/push -0xa/imm32
<span id="L310" class="LineNr">310 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L311" class="LineNr">311 </span> <span class="subxS2Comment"># . . call</span>
<span id="L312" class="LineNr">312 </span> e8/call <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a>/disp32
<span id="L313" class="LineNr">313 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L314" class="LineNr">314 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span>
<span id="L315" class="LineNr">315 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;-10&quot;, msg)</span>
<span id="L316" class="LineNr">316 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L317" class="LineNr">317 </span> 68/push <span class="Constant">&quot;F - test-write-int32-decimal-negative-multiple-digits&quot;</span>/imm32
<span id="L318" class="LineNr">318 </span> 68/push <span class="Constant">&quot;-10&quot;</span>/imm32
<span id="L319" class="LineNr">319 </span> 68/push <a href='108write.subx.html#L125'>_test-stream</a>/imm32
<span id="L320" class="LineNr">320 </span> <span class="subxS2Comment"># . . call</span>
<span id="L321" class="LineNr">321 </span> e8/call <a href='109stream-equal.subx.html#L194'>check-stream-equal</a>/disp32
<span id="L322" class="LineNr">322 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L323" class="LineNr">323 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L324" class="LineNr">324 </span> <span class="subxS1Comment"># . end</span>
<span id="L325" class="LineNr">325 </span> c3/return
<span id="L326" class="LineNr">326 </span>
<span id="L327" class="LineNr">327 </span><span class="subxFunction">decimal-digit?</span>: <span class="subxComment"># c: grapheme -&gt; result/eax: boolean</span>
<span id="L328" class="LineNr">328 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L329" class="LineNr">329 </span> 55/push-ebp
<span id="L330" class="LineNr">330 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span>
<span id="L331" class="LineNr">331 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L332" class="LineNr">332 </span> 51/push-ecx
<span id="L333" class="LineNr">333 </span> <span class="subxComment"># ecx = c</span>
<span id="L334" class="LineNr">334 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 1/r32/ecx 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to ecx</span>
<span id="L335" class="LineNr">335 </span> <span class="subxComment"># result = false</span>
<span id="L336" class="LineNr">336 </span> b8/copy-to-eax 0/imm32/false
<span id="L337" class="LineNr">337 </span> <span class="subxComment"># return false if c &lt; '0'</span>
<span id="L338" class="LineNr">338 </span> 81 7/subop/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x30/imm32 <span class="subxComment"># compare ecx</span>
<span id="L339" class="LineNr">339 </span> 7c/jump-if-&lt; $decimal-digit?:end/disp8
<span id="L340" class="LineNr">340 </span> <span class="subxComment"># return (c &lt;= '9')</span>
<span id="L341" class="LineNr">341 </span> 81 7/subop/compare 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x39/imm32 <span class="subxComment"># compare ecx</span>
<span id="L342" class="LineNr">342 </span> 7f/jump-if-&gt; $decimal-digit?:end/disp8
<span id="L343" class="LineNr">343 </span><span class="Constant">$decimal-digit?:true</span>:
<span id="L344" class="LineNr">344 </span> b8/copy-to-eax 1/imm32/true
<span id="L345" class="LineNr">345 </span><span class="Constant">$decimal-digit?:end</span>:
<span id="L346" class="LineNr">346 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L347" class="LineNr">347 </span> 59/pop-to-ecx
<span id="L348" class="LineNr">348 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L349" class="LineNr">349 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span>
<span id="L350" class="LineNr">350 </span> 5d/pop-to-ebp
<span id="L351" class="LineNr">351 </span> c3/return
<span id="L352" class="LineNr">352 </span>
<span id="L353" class="LineNr">353 </span><span class="subxTest">test-decimal-digit-below-0</span>:
<span id="L354" class="LineNr">354 </span> <span class="subxComment"># eax = decimal-digit?(0x2f)</span>
<span id="L355" class="LineNr">355 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L356" class="LineNr">356 </span> 68/push 0x2f/imm32
<span id="L357" class="LineNr">357 </span> <span class="subxS2Comment"># . . call</span>
<span id="L358" class="LineNr">358 </span> e8/call <a href='126write-int-decimal.subx.html#L327'>decimal-digit?</a>/disp32
<span id="L359" class="LineNr">359 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L360" class="LineNr">360 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L361" class="LineNr">361 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span>
<span id="L362" class="LineNr">362 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L363" class="LineNr">363 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-below-0&quot;</span>/imm32
<span id="L364" class="LineNr">364 </span> 68/push 0/imm32/false
<span id="L365" class="LineNr">365 </span> 50/push-eax
<span id="L366" class="LineNr">366 </span> <span class="subxS2Comment"># . . call</span>
<span id="L367" class="LineNr">367 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L368" class="LineNr">368 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L369" class="LineNr">369 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L370" class="LineNr">370 </span> c3/return
<span id="L371" class="LineNr">371 </span>
<span id="L372" class="LineNr">372 </span><span class="subxTest">test-decimal-digit-0-to-9</span>:
<span id="L373" class="LineNr">373 </span> <span class="subxComment"># eax = decimal-digit?(0x30)</span>
<span id="L374" class="LineNr">374 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L375" class="LineNr">375 </span> 68/push 0x30/imm32
<span id="L376" class="LineNr">376 </span> <span class="subxS2Comment"># . . call</span>
<span id="L377" class="LineNr">377 </span> e8/call <a href='126write-int-decimal.subx.html#L327'>decimal-digit?</a>/disp32
<span id="L378" class="LineNr">378 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L379" class="LineNr">379 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L380" class="LineNr">380 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L381" class="LineNr">381 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L382" class="LineNr">382 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-at-0&quot;</span>/imm32
<span id="L383" class="LineNr">383 </span> 68/push 1/imm32/true
<span id="L384" class="LineNr">384 </span> 50/push-eax
<span id="L385" class="LineNr">385 </span> <span class="subxS2Comment"># . . call</span>
<span id="L386" class="LineNr">386 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L387" class="LineNr">387 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L388" class="LineNr">388 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L389" class="LineNr">389 </span> <span class="subxComment"># eax = decimal-digit?(0x39)</span>
<span id="L390" class="LineNr">390 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L391" class="LineNr">391 </span> 68/push 0x39/imm32
<span id="L392" class="LineNr">392 </span> <span class="subxS2Comment"># . . call</span>
<span id="L393" class="LineNr">393 </span> e8/call <a href='126write-int-decimal.subx.html#L327'>decimal-digit?</a>/disp32
<span id="L394" class="LineNr">394 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L395" class="LineNr">395 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L396" class="LineNr">396 </span> <span class="subxComment"># check-ints-equal(eax, 1, msg)</span>
<span id="L397" class="LineNr">397 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L398" class="LineNr">398 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-at-9&quot;</span>/imm32
<span id="L399" class="LineNr">399 </span> 68/push 1/imm32/true
<span id="L400" class="LineNr">400 </span> 50/push-eax
<span id="L401" class="LineNr">401 </span> <span class="subxS2Comment"># . . call</span>
<span id="L402" class="LineNr">402 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L403" class="LineNr">403 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L404" class="LineNr">404 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L405" class="LineNr">405 </span> c3/return
<span id="L406" class="LineNr">406 </span>
<span id="L407" class="LineNr">407 </span><span class="subxTest">test-decimal-digit-above-9</span>:
<span id="L408" class="LineNr">408 </span> <span class="subxComment"># eax = decimal-digit?(0x3a)</span>
<span id="L409" class="LineNr">409 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L410" class="LineNr">410 </span> 68/push 0x3a/imm32
<span id="L411" class="LineNr">411 </span> <span class="subxS2Comment"># . . call</span>
<span id="L412" class="LineNr">412 </span> e8/call <a href='126write-int-decimal.subx.html#L327'>decimal-digit?</a>/disp32
<span id="L413" class="LineNr">413 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L414" class="LineNr">414 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L415" class="LineNr">415 </span> <span class="subxComment"># check-ints-equal(eax, 0, msg)</span>
<span id="L416" class="LineNr">416 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L417" class="LineNr">417 </span> 68/push <span class="Constant">&quot;F - test-decimal-digit-above-9&quot;</span>/imm32
<span id="L418" class="LineNr">418 </span> 68/push 0/imm32/false
<span id="L419" class="LineNr">419 </span> 50/push-eax
<span id="L420" class="LineNr">420 </span> <span class="subxS2Comment"># . . call</span>
<span id="L421" class="LineNr">421 </span> e8/call <a href='502test.mu.html#L2'>check-ints-equal</a>/disp32
<span id="L422" class="LineNr">422 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L423" class="LineNr">423 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0xc/imm32 <span class="subxComment"># add to esp</span>
<span id="L424" class="LineNr">424 </span> c3/return
<span id="L425" class="LineNr">425 </span>
<span id="L426" class="LineNr">426 </span><span class="subxFunction">to-decimal-digit</span>: <span class="subxComment"># in: grapheme -&gt; out/eax: int</span>
<span id="L427" class="LineNr">427 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L428" class="LineNr">428 </span> 55/push-ebp
<span id="L429" class="LineNr">429 </span> 89/copy 3/mod/direct 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ebp</span>
<span id="L430" class="LineNr">430 </span> <span class="subxComment"># eax = in</span>
<span id="L431" class="LineNr">431 </span> 8b/copy 1/mod/*+disp8 5/rm32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 8/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebp+8) to eax</span>
<span id="L432" class="LineNr">432 </span><span class="Constant">$to-decimal-digit:check0</span>:
<span id="L433" class="LineNr">433 </span> <span class="subxComment"># if (eax &lt; '0') goto abort</span>
<span id="L434" class="LineNr">434 </span> 3d/compare-eax-with 0x30/imm32/0
<span id="L435" class="LineNr">435 </span> 7c/jump-if-&lt; $to-decimal-digit:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L436" class="LineNr">436 </span><span class="Constant">$to-decimal-digit:check1</span>:
<span id="L437" class="LineNr">437 </span> <span class="subxComment"># if (eax &gt; '9') goto abort</span>
<span id="L438" class="LineNr">438 </span> 3d/compare-eax-with 0x39/imm32/f
<span id="L439" class="LineNr">439 </span> 7f/jump-if-&gt; $to-decimal-digit:<a href='317abort.subx.html#L5'>abort</a>/disp8
<span id="L440" class="LineNr">440 </span><span class="Constant">$to-decimal-digit:digit</span>:
<span id="L441" class="LineNr">441 </span> <span class="subxComment"># return eax - '0'</span>
<span id="L442" class="LineNr">442 </span> 2d/subtract-from-eax 0x30/imm32/0
<span id="L443" class="LineNr">443 </span><span class="Constant">$to-decimal-digit:end</span>:
<span id="L444" class="LineNr">444 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L445" class="LineNr">445 </span> 89/copy 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 5/r32/ebp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy ebp to esp</span>
<span id="L446" class="LineNr">446 </span> 5d/pop-to-ebp
<span id="L447" class="LineNr">447 </span> c3/return
<span id="L448" class="LineNr">448 </span>
<span id="L449" class="LineNr">449 </span><span class="Constant">$to-decimal-digit:<a href='317abort.subx.html#L5'>abort</a></span>:
<span id="L450" class="LineNr">450 </span> (<a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;to-decimal-digit: not a digit character&quot;</span>)
<span id="L451" class="LineNr">451 </span> <span class="subxComment"># never gets here</span>
<span id="L452" class="LineNr">452 </span>
<span id="L453" class="LineNr">453 </span><span class="subxS2Comment"># . . vim&#0058;nowrap:textwidth=0</span>
</pre>
</body>
</html>

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 127next-word.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,32 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 301array-equal.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.SpecialChar { color: #d70000; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 302stack_allocate.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,14 +16,14 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.CommentedCode { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.CommentedCode { color: #8a8a8a; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 308allocate-array.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,13 +16,13 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 309stream.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,13 +16,13 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -362,7 +362,7 @@ if ('onhashchange' in window) {
<span id="L306" class="LineNr">306 </span> <span class="subxComment">#</span>
<span id="L307" class="LineNr">307 </span> (<a href='309stream.subx.html#L211'>streams-data-equal?</a> *(ebp+8) *(ebp+0xc)) <span class="subxComment"># =&gt; eax</span>
<span id="L308" class="LineNr">308 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %eax 1 *(ebp+0x10))
<span id="L309" class="LineNr">309 </span><span class="Constant">$check-streams-equal:end</span>:
<span id="L309" class="LineNr">309 </span><span class="Constant">$check-streams-data-equal:end</span>:
<span id="L310" class="LineNr">310 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L311" class="LineNr">311 </span> 58/pop-to-eax
<span id="L312" class="LineNr">312 </span> <span class="subxS1Comment"># . epilogue</span>

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 310copy-bytes.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,15 +16,15 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -160,59 +160,63 @@ if ('onhashchange' in window) {
<span id="L102" class="LineNr">102 </span> (<a href='108write.subx.html#L11'>write</a> <a href='112read-byte.subx.html#L47'>_test-input-stream</a> <span class="Constant">&quot;abc&quot;</span>)
<span id="L103" class="LineNr">103 </span> <span class="subxComment"># skip something</span>
<span id="L104" class="LineNr">104 </span> (<a href='112read-byte.subx.html#L13'>read-byte</a> <a href='112read-byte.subx.html#L47'>_test-input-stream</a>) <span class="subxComment"># =&gt; eax</span>
<span id="L105" class="LineNr">105 </span> <span class="subxComment"># var out/ecx: (handle array byte)</span>
<span id="L106" class="LineNr">106 </span> 68/push 0/imm32
<span id="L107" class="LineNr">107 </span> 68/push 0/imm32
<span id="L108" class="LineNr">108 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L109" class="LineNr">109 </span> <span class="subxComment">#</span>
<span id="L110" class="LineNr">110 </span> (<a href='310copy-bytes.subx.html#L60'>stream-to-array</a> <a href='112read-byte.subx.html#L47'>_test-input-stream</a> %ecx)
<span id="L111" class="LineNr">111 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *ecx *(ecx+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L112" class="LineNr">112 </span> (<a href='105string-equal.subx.html#L213'>check-strings-equal</a> %eax <span class="Constant">&quot;bc&quot;</span>)
<span id="L113" class="LineNr">113 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L114" class="LineNr">114 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L115" class="LineNr">115 </span> 5d/pop-to-ebp
<span id="L116" class="LineNr">116 </span> c3/return
<span id="L117" class="LineNr">117 </span>
<span id="L118" class="LineNr">118 </span><span class="subxComment"># like stream-to-array but ignore surrounding quotes</span>
<span id="L119" class="LineNr">119 </span><span class="subxComment"># we might do other stuff here later</span>
<span id="L120" class="LineNr">120 </span><span class="subxFunction">unquote-stream-to-array</span>: <span class="subxComment"># in: (addr stream _), out: (addr handle array _)</span>
<span id="L121" class="LineNr">121 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L122" class="LineNr">122 </span> 55/push-ebp
<span id="L123" class="LineNr">123 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L124" class="LineNr">124 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L125" class="LineNr">125 </span> 50/push-eax
<span id="L126" class="LineNr">126 </span> 51/push-ecx
<span id="L127" class="LineNr">127 </span> 52/push-edx
<span id="L128" class="LineNr">128 </span> 56/push-esi
<span id="L129" class="LineNr">129 </span> <span class="subxComment"># esi = s</span>
<span id="L130" class="LineNr">130 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L131" class="LineNr">131 </span> <span class="subxComment"># var len/ecx: int = s-&gt;write - s-&gt;read - 2</span>
<span id="L132" class="LineNr">132 </span> 8b/-&gt; *esi 1/r32/ecx
<span id="L133" class="LineNr">133 </span> 2b/subtract *(esi+4) 1/r32/ecx
<span id="L134" class="LineNr">134 </span> 81 7/subop/compare %ecx 2/imm32
<span id="L135" class="LineNr">135 </span> 7c/jump-if-&lt; $unquote-stream-to-array:end/disp8
<span id="L136" class="LineNr">136 </span> 81 5/subop/subtract %ecx 2/imm32
<span id="L137" class="LineNr">137 </span> <span class="subxComment"># allocate</span>
<span id="L138" class="LineNr">138 </span> (<a href='120allocate.subx.html#L556'>allocate-array</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> %ecx *(ebp+0xc))
<span id="L139" class="LineNr">139 </span> <span class="subxComment"># var in/edx: (addr byte) = s-&gt;data + s-&gt;read + 1</span>
<span id="L140" class="LineNr">140 </span> 8b/-&gt; *(esi+4) 2/r32/edx
<span id="L141" class="LineNr">141 </span> 8d/copy-address *(esi+edx+0xd) 2/r32/edx <span class="subxComment"># Stream-data + 1</span>
<span id="L142" class="LineNr">142 </span> <span class="subxComment"># var dest/eax: (addr byte) = data for out</span>
<span id="L143" class="LineNr">143 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L144" class="LineNr">144 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L145" class="LineNr">145 </span> 8d/copy-address *(eax+4) 0/r32/eax
<span id="L146" class="LineNr">146 </span> <span class="subxComment">#</span>
<span id="L147" class="LineNr">147 </span> (<a href='310copy-bytes.subx.html#L6'>copy-bytes</a> %edx %eax %ecx)
<span id="L148" class="LineNr">148 </span><span class="Constant">$unquote-stream-to-array:end</span>:
<span id="L149" class="LineNr">149 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L150" class="LineNr">150 </span> 5e/pop-to-esi
<span id="L151" class="LineNr">151 </span> 5a/pop-to-edx
<span id="L152" class="LineNr">152 </span> 59/pop-to-ecx
<span id="L153" class="LineNr">153 </span> 58/pop-to-eax
<span id="L154" class="LineNr">154 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L155" class="LineNr">155 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L156" class="LineNr">156 </span> 5d/pop-to-ebp
<span id="L157" class="LineNr">157 </span> c3/return
<span id="L105" class="LineNr">105 </span> 8b/-&gt; *$_test-input-stream-&gt;read 0/r32/eax
<span id="L106" class="LineNr">106 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %eax 1 <span class="Constant">&quot;F - <a href='310copy-bytes.subx.html#L96'>test-stream-to-array</a>/pre&quot;</span>)
<span id="L107" class="LineNr">107 </span> <span class="subxComment"># var out/ecx: (handle array byte)</span>
<span id="L108" class="LineNr">108 </span> 68/push 0/imm32
<span id="L109" class="LineNr">109 </span> 68/push 0/imm32
<span id="L110" class="LineNr">110 </span> 89/&lt;- %ecx 4/r32/esp
<span id="L111" class="LineNr">111 </span> <span class="subxComment">#</span>
<span id="L112" class="LineNr">112 </span> (<a href='310copy-bytes.subx.html#L60'>stream-to-array</a> <a href='112read-byte.subx.html#L47'>_test-input-stream</a> %ecx)
<span id="L113" class="LineNr">113 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *ecx *(ecx+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L114" class="LineNr">114 </span> (<a href='105string-equal.subx.html#L213'>check-strings-equal</a> %eax <span class="Constant">&quot;bc&quot;</span> <span class="Constant">&quot;F - test-stream-to-array&quot;</span>)
<span id="L115" class="LineNr">115 </span> 8b/-&gt; *$_test-input-stream-&gt;read 0/r32/eax
<span id="L116" class="LineNr">116 </span> (<a href='502test.mu.html#L2'>check-ints-equal</a> %eax 1 <span class="Constant">&quot;F - <a href='310copy-bytes.subx.html#L96'>test-stream-to-array</a>/read-pointer-not-perturbed&quot;</span>)
<span id="L117" class="LineNr">117 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L118" class="LineNr">118 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L119" class="LineNr">119 </span> 5d/pop-to-ebp
<span id="L120" class="LineNr">120 </span> c3/return
<span id="L121" class="LineNr">121 </span>
<span id="L122" class="LineNr">122 </span><span class="subxComment"># like stream-to-array but ignore surrounding quotes</span>
<span id="L123" class="LineNr">123 </span><span class="subxComment"># we might do other stuff here later</span>
<span id="L124" class="LineNr">124 </span><span class="subxFunction">unquote-stream-to-array</span>: <span class="subxComment"># in: (addr stream _), out: (addr handle array _)</span>
<span id="L125" class="LineNr">125 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L126" class="LineNr">126 </span> 55/push-ebp
<span id="L127" class="LineNr">127 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L128" class="LineNr">128 </span> <span class="subxS1Comment"># . save registers</span>
<span id="L129" class="LineNr">129 </span> 50/push-eax
<span id="L130" class="LineNr">130 </span> 51/push-ecx
<span id="L131" class="LineNr">131 </span> 52/push-edx
<span id="L132" class="LineNr">132 </span> 56/push-esi
<span id="L133" class="LineNr">133 </span> <span class="subxComment"># esi = s</span>
<span id="L134" class="LineNr">134 </span> 8b/-&gt; *(ebp+8) 6/r32/esi
<span id="L135" class="LineNr">135 </span> <span class="subxComment"># var len/ecx: int = s-&gt;write - s-&gt;read - 2</span>
<span id="L136" class="LineNr">136 </span> 8b/-&gt; *esi 1/r32/ecx
<span id="L137" class="LineNr">137 </span> 2b/subtract *(esi+4) 1/r32/ecx
<span id="L138" class="LineNr">138 </span> 81 7/subop/compare %ecx 2/imm32
<span id="L139" class="LineNr">139 </span> 7c/jump-if-&lt; $unquote-stream-to-array:end/disp8
<span id="L140" class="LineNr">140 </span> 81 5/subop/subtract %ecx 2/imm32
<span id="L141" class="LineNr">141 </span> <span class="subxComment"># allocate</span>
<span id="L142" class="LineNr">142 </span> (<a href='120allocate.subx.html#L556'>allocate-array</a> <span class="SpecialChar"><a href='120allocate.subx.html#L27'>Heap</a></span> %ecx *(ebp+0xc))
<span id="L143" class="LineNr">143 </span> <span class="subxComment"># var in/edx: (addr byte) = s-&gt;data + s-&gt;read + 1</span>
<span id="L144" class="LineNr">144 </span> 8b/-&gt; *(esi+4) 2/r32/edx
<span id="L145" class="LineNr">145 </span> 8d/copy-address *(esi+edx+0xd) 2/r32/edx <span class="subxComment"># Stream-data + 1</span>
<span id="L146" class="LineNr">146 </span> <span class="subxComment"># var dest/eax: (addr byte) = data for out</span>
<span id="L147" class="LineNr">147 </span> 8b/-&gt; *(ebp+0xc) 0/r32/eax
<span id="L148" class="LineNr">148 </span> (<a href='120allocate.subx.html#L223'>lookup</a> *eax *(eax+4)) <span class="subxComment"># =&gt; eax</span>
<span id="L149" class="LineNr">149 </span> 8d/copy-address *(eax+4) 0/r32/eax
<span id="L150" class="LineNr">150 </span> <span class="subxComment">#</span>
<span id="L151" class="LineNr">151 </span> (<a href='310copy-bytes.subx.html#L6'>copy-bytes</a> %edx %eax %ecx)
<span id="L152" class="LineNr">152 </span><span class="Constant">$unquote-stream-to-array:end</span>:
<span id="L153" class="LineNr">153 </span> <span class="subxS1Comment"># . restore registers</span>
<span id="L154" class="LineNr">154 </span> 5e/pop-to-esi
<span id="L155" class="LineNr">155 </span> 5a/pop-to-edx
<span id="L156" class="LineNr">156 </span> 59/pop-to-ecx
<span id="L157" class="LineNr">157 </span> 58/pop-to-eax
<span id="L158" class="LineNr">158 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L159" class="LineNr">159 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L160" class="LineNr">160 </span> 5d/pop-to-ebp
<span id="L161" class="LineNr">161 </span> c3/return
</pre>
</body>
</html>

View File

@ -1,32 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 311decimal-int.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.SpecialChar { color: #d70000; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -187,7 +187,7 @@ if ('onhashchange' in window) {
<span id="L127" class="LineNr">127 </span> <span class="subxComment"># if !decimal-digit?(*curr) return 0</span>
<span id="L128" class="LineNr">128 </span> 8a/copy-byte *esi 1/r32/CL
<span id="L129" class="LineNr">129 </span> 50/push-eax
<span id="L130" class="LineNr">130 </span> (<a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a> %ecx) <span class="subxComment"># =&gt; eax</span>
<span id="L130" class="LineNr">130 </span> (<a href='126write-int-decimal.subx.html#L327'>decimal-digit?</a> %ecx) <span class="subxComment"># =&gt; eax</span>
<span id="L131" class="LineNr">131 </span> {
<span id="L132" class="LineNr">132 </span> 3d/compare-eax-and 0/imm32/false
<span id="L133" class="LineNr">133 </span> 75/jump-if-!= <span class="Constant">break</span>/disp8

22
html/312copy.subx.html generated
View File

@ -1,29 +1,29 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 312copy.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.SpecialChar { color: #d70000; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.subxComment { color: #005faf; }
.Constant { color: #008787; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 313index-bounds-check.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,12 +17,12 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.subxMinorFunction { color: #875f5f; }
.Constant { color: #008787; }
.subxMinorFunction { color: #875f5f; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,28 +1,28 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 314divide.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxComment { color: #005faf; }
.Constant { color: #008787; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 315stack-debug.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,15 +16,15 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.CommentedCode { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.CommentedCode { color: #8a8a8a; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 316colors.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,15 +16,15 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 317abort.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,15 +16,15 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -140,10 +140,10 @@ if ('onhashchange' in window) {
<span id="L82" class="LineNr"> 82 </span> c7 0/subop/copy *(ecx+4) 0/imm32 <span class="subxComment"># read index</span>
<span id="L83" class="LineNr"> 83 </span> c7 0/subop/copy *(ecx+8) 0x01000000/imm32 <span class="subxComment"># stream capacity = 16MB</span>
<span id="L84" class="LineNr"> 84 </span> <span class="subxComment"># load 0x400 sectors starting from sector 10080 = 0x2760</span>
<span id="L85" class="LineNr"> 85 </span> (<a href='boot.subx.html#L974'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L922'>Primary-bus-primary-drive</a></span> 0x2760 0x100 %ecx)
<span id="L86" class="LineNr"> 86 </span> (<a href='boot.subx.html#L974'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L922'>Primary-bus-primary-drive</a></span> 0x2860 0x100 %ecx)
<span id="L87" class="LineNr"> 87 </span> (<a href='boot.subx.html#L974'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L922'>Primary-bus-primary-drive</a></span> 0x2960 0x100 %ecx)
<span id="L88" class="LineNr"> 88 </span> (<a href='boot.subx.html#L974'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L922'>Primary-bus-primary-drive</a></span> 0x2a60 0x100 %ecx)
<span id="L85" class="LineNr"> 85 </span> (<a href='boot.subx.html#L976'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L923'>Primary-bus-primary-drive</a></span> 0x2760 0x100 %ecx)
<span id="L86" class="LineNr"> 86 </span> (<a href='boot.subx.html#L976'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L923'>Primary-bus-primary-drive</a></span> 0x2860 0x100 %ecx)
<span id="L87" class="LineNr"> 87 </span> (<a href='boot.subx.html#L976'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L923'>Primary-bus-primary-drive</a></span> 0x2960 0x100 %ecx)
<span id="L88" class="LineNr"> 88 </span> (<a href='boot.subx.html#L976'>load-sectors</a> <span class="SpecialChar"><a href='boot.subx.html#L923'>Primary-bus-primary-drive</a></span> 0x2a60 0x100 %ecx)
<span id="L89" class="LineNr"> 89 </span> <span class="subxH1Comment"># - parse pointers to portions of this stream into labels</span>
<span id="L90" class="LineNr"> 90 </span> <span class="subxComment"># var curr/ecx: (addr byte) = s-&gt;data</span>
<span id="L91" class="LineNr"> 91 </span> 81 0/subop/add %ecx 0xc/imm32

92
html/318debug-counter.subx.html generated Normal file
View File

@ -0,0 +1,92 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mu - 318debug-counter.subx</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
-->
</style>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/318debug-counter.subx'>https://github.com/akkartik/mu/blob/main/318debug-counter.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># A rudimentary counter that can be called from anywhere.</span>
<span id="L2" class="LineNr"> 2 </span>
<span id="L3" class="LineNr"> 3 </span>== code
<span id="L4" class="LineNr"> 4 </span>
<span id="L5" class="LineNr"> 5 </span><span class="subxFunction">count-event</span>:
<span id="L6" class="LineNr"> 6 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L7" class="LineNr"> 7 </span> 55/push-ebp
<span id="L8" class="LineNr"> 8 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L9" class="LineNr"> 9 </span> <span class="subxComment">#</span>
<span id="L10" class="LineNr">10 </span> ff 0/subop/increment *<span class="SpecialChar"><a href='318debug-counter.subx.html#L30'>Foo</a></span>
<span id="L11" class="LineNr">11 </span><span class="Constant">$count-event:end</span>:
<span id="L12" class="LineNr">12 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L13" class="LineNr">13 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L14" class="LineNr">14 </span> 5d/pop-to-ebp
<span id="L15" class="LineNr">15 </span> c3/return
<span id="L16" class="LineNr">16 </span>
<span id="L17" class="LineNr">17 </span><span class="subxFunction">count-of-events</span>: <span class="subxComment"># -&gt; _/eax: int</span>
<span id="L18" class="LineNr">18 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L19" class="LineNr">19 </span> 55/push-ebp
<span id="L20" class="LineNr">20 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L21" class="LineNr">21 </span> <span class="subxComment">#</span>
<span id="L22" class="LineNr">22 </span> 8b/-&gt; *<span class="SpecialChar"><a href='318debug-counter.subx.html#L30'>Foo</a></span> 0/r32/eax
<span id="L23" class="LineNr">23 </span><span class="Constant">$count-of-events:end</span>:
<span id="L24" class="LineNr">24 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L25" class="LineNr">25 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L26" class="LineNr">26 </span> 5d/pop-to-ebp
<span id="L27" class="LineNr">27 </span> c3/return
<span id="L28" class="LineNr">28 </span>
<span id="L29" class="LineNr">29 </span>== data
<span id="L30" class="LineNr">30 </span><span class="SpecialChar">Foo</span>:
<span id="L31" class="LineNr">31 </span> 0/imm32
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

74
html/319timer.subx.html generated Normal file
View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mu - 319timer.subx</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.SpecialChar { color: #d70000; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.subxComment { color: #005faf; }
.Constant { color: #008787; }
-->
</style>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/319timer.subx'>https://github.com/akkartik/mu/blob/main/319timer.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span>== code
<span id="L2" class="LineNr"> 2 </span>
<span id="L3" class="LineNr"> 3 </span><span class="subxFunction">timer-counter</span>: <span class="subxComment"># -&gt; _/eax: int</span>
<span id="L4" class="LineNr"> 4 </span> <span class="subxS1Comment"># . prologue</span>
<span id="L5" class="LineNr"> 5 </span> 55/push-ebp
<span id="L6" class="LineNr"> 6 </span> 89/&lt;- %ebp 4/r32/esp
<span id="L7" class="LineNr"> 7 </span> <span class="subxComment">#</span>
<span id="L8" class="LineNr"> 8 </span> 8b/-&gt; *<span class="SpecialChar"><a href='boot.subx.html#L378'>Timer-counter</a></span> 0/r32/eax
<span id="L9" class="LineNr"> 9 </span><span class="Constant">$timer-counter:end</span>:
<span id="L10" class="LineNr">10 </span> <span class="subxS1Comment"># . epilogue</span>
<span id="L11" class="LineNr">11 </span> 89/&lt;- %esp 5/r32/ebp
<span id="L12" class="LineNr">12 </span> 5d/pop-to-ebp
<span id="L13" class="LineNr">13 </span> c3/return
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

224
html/400.mu.html generated
View File

@ -1,29 +1,29 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 400.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.LineNr { }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.LineNr { }
.muComment { color: #005faf; }
.muRegEbx { color: #5f00ff; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -64,108 +64,116 @@ if ('onhashchange' in window) {
<span id="L7" class="LineNr"> 7 </span><span class="PreProc">sig</span> <a href='103grapheme.subx.html#L195'>draw-cursor-on-real-screen</a> g: grapheme
<span id="L8" class="LineNr"> 8 </span><span class="PreProc">sig</span> <a href='316colors.subx.html#L7'>color-rgb</a> color: int<span class="PreProc"> -&gt; </span>_/<span class="muRegEcx">ecx</span>: int, _/<span class="muRegEdx">edx</span>: int, _/<span class="muRegEbx">ebx</span>: int
<span id="L9" class="LineNr"> 9 </span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># keyboard</span>
<span id="L11" class="LineNr"> 11 </span><span class="PreProc">sig</span> <a href='102keyboard.subx.html#L21'>read-key</a> kbd: (addr keyboard)<span class="PreProc"> -&gt; </span>_/eax: byte
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># timer</span>
<span id="L11" class="LineNr"> 11 </span><span class="PreProc">sig</span> <a href='319timer.subx.html#L3'>timer-counter</a><span class="PreProc"> -&gt; </span>_/eax: int
<span id="L12" class="LineNr"> 12 </span>
<span id="L13" class="LineNr"> 13 </span><span class="muComment"># disk</span>
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L974'>load-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
<span id="L15" class="LineNr"> 15 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1037'>store-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
<span id="L16" class="LineNr"> 16 </span>
<span id="L17" class="LineNr"> 17 </span><span class="muComment"># mouse</span>
<span id="L18" class="LineNr"> 18 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1443'>read-mouse-event</a><span class="PreProc"> -&gt; </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int
<span id="L13" class="LineNr"> 13 </span><span class="muComment"># keyboard</span>
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">sig</span> <a href='102keyboard.subx.html#L21'>read-key</a> kbd: (addr keyboard)<span class="PreProc"> -&gt; </span>_/eax: byte
<span id="L15" class="LineNr"> 15 </span>
<span id="L16" class="LineNr"> 16 </span><span class="muComment"># disk</span>
<span id="L17" class="LineNr"> 17 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L976'>load-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
<span id="L18" class="LineNr"> 18 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1045'>store-sectors</a> disk: (addr disk), lba: int, n: int, out: (addr stream byte)
<span id="L19" class="LineNr"> 19 </span>
<span id="L20" class="LineNr"> 20 </span><span class="muComment"># tests</span>
<span id="L21" class="LineNr"> 21 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L22" class="LineNr"> 22 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L17'>num-test-failures</a><span class="PreProc"> -&gt; </span>_/eax: int
<span id="L23" class="LineNr"> 23 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L29'>running-tests?</a><span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L24" class="LineNr"> 24 </span>
<span id="L25" class="LineNr"> 25 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L8'>string-equal?</a> s: (addr array byte), benchmark: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L26" class="LineNr"> 26 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L50'>string-starts-with?</a> s: (addr array byte), benchmark: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L27" class="LineNr"> 27 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> s: (addr array byte), expected: (addr array byte), msg: (addr array byte)
<span id="L28" class="LineNr"> 28 </span>
<span id="L29" class="LineNr"> 29 </span><span class="muComment"># debugging</span>
<span id="L30" class="LineNr"> 30 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L5'>check-stack</a>
<span id="L31" class="LineNr"> 31 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L26'>show-stack-state</a>
<span id="L32" class="LineNr"> 32 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L56'>debug-print</a> x: (addr array byte), fg: int, bg: int
<span id="L33" class="LineNr"> 33 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L84'>debug-print?</a><span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L34" class="LineNr"> 34 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L96'>turn-on-debug-print</a>
<span id="L35" class="LineNr"> 35 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L108'>turn-off-debug-print</a>
<span id="L36" class="LineNr"> 36 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L5'>abort</a> e: (addr array byte)
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L21'>dump-call-stack</a>
<span id="L38" class="LineNr"> 38 </span>
<span id="L39" class="LineNr"> 39 </span><span class="PreProc">sig</span> <a href='318counter.subx.html#L5'>count-event</a>
<span id="L40" class="LineNr"> 40 </span><span class="PreProc">sig</span> <a href='318counter.subx.html#L17'>count-of-events</a><span class="PreProc"> -&gt; </span>_/eax: int
<span id="L20" class="LineNr"> 20 </span><span class="muComment"># mouse</span>
<span id="L21" class="LineNr"> 21 </span><span class="PreProc">sig</span> <a href='boot.subx.html#L1451'>read-mouse-event</a><span class="PreProc"> -&gt; </span>_/eax: int, _/<span class="muRegEcx">ecx</span>: int
<span id="L22" class="LineNr"> 22 </span>
<span id="L23" class="LineNr"> 23 </span><span class="muComment"># tests</span>
<span id="L24" class="LineNr"> 24 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L5'>count-test-failure</a>
<span id="L25" class="LineNr"> 25 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L17'>num-test-failures</a><span class="PreProc"> -&gt; </span>_/eax: int
<span id="L26" class="LineNr"> 26 </span><span class="PreProc">sig</span> <a href='104test.subx.html#L29'>running-tests?</a><span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L27" class="LineNr"> 27 </span>
<span id="L28" class="LineNr"> 28 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L8'>string-equal?</a> s: (addr array byte), benchmark: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L29" class="LineNr"> 29 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L50'>string-starts-with?</a> s: (addr array byte), benchmark: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L30" class="LineNr"> 30 </span><span class="PreProc">sig</span> <a href='105string-equal.subx.html#L213'>check-strings-equal</a> s: (addr array byte), expected: (addr array byte), msg: (addr array byte)
<span id="L31" class="LineNr"> 31 </span>
<span id="L32" class="LineNr"> 32 </span><span class="muComment"># debugging</span>
<span id="L33" class="LineNr"> 33 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L5'>check-stack</a>
<span id="L34" class="LineNr"> 34 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L26'>show-stack-state</a>
<span id="L35" class="LineNr"> 35 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L56'>debug-print</a> x: (addr array byte), fg: int, bg: int
<span id="L36" class="LineNr"> 36 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L84'>debug-print?</a><span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L96'>turn-on-debug-print</a>
<span id="L38" class="LineNr"> 38 </span><span class="PreProc">sig</span> <a href='315stack-debug.subx.html#L108'>turn-off-debug-print</a>
<span id="L39" class="LineNr"> 39 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L5'>abort</a> e: (addr array byte)
<span id="L40" class="LineNr"> 40 </span><span class="PreProc">sig</span> <a href='317abort.subx.html#L21'>dump-call-stack</a>
<span id="L41" class="LineNr"> 41 </span>
<span id="L42" class="LineNr"> 42 </span><span class="muComment"># streams</span>
<span id="L43" class="LineNr"> 43 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L20'>clear-stream</a> f: (addr stream _)
<span id="L44" class="LineNr"> 44 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L59'>rewind-stream</a> f: (addr stream _)
<span id="L45" class="LineNr"> 45 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L9'>stream-data-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L46" class="LineNr"> 46 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L211'>streams-data-equal?</a> a: (addr stream byte), b: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L47" class="LineNr"> 47 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L194'>check-stream-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
<span id="L48" class="LineNr"> 48 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L300'>check-streams-data-equal</a> s: (addr stream _), expected: (addr stream _), msg: (addr array byte)
<span id="L49" class="LineNr"> 49 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L230'>next-stream-line-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L50" class="LineNr"> 50 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L565'>check-next-stream-line-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
<span id="L51" class="LineNr"> 51 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L11'>write</a> f: (addr stream byte), s: (addr array byte)
<span id="L52" class="LineNr"> 52 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L138'>try-write</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L53" class="LineNr"> 53 </span><span class="muComment"># probably a bad idea; I definitely want to discourage its use for streams of non-bytes</span>
<span id="L54" class="LineNr"> 54 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L194'>stream-size</a> f: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L55" class="LineNr"> 55 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L176'>space-remaining-in-stream</a> f: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L56" class="LineNr"> 56 </span><span class="PreProc">sig</span> <a href='113write-stream.subx.html#L8'>write-stream</a> f: (addr stream byte), s: (addr stream byte)
<span id="L57" class="LineNr"> 57 </span><span class="PreProc">sig</span> <a href='112read-byte.subx.html#L13'>read-byte</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: byte
<span id="L58" class="LineNr"> 58 </span><span class="PreProc">sig</span> <a href='115write-byte.subx.html#L12'>append-byte</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
<span id="L59" class="LineNr"> 59 </span><span class="muComment">#sig to-hex-char in/eax: int -&gt; out/eax: int</span>
<span id="L60" class="LineNr"> 60 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L21'>append-byte-hex</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
<span id="L61" class="LineNr"> 61 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> f: (addr stream byte), n: int
<span id="L62" class="LineNr"> 62 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L123'>write-int32-hex-bits</a> f: (addr stream byte), n: int, bits: int
<span id="L63" class="LineNr"> 63 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L9'>hex-int?</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L354'>parse-hex-int</a> in: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L65" class="LineNr"> 65 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L387'>parse-hex-int-from-slice</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L66" class="LineNr"> 66 </span><span class="muComment">#sig parse-hex-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L67" class="LineNr"> 67 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> c: byte<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L68" class="LineNr"> 68 </span><span class="muComment">#sig from-hex-char in/eax: byte -&gt; out/eax: nibble</span>
<span id="L69" class="LineNr"> 69 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L23'>parse-decimal-int</a> in: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L70" class="LineNr"> 70 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L71" class="LineNr"> 71 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L48'>parse-decimal-int-from-stream</a> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L72" class="LineNr"> 72 </span><span class="muComment">#sig parse-decimal-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L73" class="LineNr"> 73 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L312'>decimal-size</a> n: int<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L74" class="LineNr"> 74 </span><span class="muComment">#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L75" class="LineNr"> 75 </span><span class="muComment">#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L76" class="LineNr"> 76 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L223'>lookup</a> h: (handle _T)<span class="PreProc"> -&gt; </span>_/eax: (addr _T)
<span id="L77" class="LineNr"> 77 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> a: (handle _T), b: (handle _T)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L78" class="LineNr"> 78 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L479'>copy-handle</a> src: (handle _T), dest: (addr handle _T)
<span id="L79" class="LineNr"> 79 </span><span class="muComment">#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)</span>
<span id="L80" class="LineNr"> 80 </span><span class="muComment">#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L81" class="LineNr"> 81 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L690'>copy-array</a> ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
<span id="L82" class="LineNr"> 82 </span><span class="muComment">#sig zero-out start: (addr byte), size: int</span>
<span id="L83" class="LineNr"> 83 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L9'>slice-empty?</a> s: (addr slice)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L84" class="LineNr"> 84 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L120'>slice-equal?</a> s: (addr slice), p: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L85" class="LineNr"> 85 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L487'>slice-starts-with?</a> s: (addr slice), head: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L86" class="LineNr"> 86 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L793'>write-slice</a> out: (addr stream byte), s: (addr slice)
<span id="L87" class="LineNr"> 87 </span><span class="muComment"># bad name alert</span>
<span id="L88" class="LineNr"> 88 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L898'>slice-to-string</a> ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
<span id="L89" class="LineNr"> 89 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> out: (addr stream byte), n: int
<span id="L90" class="LineNr"> 90 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L296'>decimal-digit?</a> c: grapheme<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L91" class="LineNr"> 91 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L395'>to-decimal-digit</a> in: grapheme<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L92" class="LineNr"> 92 </span><span class="muComment"># bad name alert</span>
<span id="L93" class="LineNr"> 93 </span><span class="muComment"># next-word really tokenizes</span>
<span id="L94" class="LineNr"> 94 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
<span id="L95" class="LineNr"> 95 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L11'>next-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># skips '#' comments</span>
<span id="L96" class="LineNr"> 96 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L306'>next-raw-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># does not skip '#' comments</span>
<span id="L97" class="LineNr"> 97 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s: (addr stream _)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L98" class="LineNr"> 98 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L30'>stream-full?</a> s: (addr stream _)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L99" class="LineNr"> 99 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L60'>stream-to-array</a> in: (addr stream _), out: (addr handle array _)
<span id="L100" class="LineNr">100 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L120'>unquote-stream-to-array</a> in: (addr stream _), out: (addr handle array _)
<span id="L101" class="LineNr">101 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L154'>stream-first</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: byte
<span id="L102" class="LineNr">102 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L181'>stream-final</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: byte
<span id="L103" class="LineNr">103 </span>
<span id="L104" class="LineNr">104 </span><span class="muComment">#sig copy-bytes src: (addr byte), dest: (addr byte), n: int</span>
<span id="L105" class="LineNr">105 </span><span class="PreProc">sig</span> <a href='312copy.subx.html#L3'>copy-array-object</a> src: (addr array _), dest-ah: (addr handle array _)
<span id="L106" class="LineNr">106 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L5'>array-equal?</a> a: (addr array int), b: (addr array int)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L107" class="LineNr">107 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L368'>parse-array-of-ints</a> s: (addr array byte), out: (addr handle array int)
<span id="L108" class="LineNr">108 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L623'>parse-array-of-decimal-ints</a> s: (addr array byte), out: (addr handle array int)
<span id="L109" class="LineNr">109 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L382'>check-array-equal</a> a: (addr array int), expected: (addr string), msg: (addr string)
<span id="L110" class="LineNr">110 </span>
<span id="L111" class="LineNr">111 </span><span class="PreProc">sig</span> <a href='314divide.subx.html#L3'>integer-divide</a> a: int, b: int<span class="PreProc"> -&gt; </span>_/eax: int, _/<span class="muRegEdx">edx</span>: int
<span id="L42" class="LineNr"> 42 </span><span class="PreProc">sig</span> <a href='318debug-counter.subx.html#L5'>count-event</a>
<span id="L43" class="LineNr"> 43 </span><span class="PreProc">sig</span> <a href='318debug-counter.subx.html#L17'>count-of-events</a><span class="PreProc"> -&gt; </span>_/eax: int
<span id="L44" class="LineNr"> 44 </span>
<span id="L45" class="LineNr"> 45 </span><span class="muComment"># streams</span>
<span id="L46" class="LineNr"> 46 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L20'>clear-stream</a> f: (addr stream _)
<span id="L47" class="LineNr"> 47 </span><span class="PreProc">sig</span> <a href='106stream.subx.html#L59'>rewind-stream</a> f: (addr stream _)
<span id="L48" class="LineNr"> 48 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L9'>stream-data-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L49" class="LineNr"> 49 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L211'>streams-data-equal?</a> a: (addr stream byte), b: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L50" class="LineNr"> 50 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L194'>check-stream-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
<span id="L51" class="LineNr"> 51 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L300'>check-streams-data-equal</a> s: (addr stream _), expected: (addr stream _), msg: (addr array byte)
<span id="L52" class="LineNr"> 52 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L230'>next-stream-line-equal?</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L53" class="LineNr"> 53 </span><span class="PreProc">sig</span> <a href='109stream-equal.subx.html#L565'>check-next-stream-line-equal</a> f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
<span id="L54" class="LineNr"> 54 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L11'>write</a> f: (addr stream byte), s: (addr array byte)
<span id="L55" class="LineNr"> 55 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L138'>try-write</a> f: (addr stream byte), s: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L56" class="LineNr"> 56 </span><span class="muComment"># probably a bad idea; I definitely want to discourage its use for streams of non-bytes</span>
<span id="L57" class="LineNr"> 57 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L194'>stream-size</a> f: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L58" class="LineNr"> 58 </span><span class="PreProc">sig</span> <a href='108write.subx.html#L176'>space-remaining-in-stream</a> f: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L59" class="LineNr"> 59 </span><span class="PreProc">sig</span> <a href='113write-stream.subx.html#L8'>write-stream</a> f: (addr stream byte), s: (addr stream byte)
<span id="L60" class="LineNr"> 60 </span><span class="PreProc">sig</span> <a href='113write-stream.subx.html#L163'>write-stream-immutable</a> f: (addr stream byte), s: (addr stream byte)
<span id="L61" class="LineNr"> 61 </span><span class="PreProc">sig</span> <a href='112read-byte.subx.html#L13'>read-byte</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: byte
<span id="L62" class="LineNr"> 62 </span><span class="PreProc">sig</span> <a href='115write-byte.subx.html#L12'>append-byte</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
<span id="L63" class="LineNr"> 63 </span><span class="muComment">#sig to-hex-char in/eax: int -&gt; out/eax: int</span>
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L21'>append-byte-hex</a> f: (addr stream byte), n: int <span class="muComment"># really just a byte, but I want to pass in literal numbers</span>
<span id="L65" class="LineNr"> 65 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L92'>write-int32-hex</a> f: (addr stream byte), n: int
<span id="L66" class="LineNr"> 66 </span><span class="PreProc">sig</span> <a href='117write-int-hex.subx.html#L123'>write-int32-hex-bits</a> f: (addr stream byte), n: int, bits: int
<span id="L67" class="LineNr"> 67 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L9'>hex-int?</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L68" class="LineNr"> 68 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L354'>parse-hex-int</a> in: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L69" class="LineNr"> 69 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L387'>parse-hex-int-from-slice</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L70" class="LineNr"> 70 </span><span class="muComment">#sig parse-hex-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L71" class="LineNr"> 71 </span><span class="PreProc">sig</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> c: byte<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L72" class="LineNr"> 72 </span><span class="muComment">#sig from-hex-char in/eax: byte -&gt; out/eax: nibble</span>
<span id="L73" class="LineNr"> 73 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L23'>parse-decimal-int</a> in: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L74" class="LineNr"> 74 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> in: (addr slice)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L75" class="LineNr"> 75 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L48'>parse-decimal-int-from-stream</a> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L76" class="LineNr"> 76 </span><span class="muComment">#sig parse-decimal-int-helper start: (addr byte), end: (addr byte) -&gt; _/eax: int</span>
<span id="L77" class="LineNr"> 77 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L312'>decimal-size</a> n: int<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L78" class="LineNr"> 78 </span><span class="muComment">#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L79" class="LineNr"> 79 </span><span class="muComment">#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L80" class="LineNr"> 80 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L223'>lookup</a> h: (handle _T)<span class="PreProc"> -&gt; </span>_/eax: (addr _T)
<span id="L81" class="LineNr"> 81 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> a: (handle _T), b: (handle _T)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L82" class="LineNr"> 82 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L479'>copy-handle</a> src: (handle _T), dest: (addr handle _T)
<span id="L83" class="LineNr"> 83 </span><span class="muComment">#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)</span>
<span id="L84" class="LineNr"> 84 </span><span class="muComment">#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)</span>
<span id="L85" class="LineNr"> 85 </span><span class="PreProc">sig</span> <a href='120allocate.subx.html#L690'>copy-array</a> ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
<span id="L86" class="LineNr"> 86 </span><span class="muComment">#sig zero-out start: (addr byte), size: int</span>
<span id="L87" class="LineNr"> 87 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L9'>slice-empty?</a> s: (addr slice)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L88" class="LineNr"> 88 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L120'>slice-equal?</a> s: (addr slice), p: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L89" class="LineNr"> 89 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L487'>slice-starts-with?</a> s: (addr slice), head: (addr array byte)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L90" class="LineNr"> 90 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L793'>write-slice</a> out: (addr stream byte), s: (addr slice)
<span id="L91" class="LineNr"> 91 </span><span class="muComment"># bad name alert</span>
<span id="L92" class="LineNr"> 92 </span><span class="PreProc">sig</span> <a href='123slice.subx.html#L898'>slice-to-string</a> ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
<span id="L93" class="LineNr"> 93 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> out: (addr stream byte), n: int
<span id="L94" class="LineNr"> 94 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L327'>decimal-digit?</a> c: grapheme<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L95" class="LineNr"> 95 </span><span class="PreProc">sig</span> <a href='126write-int-decimal.subx.html#L426'>to-decimal-digit</a> in: grapheme<span class="PreProc"> -&gt; </span>_/eax: int
<span id="L96" class="LineNr"> 96 </span><span class="muComment"># bad name alert</span>
<span id="L97" class="LineNr"> 97 </span><span class="muComment"># next-word really tokenizes</span>
<span id="L98" class="LineNr"> 98 </span><span class="muComment"># next-raw-word really reads whitespace-separated words</span>
<span id="L99" class="LineNr"> 99 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L11'>next-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># skips '#' comments</span>
<span id="L100" class="LineNr">100 </span><span class="PreProc">sig</span> <a href='127next-word.subx.html#L306'>next-raw-word</a> line: (addr stream byte), out: (addr slice) <span class="muComment"># does not skip '#' comments</span>
<span id="L101" class="LineNr">101 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L188'>skip-chars-matching</a> in: (addr stream byte), delimiter: byte
<span id="L102" class="LineNr">102 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L311'>skip-chars-matching-whitespace</a> in: (addr stream byte)
<span id="L103" class="LineNr">103 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L401'>skip-chars-not-matching</a> in: (addr stream byte), delimiter: byte
<span id="L104" class="LineNr">104 </span><span class="PreProc">sig</span> <a href='124next-token.subx.html#L563'>skip-chars-not-matching-whitespace</a> in: (addr stream byte)
<span id="L105" class="LineNr">105 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L6'>stream-empty?</a> s: (addr stream _)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L106" class="LineNr">106 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L30'>stream-full?</a> s: (addr stream _)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L107" class="LineNr">107 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L60'>stream-to-array</a> in: (addr stream _), out: (addr handle array _)
<span id="L108" class="LineNr">108 </span><span class="PreProc">sig</span> <a href='310copy-bytes.subx.html#L124'>unquote-stream-to-array</a> in: (addr stream _), out: (addr handle array _)
<span id="L109" class="LineNr">109 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L154'>stream-first</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: byte
<span id="L110" class="LineNr">110 </span><span class="PreProc">sig</span> <a href='309stream.subx.html#L181'>stream-final</a> s: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: byte
<span id="L111" class="LineNr">111 </span>
<span id="L112" class="LineNr">112 </span><span class="muComment">#sig copy-bytes src: (addr byte), dest: (addr byte), n: int</span>
<span id="L113" class="LineNr">113 </span><span class="PreProc">sig</span> <a href='312copy.subx.html#L3'>copy-array-object</a> src: (addr array _), dest-ah: (addr handle array _)
<span id="L114" class="LineNr">114 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L5'>array-equal?</a> a: (addr array int), b: (addr array int)<span class="PreProc"> -&gt; </span>_/eax: boolean
<span id="L115" class="LineNr">115 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L368'>parse-array-of-ints</a> s: (addr array byte), out: (addr handle array int)
<span id="L116" class="LineNr">116 </span><span class="PreProc">sig</span> <a href='311decimal-int.subx.html#L623'>parse-array-of-decimal-ints</a> s: (addr array byte), out: (addr handle array int)
<span id="L117" class="LineNr">117 </span><span class="PreProc">sig</span> <a href='301array-equal.subx.html#L382'>check-array-equal</a> a: (addr array int), expected: (addr string), msg: (addr string)
<span id="L118" class="LineNr">118 </span>
<span id="L119" class="LineNr">119 </span><span class="PreProc">sig</span> <a href='314divide.subx.html#L3'>integer-divide</a> a: int, b: int<span class="PreProc"> -&gt; </span>_/eax: int, _/<span class="muRegEdx">edx</span>: int
</pre>
</body>
</html>

View File

@ -1,34 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 403unicode.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

20
html/408float.mu.html generated
View File

@ -1,31 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 408float.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

22
html/411string.mu.html generated
View File

@ -1,35 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 411string.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.CommentedCode { color: #8a8a8a; }
.muRegEcx { color: #870000; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.CommentedCode { color: #8a8a8a; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muTest { color: #5f8700; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,36 +1,36 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 412render-float-decimal.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.LineNr { }
.muRegEdi { color: #00af00; }
.muRegEsi { color: #005faf; }
.muRegEbx { color: #5f00ff; }
.muRegEdi { color: #00af00; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Special { color: #ff6060; }
.muTest { color: #5f8700; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,35 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 500fake-screen.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.LineNr { }
.muRegEsi { color: #005faf; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,35 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 501draw-text.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.muRegEbx { color: #5f00ff; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

18
html/502test.mu.html generated
View File

@ -1,31 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 502test.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muTest { color: #5f8700; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 503manhattan-line.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,13 +16,13 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.LineNr { }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,36 +1,36 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 504test-screen.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.muRegEbx { color: #5f00ff; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muTest { color: #5f8700; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

618
html/505colors.mu.html generated
View File

@ -1,35 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 505colors.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.muRegEsi { color: #005faf; }
.muRegEbx { color: #5f00ff; }
.Delimiter { color: #c000c0; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.muRegEbx { color: #5f00ff; }
.muRegEsi { color: #005faf; }
.muRegEdi { color: #00af00; }
.Constant { color: #008787; }
.Special { color: #ff6060; }
.PreProc { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muTest { color: #5f8700; }
.muComment { color: #005faf; }
.CommentedCode { color: #8a8a8a; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -61,240 +63,364 @@ if ('onhashchange' in window) {
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/505colors.mu'>https://github.com/akkartik/mu/blob/main/505colors.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Hue/saturation/luminance for an rgb triple.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># rgb are in [0, 256)</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># hsl are also returned in [0, 256)</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># from <a href="https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl">https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl</a></span>
<span id="L5" class="LineNr"> 5 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L5'>hsl</a></span> r: int, g: int, b: int<span class="PreProc"> -&gt; </span>_/<span class="muRegEcx">ecx</span>: int, _/<span class="muRegEdx">edx</span>: int, _/<span class="muRegEbx">ebx</span>: int <span class="Delimiter">{</span>
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> _max/eax: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L216'>maximum</a> r, g
<span id="L7" class="LineNr"> 7 </span> _max <span class="Special">&lt;-</span> <a href='505colors.mu.html#L216'>maximum</a> _max, b
<span id="L8" class="LineNr"> 8 </span> <span class="PreProc">var</span> max/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy _max
<span id="L9" class="LineNr"> 9 </span> <span class="PreProc">var</span> _min/eax: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L226'>minimum</a> r, g
<span id="L10" class="LineNr"> 10 </span> _min <span class="Special">&lt;-</span> <a href='505colors.mu.html#L226'>minimum</a> _min, b
<span id="L11" class="LineNr"> 11 </span> <span class="PreProc">var</span> min/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy _min
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">var</span> luminance/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy min
<span id="L13" class="LineNr"> 13 </span> luminance <span class="Special">&lt;-</span> add max
<span id="L14" class="LineNr"> 14 </span> luminance <span class="Special">&lt;-</span> shift-right <span class="Constant">1</span> <span class="muComment"># TODO: round up instead of down</span>
<span id="L15" class="LineNr"> 15 </span> <span class="muComment"># if rgb are all equal, it's a shade of grey</span>
<span id="L16" class="LineNr"> 16 </span> compare min, max
<span id="L17" class="LineNr"> 17 </span> <span class="Delimiter">{</span>
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">break-if-!=</span>
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">return</span> <span class="Constant">0</span>, <span class="Constant">0</span>, luminance
<span id="L20" class="LineNr"> 20 </span> <span class="Delimiter">}</span>
<span id="L21" class="LineNr"> 21 </span> <span class="muComment"># saturation =</span>
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># luminance &lt; 128 | 255*(max-min)/ (max+min)</span>
<span id="L23" class="LineNr"> 23 </span> <span class="muComment"># otherwise | 255*(max-min)/(2*255 - (max+min))</span>
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> nr/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> copy max
<span id="L25" class="LineNr"> 25 </span> nr <span class="Special">&lt;-</span> subtract min
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> dr/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L27" class="LineNr"> 27 </span> compare luminance, <span class="Constant">0x80</span>
<span id="L28" class="LineNr"> 28 </span> <span class="Delimiter">{</span>
<span id="L29" class="LineNr"> 29 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L30" class="LineNr"> 30 </span> dr <span class="Special">&lt;-</span> copy max
<span id="L31" class="LineNr"> 31 </span> dr <span class="Special">&lt;-</span> add min
<span id="L32" class="LineNr"> 32 </span> <span class="Delimiter">}</span>
<span id="L33" class="LineNr"> 33 </span> <span class="Delimiter">{</span>
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L35" class="LineNr"> 35 </span> dr <span class="Special">&lt;-</span> copy <span class="Constant">0xff</span>
<span id="L36" class="LineNr"> 36 </span> dr <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>
<span id="L37" class="LineNr"> 37 </span> dr <span class="Special">&lt;-</span> subtract max
<span id="L38" class="LineNr"> 38 </span> dr <span class="Special">&lt;-</span> subtract min
<span id="L39" class="LineNr"> 39 </span> <span class="Delimiter">}</span>
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> q/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert nr
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> tmp/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert dr
<span id="L42" class="LineNr"> 42 </span> q <span class="Special">&lt;-</span> divide tmp
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> int-255/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0xff</span>
<span id="L44" class="LineNr"> 44 </span> tmp <span class="Special">&lt;-</span> convert int-255
<span id="L45" class="LineNr"> 45 </span> q <span class="Special">&lt;-</span> multiply tmp
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> saturation/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> convert q
<span id="L47" class="LineNr"> 47 </span> <span class="muComment"># hue = </span>
<span id="L48" class="LineNr"> 48 </span> <span class="muComment"># red is max | 256.0/6* (g-b)/(max-min)</span>
<span id="L49" class="LineNr"> 49 </span> <span class="muComment"># green is max | 256.0/6*(2.0 + (b-r)/(max-min))</span>
<span id="L50" class="LineNr"> 50 </span> <span class="muComment"># blue is max | 256.0/6*(4.0 + (r-g)/(max-min))</span>
<span id="L51" class="LineNr"> 51 </span> <span class="PreProc">var</span> zero/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> hue-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert zero
<span id="L53" class="LineNr"> 53 </span> <span class="PreProc">var</span> dr/eax: int <span class="Special">&lt;-</span> copy max
<span id="L54" class="LineNr"> 54 </span> dr <span class="Special">&lt;-</span> subtract min
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> dr-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert dr
<span id="L56" class="LineNr"> 56 </span> $hsl:compute-hue-normalized: <span class="Delimiter">{</span>
<span id="L57" class="LineNr"> 57 </span> compare r, max
<span id="L58" class="LineNr"> 58 </span> <span class="Delimiter">{</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">break-if-!=</span>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> nr/eax: int <span class="Special">&lt;-</span> copy g
<span id="L61" class="LineNr"> 61 </span> nr <span class="Special">&lt;-</span> subtract b
<span id="L62" class="LineNr"> 62 </span> hue-f <span class="Special">&lt;-</span> convert nr
<span id="L63" class="LineNr"> 63 </span> hue-f <span class="Special">&lt;-</span> divide dr-f
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
<span id="L65" class="LineNr"> 65 </span> <span class="Delimiter">}</span>
<span id="L66" class="LineNr"> 66 </span> compare g, max
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">{</span>
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">break-if-!=</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> nr/eax: int <span class="Special">&lt;-</span> copy b
<span id="L70" class="LineNr"> 70 </span> nr <span class="Special">&lt;-</span> subtract r
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert nr
<span id="L72" class="LineNr"> 72 </span> f <span class="Special">&lt;-</span> divide dr-f
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> two/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L74" class="LineNr"> 74 </span> hue-f <span class="Special">&lt;-</span> convert two
<span id="L75" class="LineNr"> 75 </span> hue-f <span class="Special">&lt;-</span> add f
<span id="L76" class="LineNr"> 76 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">}</span>
<span id="L78" class="LineNr"> 78 </span> compare b, max
<span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">{</span>
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">break-if-!=</span>
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">var</span> nr/eax: int <span class="Special">&lt;-</span> copy r
<span id="L82" class="LineNr"> 82 </span> nr <span class="Special">&lt;-</span> subtract g
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">var</span> f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert nr
<span id="L84" class="LineNr"> 84 </span> f <span class="Special">&lt;-</span> divide dr-f
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">var</span> two/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">4</span>
<span id="L86" class="LineNr"> 86 </span> hue-f <span class="Special">&lt;-</span> convert two
<span id="L87" class="LineNr"> 87 </span> hue-f <span class="Special">&lt;-</span> add f
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
<span id="L89" class="LineNr"> 89 </span> <span class="Delimiter">}</span>
<span id="L90" class="LineNr"> 90 </span> <span class="Delimiter">}</span>
<span id="L91" class="LineNr"> 91 </span> <span class="PreProc">var</span> int-256/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0x100</span>
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> scaling-factor/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert int-256
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> int-6/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">6</span>
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> six-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert int-6
<span id="L95" class="LineNr"> 95 </span> scaling-factor <span class="Special">&lt;-</span> divide six-f
<span id="L96" class="LineNr"> 96 </span> hue-f <span class="Special">&lt;-</span> multiply scaling-factor
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> hue/eax: int <span class="Special">&lt;-</span> convert hue-f
<span id="L98" class="LineNr"> 98 </span> <span class="muComment"># if hue &lt; 0, hue = 256 - hue</span>
<span id="L99" class="LineNr"> 99 </span> compare hue, <span class="Constant">0</span>
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">{</span>
<span id="L101" class="LineNr">101 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> tmp/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x100</span>
<span id="L103" class="LineNr">103 </span> tmp <span class="Special">&lt;-</span> subtract hue
<span id="L104" class="LineNr">104 </span> hue <span class="Special">&lt;-</span> copy tmp
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">}</span>
<span id="L106" class="LineNr">106 </span> <span class="PreProc">return</span> hue, saturation, luminance
<span id="L107" class="LineNr">107 </span><span class="Delimiter">}</span>
<span id="L108" class="LineNr">108 </span>
<span id="L109" class="LineNr">109 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L109'>test-hsl-black</a></span> <span class="Delimiter">{</span>
<span id="L110" class="LineNr">110 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L111" class="LineNr">111 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L112" class="LineNr">112 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L113" class="LineNr">113 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L114" class="LineNr">114 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L109'>test-hsl-black</a>/hue&quot;</span>
<span id="L115" class="LineNr">115 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L109'>test-hsl-black</a>/saturation&quot;</span>
<span id="L116" class="LineNr">116 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L109'>test-hsl-black</a>/luminance&quot;</span>
<span id="L117" class="LineNr">117 </span><span class="Delimiter">}</span>
<span id="L118" class="LineNr">118 </span>
<span id="L119" class="LineNr">119 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L119'>test-hsl-white</a></span> <span class="Delimiter">{</span>
<span id="L120" class="LineNr">120 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L121" class="LineNr">121 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L122" class="LineNr">122 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L123" class="LineNr">123 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0xff</span>, <span class="Constant">0xff</span>
<span id="L124" class="LineNr">124 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L119'>test-hsl-white</a>/hue&quot;</span>
<span id="L125" class="LineNr">125 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L119'>test-hsl-white</a>/saturation&quot;</span>
<span id="L126" class="LineNr">126 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L119'>test-hsl-white</a>/luminance&quot;</span>
<span id="L127" class="LineNr">127 </span><span class="Delimiter">}</span>
<span id="L128" class="LineNr">128 </span>
<span id="L129" class="LineNr">129 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L129'>test-hsl-grey</a></span> <span class="Delimiter">{</span>
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L132" class="LineNr">132 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L133" class="LineNr">133 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0x30</span>, <span class="Constant">0x30</span>, <span class="Constant">0x30</span>
<span id="L134" class="LineNr">134 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L129'>test-hsl-grey</a>/hue&quot;</span>
<span id="L135" class="LineNr">135 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L129'>test-hsl-grey</a>/saturation&quot;</span>
<span id="L136" class="LineNr">136 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x30</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L129'>test-hsl-grey</a>/luminance&quot;</span>
<span id="L137" class="LineNr">137 </span><span class="Delimiter">}</span>
<span id="L138" class="LineNr">138 </span>
<span id="L139" class="LineNr">139 </span><span class="muComment"># red hues: 0-0x54</span>
<span id="L140" class="LineNr">140 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L140'>test-hsl-slightly-red</a></span> <span class="Delimiter">{</span>
<span id="L141" class="LineNr">141 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L144" class="LineNr">144 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0xfe</span>, <span class="Constant">0xfe</span>
<span id="L145" class="LineNr">145 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L140'>test-hsl-slightly-red</a>/hue&quot;</span>
<span id="L146" class="LineNr">146 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L140'>test-hsl-slightly-red</a>/saturation&quot;</span>
<span id="L147" class="LineNr">147 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xfe</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L140'>test-hsl-slightly-red</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L148" class="LineNr">148 </span><span class="Delimiter">}</span>
<span id="L149" class="LineNr">149 </span>
<span id="L150" class="LineNr">150 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L150'>test-hsl-extremely-red</a></span> <span class="Delimiter">{</span>
<span id="L151" class="LineNr">151 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L153" class="LineNr">153 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L154" class="LineNr">154 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L155" class="LineNr">155 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L150'>test-hsl-extremely-red</a>/hue&quot;</span>
<span id="L156" class="LineNr">156 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L150'>test-hsl-extremely-red</a>/saturation&quot;</span>
<span id="L157" class="LineNr">157 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L150'>test-hsl-extremely-red</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L158" class="LineNr">158 </span><span class="Delimiter">}</span>
<span id="L159" class="LineNr">159 </span>
<span id="L160" class="LineNr">160 </span><span class="muComment"># green hues: 0x55-0xaa</span>
<span id="L161" class="LineNr">161 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L161'>test-hsl-slightly-green</a></span> <span class="Delimiter">{</span>
<span id="L162" class="LineNr">162 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L164" class="LineNr">164 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L165" class="LineNr">165 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xfe</span>, <span class="Constant">0xff</span>, <span class="Constant">0xfe</span>
<span id="L166" class="LineNr">166 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0x55</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L161'>test-hsl-slightly-green</a>/hue&quot;</span>
<span id="L167" class="LineNr">167 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L161'>test-hsl-slightly-green</a>/saturation&quot;</span>
<span id="L168" class="LineNr">168 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xfe</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L161'>test-hsl-slightly-green</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L169" class="LineNr">169 </span><span class="Delimiter">}</span>
<span id="L170" class="LineNr">170 </span>
<span id="L171" class="LineNr">171 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L171'>test-hsl-extremely-green</a></span> <span class="Delimiter">{</span>
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L173" class="LineNr">173 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L174" class="LineNr">174 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L175" class="LineNr">175 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0</span>
<span id="L176" class="LineNr">176 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0x55</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L171'>test-hsl-extremely-green</a>/hue&quot;</span>
<span id="L177" class="LineNr">177 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L171'>test-hsl-extremely-green</a>/saturation&quot;</span>
<span id="L178" class="LineNr">178 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L171'>test-hsl-extremely-green</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L179" class="LineNr">179 </span><span class="Delimiter">}</span>
<span id="L180" class="LineNr">180 </span>
<span id="L181" class="LineNr">181 </span><span class="muComment"># blue hues: 0xab-0xff</span>
<span id="L182" class="LineNr">182 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a></span> <span class="Delimiter">{</span>
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L185" class="LineNr">185 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L186" class="LineNr">186 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0xfe</span>, <span class="Constant">0xfe</span>, <span class="Constant">0xff</span>
<span id="L187" class="LineNr">187 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0xab</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a>/hue&quot;</span>
<span id="L188" class="LineNr">188 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a>/saturation&quot;</span>
<span id="L189" class="LineNr">189 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xfe</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L182'>test-hsl-slightly-blue</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L190" class="LineNr">190 </span><span class="Delimiter">}</span>
<span id="L191" class="LineNr">191 </span>
<span id="L192" class="LineNr">192 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a></span> <span class="Delimiter">{</span>
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L196" class="LineNr">196 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0</span>, <span class="Constant">0xff</span>
<span id="L197" class="LineNr">197 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0xab</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a>/hue&quot;</span>
<span id="L198" class="LineNr">198 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a>/saturation&quot;</span>
<span id="L199" class="LineNr">199 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L192'>test-hsl-extremely-blue</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L200" class="LineNr">200 </span><span class="Delimiter">}</span>
<span id="L201" class="LineNr">201 </span>
<span id="L202" class="LineNr">202 </span><span class="muComment"># cyan: 0x7f</span>
<span id="L203" class="LineNr">203 </span>
<span id="L204" class="LineNr">204 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L204'>test-hsl-cyan</a></span> <span class="Delimiter">{</span>
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L208" class="LineNr">208 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0xff</span>
<span id="L209" class="LineNr">209 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0x80</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L204'>test-hsl-cyan</a>/hue&quot;</span>
<span id="L210" class="LineNr">210 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L204'>test-hsl-cyan</a>/saturation&quot;</span>
<span id="L211" class="LineNr">211 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L204'>test-hsl-cyan</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L212" class="LineNr">212 </span><span class="Delimiter">}</span>
<span id="L213" class="LineNr">213 </span>
<span id="L214" class="LineNr">214 </span><span class="muComment">###</span>
<span id="L215" class="LineNr">215 </span>
<span id="L216" class="LineNr">216 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L216'>maximum</a></span> a: int, b: int<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> a2/eax: int <span class="Special">&lt;-</span> copy a
<span id="L218" class="LineNr">218 </span> compare a2, b
<span id="L219" class="LineNr">219 </span> <span class="Delimiter">{</span>
<span id="L220" class="LineNr">220 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L221" class="LineNr">221 </span> <span class="PreProc">return</span> a
<span id="L222" class="LineNr">222 </span> <span class="Delimiter">}</span>
<span id="L223" class="LineNr">223 </span> <span class="PreProc">return</span> b
<span id="L224" class="LineNr">224 </span><span class="Delimiter">}</span>
<span id="L225" class="LineNr">225 </span>
<span id="L226" class="LineNr">226 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L226'>minimum</a></span> a: int, b: int<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> a2/eax: int <span class="Special">&lt;-</span> copy a
<span id="L228" class="LineNr">228 </span> compare a2, b
<span id="L229" class="LineNr">229 </span> <span class="Delimiter">{</span>
<span id="L230" class="LineNr">230 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L231" class="LineNr">231 </span> <span class="PreProc">return</span> a
<span id="L232" class="LineNr">232 </span> <span class="Delimiter">}</span>
<span id="L233" class="LineNr">233 </span> <span class="PreProc">return</span> b
<span id="L234" class="LineNr">234 </span><span class="Delimiter">}</span>
<span id="L1" class="LineNr"> 1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L1'>nearest-color-euclidean</a></span> r: int, g: int, b: int<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L2" class="LineNr"> 2 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x100</span>/invalid
<span id="L3" class="LineNr"> 3 </span> <span class="PreProc">var</span> max-distance/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x30000</span>/max <span class="muComment"># 3 * 0x100*0x100</span>
<span id="L4" class="LineNr"> 4 </span> <span class="PreProc">var</span> r2/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L5" class="LineNr"> 5 </span> <span class="PreProc">var</span> g2/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L6" class="LineNr"> 6 </span> <span class="PreProc">var</span> b2/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L7" class="LineNr"> 7 </span> <span class="PreProc">var</span> color/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L8" class="LineNr"> 8 </span> <span class="Delimiter">{</span>
<span id="L9" class="LineNr"> 9 </span> compare color, <span class="Constant">0x100</span>
<span id="L10" class="LineNr"> 10 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L11" class="LineNr"> 11 </span> $nearest-color-euclidean:body: <span class="Delimiter">{</span>
<span id="L12" class="LineNr"> 12 </span> r2, g2, b2 <span class="Special">&lt;-</span> <a href='316colors.subx.html#L7'>color-rgb</a> color
<span id="L13" class="LineNr"> 13 </span> <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> <span class="PreProc">var</span> curr-distance/eax: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L27'>euclidean-distance-squared</a> r, g, b, r2, g2, b2
<span id="L15" class="LineNr"> 15 </span> compare curr-distance, max-distance
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">break-if-&gt;=</span> $nearest-color-euclidean:body
<span id="L17" class="LineNr"> 17 </span> max-distance <span class="Special">&lt;-</span> copy curr-distance
<span id="L18" class="LineNr"> 18 </span> <span class="Delimiter">}</span>
<span id="L19" class="LineNr"> 19 </span> result <span class="Special">&lt;-</span> copy color
<span id="L20" class="LineNr"> 20 </span> <span class="Delimiter">}</span>
<span id="L21" class="LineNr"> 21 </span> color <span class="Special">&lt;-</span> increment
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">loop</span>
<span id="L23" class="LineNr"> 23 </span> <span class="Delimiter">}</span>
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">return</span> result
<span id="L25" class="LineNr"> 25 </span><span class="Delimiter">}</span>
<span id="L26" class="LineNr"> 26 </span>
<span id="L27" class="LineNr"> 27 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L27'>euclidean-distance-squared</a></span> r1: int, g1: int, b1: int, r2: int, g2: int, b2: int<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L29" class="LineNr"> 29 </span> <span class="muComment"># red</span>
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> tmp/eax: int <span class="Special">&lt;-</span> copy r1
<span id="L31" class="LineNr"> 31 </span> tmp <span class="Special">&lt;-</span> subtract r2
<span id="L32" class="LineNr"> 32 </span> tmp <span class="Special">&lt;-</span> multiply tmp
<span id="L33" class="LineNr"> 33 </span> result <span class="Special">&lt;-</span> add tmp
<span id="L34" class="LineNr"> 34 </span> <span class="muComment"># green</span>
<span id="L35" class="LineNr"> 35 </span> tmp <span class="Special">&lt;-</span> copy g1
<span id="L36" class="LineNr"> 36 </span> tmp <span class="Special">&lt;-</span> subtract g2
<span id="L37" class="LineNr"> 37 </span> tmp <span class="Special">&lt;-</span> multiply tmp
<span id="L38" class="LineNr"> 38 </span> result <span class="Special">&lt;-</span> add tmp
<span id="L39" class="LineNr"> 39 </span> <span class="muComment"># blue</span>
<span id="L40" class="LineNr"> 40 </span> tmp <span class="Special">&lt;-</span> copy b1
<span id="L41" class="LineNr"> 41 </span> tmp <span class="Special">&lt;-</span> subtract b2
<span id="L42" class="LineNr"> 42 </span> tmp <span class="Special">&lt;-</span> multiply tmp
<span id="L43" class="LineNr"> 43 </span> result <span class="Special">&lt;-</span> add tmp
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">return</span> result
<span id="L45" class="LineNr"> 45 </span><span class="Delimiter">}</span>
<span id="L46" class="LineNr"> 46 </span>
<span id="L47" class="LineNr"> 47 </span><span class="muComment"># Hue/saturation/luminance for an rgb triple.</span>
<span id="L48" class="LineNr"> 48 </span><span class="muComment"># rgb are in [0, 256)</span>
<span id="L49" class="LineNr"> 49 </span><span class="muComment"># hsl are also returned in [0, 256)</span>
<span id="L50" class="LineNr"> 50 </span><span class="muComment"># from <a href="https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl">https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl</a></span>
<span id="L51" class="LineNr"> 51 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L51'>hsl</a></span> r: int, g: int, b: int<span class="PreProc"> -&gt; </span>_/<span class="muRegEcx">ecx</span>: int, _/<span class="muRegEdx">edx</span>: int, _/<span class="muRegEbx">ebx</span>: int <span class="Delimiter">{</span>
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> _max/eax: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L340'>maximum</a> r, g
<span id="L53" class="LineNr"> 53 </span> _max <span class="Special">&lt;-</span> <a href='505colors.mu.html#L340'>maximum</a> _max, b
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> max/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy _max
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> _min/eax: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L350'>minimum</a> r, g
<span id="L56" class="LineNr"> 56 </span> _min <span class="Special">&lt;-</span> <a href='505colors.mu.html#L350'>minimum</a> _min, b
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">var</span> min/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy _min
<span id="L58" class="LineNr"> 58 </span> <span class="PreProc">var</span> luminance/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy min
<span id="L59" class="LineNr"> 59 </span> luminance <span class="Special">&lt;-</span> add max
<span id="L60" class="LineNr"> 60 </span> luminance <span class="Special">&lt;-</span> shift-right <span class="Constant">1</span> <span class="muComment"># TODO: round up instead of down</span>
<span id="L61" class="LineNr"> 61 </span> <span class="muComment"># if rgb are all equal, it's a shade of grey</span>
<span id="L62" class="LineNr"> 62 </span> compare min, max
<span id="L63" class="LineNr"> 63 </span> <span class="Delimiter">{</span>
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if-!=</span>
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">return</span> <span class="Constant">0</span>, <span class="Constant">0</span>, luminance
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">}</span>
<span id="L67" class="LineNr"> 67 </span> <span class="muComment"># saturation =</span>
<span id="L68" class="LineNr"> 68 </span> <span class="muComment"># luminance &lt; 128 | 255*(max-min)/ (max+min)</span>
<span id="L69" class="LineNr"> 69 </span> <span class="muComment"># otherwise | 255*(max-min)/(2*255 - (max+min))</span>
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> nr/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> copy max
<span id="L71" class="LineNr"> 71 </span> nr <span class="Special">&lt;-</span> subtract min
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> dr/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L73" class="LineNr"> 73 </span> compare luminance, <span class="Constant">0x80</span>
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">{</span>
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L76" class="LineNr"> 76 </span> dr <span class="Special">&lt;-</span> copy max
<span id="L77" class="LineNr"> 77 </span> dr <span class="Special">&lt;-</span> add min
<span id="L78" class="LineNr"> 78 </span> <span class="Delimiter">}</span>
<span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">{</span>
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L81" class="LineNr"> 81 </span> dr <span class="Special">&lt;-</span> copy <span class="Constant">0xff</span>
<span id="L82" class="LineNr"> 82 </span> dr <span class="Special">&lt;-</span> shift-left <span class="Constant">1</span>
<span id="L83" class="LineNr"> 83 </span> dr <span class="Special">&lt;-</span> subtract max
<span id="L84" class="LineNr"> 84 </span> dr <span class="Special">&lt;-</span> subtract min
<span id="L85" class="LineNr"> 85 </span> <span class="Delimiter">}</span>
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> q/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert nr
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> tmp/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert dr
<span id="L88" class="LineNr"> 88 </span> q <span class="Special">&lt;-</span> divide tmp
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> int-255/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0xff</span>
<span id="L90" class="LineNr"> 90 </span> tmp <span class="Special">&lt;-</span> convert int-255
<span id="L91" class="LineNr"> 91 </span> q <span class="Special">&lt;-</span> multiply tmp
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> saturation/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> convert q
<span id="L93" class="LineNr"> 93 </span> <span class="muComment"># hue = </span>
<span id="L94" class="LineNr"> 94 </span> <span class="muComment"># red is max | 256.0/6* (g-b)/(max-min)</span>
<span id="L95" class="LineNr"> 95 </span> <span class="muComment"># green is max | 256.0/6*(2.0 + (b-r)/(max-min))</span>
<span id="L96" class="LineNr"> 96 </span> <span class="muComment"># blue is max | 256.0/6*(4.0 + (r-g)/(max-min))</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> zero/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> hue-f/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert zero
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">var</span> dr/eax: int <span class="Special">&lt;-</span> copy max
<span id="L100" class="LineNr">100 </span> dr <span class="Special">&lt;-</span> subtract min
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> dr-f/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert dr
<span id="L102" class="LineNr">102 </span> $hsl:compute-hue-normalized: <span class="Delimiter">{</span>
<span id="L103" class="LineNr">103 </span> compare r, max
<span id="L104" class="LineNr">104 </span> <span class="Delimiter">{</span>
<span id="L105" class="LineNr">105 </span> <span class="PreProc">break-if-!=</span>
<span id="L106" class="LineNr">106 </span> <span class="PreProc">var</span> nr/eax: int <span class="Special">&lt;-</span> copy g
<span id="L107" class="LineNr">107 </span> nr <span class="Special">&lt;-</span> subtract b
<span id="L108" class="LineNr">108 </span> hue-f <span class="Special">&lt;-</span> convert nr
<span id="L109" class="LineNr">109 </span> hue-f <span class="Special">&lt;-</span> divide dr-f
<span id="L110" class="LineNr">110 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
<span id="L111" class="LineNr">111 </span> <span class="Delimiter">}</span>
<span id="L112" class="LineNr">112 </span> compare g, max
<span id="L113" class="LineNr">113 </span> <span class="Delimiter">{</span>
<span id="L114" class="LineNr">114 </span> <span class="PreProc">break-if-!=</span>
<span id="L115" class="LineNr">115 </span> <span class="PreProc">var</span> nr/eax: int <span class="Special">&lt;-</span> copy b
<span id="L116" class="LineNr">116 </span> nr <span class="Special">&lt;-</span> subtract r
<span id="L117" class="LineNr">117 </span> <span class="PreProc">var</span> f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert nr
<span id="L118" class="LineNr">118 </span> f <span class="Special">&lt;-</span> divide dr-f
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> two/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L120" class="LineNr">120 </span> hue-f <span class="Special">&lt;-</span> convert two
<span id="L121" class="LineNr">121 </span> hue-f <span class="Special">&lt;-</span> add f
<span id="L122" class="LineNr">122 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
<span id="L123" class="LineNr">123 </span> <span class="Delimiter">}</span>
<span id="L124" class="LineNr">124 </span> compare b, max
<span id="L125" class="LineNr">125 </span> <span class="Delimiter">{</span>
<span id="L126" class="LineNr">126 </span> <span class="PreProc">break-if-!=</span>
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> nr/eax: int <span class="Special">&lt;-</span> copy r
<span id="L128" class="LineNr">128 </span> nr <span class="Special">&lt;-</span> subtract g
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert nr
<span id="L130" class="LineNr">130 </span> f <span class="Special">&lt;-</span> divide dr-f
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> two/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">4</span>
<span id="L132" class="LineNr">132 </span> hue-f <span class="Special">&lt;-</span> convert two
<span id="L133" class="LineNr">133 </span> hue-f <span class="Special">&lt;-</span> add f
<span id="L134" class="LineNr">134 </span> <span class="PreProc">break</span> $hsl:compute-hue-normalized
<span id="L135" class="LineNr">135 </span> <span class="Delimiter">}</span>
<span id="L136" class="LineNr">136 </span> <span class="Delimiter">}</span>
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> int-256/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0x100</span>
<span id="L138" class="LineNr">138 </span> <span class="PreProc">var</span> scaling-factor/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> convert int-256
<span id="L139" class="LineNr">139 </span> <span class="PreProc">var</span> int-6/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">6</span>
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> six-f/<span class="Constant">xmm2</span>: float <span class="Special">&lt;-</span> convert int-6
<span id="L141" class="LineNr">141 </span> scaling-factor <span class="Special">&lt;-</span> divide six-f
<span id="L142" class="LineNr">142 </span> hue-f <span class="Special">&lt;-</span> multiply scaling-factor
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> hue/eax: int <span class="Special">&lt;-</span> convert hue-f
<span id="L144" class="LineNr">144 </span> <span class="muComment"># if hue &lt; 0, hue = 256 - hue</span>
<span id="L145" class="LineNr">145 </span> compare hue, <span class="Constant">0</span>
<span id="L146" class="LineNr">146 </span> <span class="Delimiter">{</span>
<span id="L147" class="LineNr">147 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> tmp/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x100</span>
<span id="L149" class="LineNr">149 </span> tmp <span class="Special">&lt;-</span> subtract hue
<span id="L150" class="LineNr">150 </span> hue <span class="Special">&lt;-</span> copy tmp
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">}</span>
<span id="L152" class="LineNr">152 </span> <span class="PreProc">return</span> hue, saturation, luminance
<span id="L153" class="LineNr">153 </span><span class="Delimiter">}</span>
<span id="L154" class="LineNr">154 </span>
<span id="L155" class="LineNr">155 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L155'>test-hsl-black</a></span> <span class="Delimiter">{</span>
<span id="L156" class="LineNr">156 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L157" class="LineNr">157 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L158" class="LineNr">158 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L159" class="LineNr">159 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L160" class="LineNr">160 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L155'>test-hsl-black</a>/hue&quot;</span>
<span id="L161" class="LineNr">161 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L155'>test-hsl-black</a>/saturation&quot;</span>
<span id="L162" class="LineNr">162 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L155'>test-hsl-black</a>/luminance&quot;</span>
<span id="L163" class="LineNr">163 </span><span class="Delimiter">}</span>
<span id="L164" class="LineNr">164 </span>
<span id="L165" class="LineNr">165 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L165'>test-hsl-white</a></span> <span class="Delimiter">{</span>
<span id="L166" class="LineNr">166 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L167" class="LineNr">167 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L168" class="LineNr">168 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L169" class="LineNr">169 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0xff</span>, <span class="Constant">0xff</span>
<span id="L170" class="LineNr">170 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L165'>test-hsl-white</a>/hue&quot;</span>
<span id="L171" class="LineNr">171 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L165'>test-hsl-white</a>/saturation&quot;</span>
<span id="L172" class="LineNr">172 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L165'>test-hsl-white</a>/luminance&quot;</span>
<span id="L173" class="LineNr">173 </span><span class="Delimiter">}</span>
<span id="L174" class="LineNr">174 </span>
<span id="L175" class="LineNr">175 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L175'>test-hsl-grey</a></span> <span class="Delimiter">{</span>
<span id="L176" class="LineNr">176 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L177" class="LineNr">177 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L178" class="LineNr">178 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L179" class="LineNr">179 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0x30</span>, <span class="Constant">0x30</span>, <span class="Constant">0x30</span>
<span id="L180" class="LineNr">180 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L175'>test-hsl-grey</a>/hue&quot;</span>
<span id="L181" class="LineNr">181 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L175'>test-hsl-grey</a>/saturation&quot;</span>
<span id="L182" class="LineNr">182 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x30</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L175'>test-hsl-grey</a>/luminance&quot;</span>
<span id="L183" class="LineNr">183 </span><span class="Delimiter">}</span>
<span id="L184" class="LineNr">184 </span>
<span id="L185" class="LineNr">185 </span><span class="muComment"># red hues: 0-0x54</span>
<span id="L186" class="LineNr">186 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L186'>test-hsl-slightly-red</a></span> <span class="Delimiter">{</span>
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L188" class="LineNr">188 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L189" class="LineNr">189 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L190" class="LineNr">190 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0xfe</span>, <span class="Constant">0xfe</span>
<span id="L191" class="LineNr">191 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L186'>test-hsl-slightly-red</a>/hue&quot;</span>
<span id="L192" class="LineNr">192 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L186'>test-hsl-slightly-red</a>/saturation&quot;</span>
<span id="L193" class="LineNr">193 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xfe</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L186'>test-hsl-slightly-red</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L194" class="LineNr">194 </span><span class="Delimiter">}</span>
<span id="L195" class="LineNr">195 </span>
<span id="L196" class="LineNr">196 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L196'>test-hsl-extremely-red</a></span> <span class="Delimiter">{</span>
<span id="L197" class="LineNr">197 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L198" class="LineNr">198 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L200" class="LineNr">200 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L201" class="LineNr">201 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L196'>test-hsl-extremely-red</a>/hue&quot;</span>
<span id="L202" class="LineNr">202 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L196'>test-hsl-extremely-red</a>/saturation&quot;</span>
<span id="L203" class="LineNr">203 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L196'>test-hsl-extremely-red</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L204" class="LineNr">204 </span><span class="Delimiter">}</span>
<span id="L205" class="LineNr">205 </span>
<span id="L206" class="LineNr">206 </span><span class="muComment"># green hues: 0x55-0xaa</span>
<span id="L207" class="LineNr">207 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L207'>test-hsl-slightly-green</a></span> <span class="Delimiter">{</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L210" class="LineNr">210 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L211" class="LineNr">211 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0xfe</span>, <span class="Constant">0xff</span>, <span class="Constant">0xfe</span>
<span id="L212" class="LineNr">212 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0x55</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L207'>test-hsl-slightly-green</a>/hue&quot;</span>
<span id="L213" class="LineNr">213 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L207'>test-hsl-slightly-green</a>/saturation&quot;</span>
<span id="L214" class="LineNr">214 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xfe</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L207'>test-hsl-slightly-green</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L215" class="LineNr">215 </span><span class="Delimiter">}</span>
<span id="L216" class="LineNr">216 </span>
<span id="L217" class="LineNr">217 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L217'>test-hsl-extremely-green</a></span> <span class="Delimiter">{</span>
<span id="L218" class="LineNr">218 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L219" class="LineNr">219 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L221" class="LineNr">221 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0</span>
<span id="L222" class="LineNr">222 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0x55</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L217'>test-hsl-extremely-green</a>/hue&quot;</span>
<span id="L223" class="LineNr">223 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L217'>test-hsl-extremely-green</a>/saturation&quot;</span>
<span id="L224" class="LineNr">224 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L217'>test-hsl-extremely-green</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L225" class="LineNr">225 </span><span class="Delimiter">}</span>
<span id="L226" class="LineNr">226 </span>
<span id="L227" class="LineNr">227 </span><span class="muComment"># blue hues: 0xab-0xff</span>
<span id="L228" class="LineNr">228 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L228'>test-hsl-slightly-blue</a></span> <span class="Delimiter">{</span>
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L230" class="LineNr">230 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L231" class="LineNr">231 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L232" class="LineNr">232 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0xfe</span>, <span class="Constant">0xfe</span>, <span class="Constant">0xff</span>
<span id="L233" class="LineNr">233 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0xab</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L228'>test-hsl-slightly-blue</a>/hue&quot;</span>
<span id="L234" class="LineNr">234 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L228'>test-hsl-slightly-blue</a>/saturation&quot;</span>
<span id="L235" class="LineNr">235 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0xfe</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L228'>test-hsl-slightly-blue</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L236" class="LineNr">236 </span><span class="Delimiter">}</span>
<span id="L237" class="LineNr">237 </span>
<span id="L238" class="LineNr">238 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L238'>test-hsl-extremely-blue</a></span> <span class="Delimiter">{</span>
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L240" class="LineNr">240 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L242" class="LineNr">242 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0</span>, <span class="Constant">0xff</span>
<span id="L243" class="LineNr">243 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0xab</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L238'>test-hsl-extremely-blue</a>/hue&quot;</span>
<span id="L244" class="LineNr">244 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L238'>test-hsl-extremely-blue</a>/saturation&quot;</span>
<span id="L245" class="LineNr">245 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L238'>test-hsl-extremely-blue</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L246" class="LineNr">246 </span><span class="Delimiter">}</span>
<span id="L247" class="LineNr">247 </span>
<span id="L248" class="LineNr">248 </span><span class="muComment"># cyan: 0x7f</span>
<span id="L249" class="LineNr">249 </span>
<span id="L250" class="LineNr">250 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L250'>test-hsl-cyan</a></span> <span class="Delimiter">{</span>
<span id="L251" class="LineNr">251 </span> <span class="PreProc">var</span> h/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L252" class="LineNr">252 </span> <span class="PreProc">var</span> s/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L253" class="LineNr">253 </span> <span class="PreProc">var</span> l/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L254" class="LineNr">254 </span> h, s, l <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0xff</span>
<span id="L255" class="LineNr">255 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> h, <span class="Constant">0x80</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L250'>test-hsl-cyan</a>/hue&quot;</span>
<span id="L256" class="LineNr">256 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> s, <span class="Constant">0xff</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L250'>test-hsl-cyan</a>/saturation&quot;</span>
<span id="L257" class="LineNr">257 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> l, <span class="Constant">0x7f</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L250'>test-hsl-cyan</a>/luminance&quot;</span> <span class="muComment"># TODO: should round up</span>
<span id="L258" class="LineNr">258 </span><span class="Delimiter">}</span>
<span id="L259" class="LineNr">259 </span>
<span id="L260" class="LineNr">260 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a></span> h: int, s: int, l: int<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L261" class="LineNr">261 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x100</span>/invalid
<span id="L262" class="LineNr">262 </span> <span class="PreProc">var</span> max-distance/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x30000</span>/max <span class="muComment"># 3 * 0x100*0x100</span>
<span id="L263" class="LineNr">263 </span> <span class="PreProc">var</span> a/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L264" class="LineNr">264 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L265" class="LineNr">265 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L266" class="LineNr">266 </span> <span class="PreProc">var</span> color/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L267" class="LineNr">267 </span> <span class="Delimiter">{</span>
<span id="L268" class="LineNr">268 </span> compare color, <span class="Constant">0x100</span>
<span id="L269" class="LineNr">269 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L270" class="LineNr">270 </span> $nearest-color-euclidean-hsl:body: <span class="Delimiter">{</span>
<span id="L271" class="LineNr">271 </span> a, b, c <span class="Special">&lt;-</span> <a href='316colors.subx.html#L7'>color-rgb</a> color
<span id="L272" class="LineNr">272 </span> a, b, c <span class="Special">&lt;-</span> <a href='505colors.mu.html#L51'>hsl</a> a, b, c
<span id="L273" class="LineNr">273 </span> <span class="Delimiter">{</span>
<span id="L274" class="LineNr">274 </span> <span class="PreProc">var</span> curr-distance/eax: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L316'>euclidean-hsl-squared</a> a, b, c, h, s, l
<span id="L275" class="LineNr">275 </span> compare curr-distance, max-distance
<span id="L276" class="LineNr">276 </span> <span class="PreProc">break-if-&gt;=</span> $nearest-color-euclidean-hsl:body
<span id="L277" class="LineNr">277 </span> max-distance <span class="Special">&lt;-</span> copy curr-distance
<span id="L278" class="LineNr">278 </span> <span class="Delimiter">}</span>
<span id="L279" class="LineNr">279 </span> result <span class="Special">&lt;-</span> copy color
<span id="L280" class="LineNr">280 </span> <span class="Delimiter">}</span>
<span id="L281" class="LineNr">281 </span> color <span class="Special">&lt;-</span> increment
<span id="L282" class="LineNr">282 </span> <span class="PreProc">loop</span>
<span id="L283" class="LineNr">283 </span> <span class="Delimiter">}</span>
<span id="L284" class="LineNr">284 </span> <span class="PreProc">return</span> result
<span id="L285" class="LineNr">285 </span><span class="Delimiter">}</span>
<span id="L286" class="LineNr">286 </span>
<span id="L287" class="LineNr">287 </span><span class="PreProc">fn</span> <span class="muTest"><a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a></span> <span class="Delimiter">{</span>
<span id="L288" class="LineNr">288 </span> <span class="muComment"># red from lightest to darkest</span>
<span id="L289" class="LineNr">289 </span> <span class="PreProc">var</span> red/eax: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0xff</span>
<span id="L290" class="LineNr">290 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">0x58</span>/<span class="Constant">88</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/full-red1&quot;</span>
<span id="L291" class="LineNr">291 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0xc0</span>
<span id="L292" class="LineNr">292 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">0x40</span>/<span class="Constant">64</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/full-red2&quot;</span>
<span id="L293" class="LineNr">293 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0x80</span>
<span id="L294" class="LineNr">294 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">0x28</span>/<span class="Constant">40</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/full-red3&quot;</span>
<span id="L295" class="LineNr">295 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0x40</span>
<span id="L296" class="LineNr">296 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">0x28</span>/<span class="Constant">40</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/full-red4&quot;</span>
<span id="L297" class="LineNr">297 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0xff</span>, <span class="Constant">0</span>
<span id="L298" class="LineNr">298 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">0x28</span>/<span class="Constant">40</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/full-red5&quot;</span>
<span id="L299" class="LineNr">299 </span> <span class="muComment"># try a number really close to red but on the other side of the cylinder</span>
<span id="L300" class="LineNr">300 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0xff</span>, <span class="Constant">0xff</span>, <span class="Constant">0xff</span>
<span id="L301" class="LineNr">301 </span><span class="CommentedCode">#? draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, red, 7/fg 0/bg</span>
<span id="L302" class="LineNr">302 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">0x57</span>/<span class="Constant">87</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/other-end-of-red&quot;</span> <span class="muComment"># still looks red</span>
<span id="L303" class="LineNr">303 </span> <span class="muComment"># half-saturation red from lightest to darkest</span>
<span id="L304" class="LineNr">304 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0x80</span>, <span class="Constant">0xff</span>
<span id="L305" class="LineNr">305 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">0xf</span>/<span class="Constant">15</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/half-red1&quot;</span> <span class="muComment"># ?? grey ??</span>
<span id="L306" class="LineNr">306 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0x80</span>, <span class="Constant">0xc0</span>
<span id="L307" class="LineNr">307 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">4</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/half-red2&quot;</span>
<span id="L308" class="LineNr">308 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0x80</span>, <span class="Constant">0x80</span>
<span id="L309" class="LineNr">309 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">4</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/half-red3&quot;</span>
<span id="L310" class="LineNr">310 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0x80</span>, <span class="Constant">0x40</span>
<span id="L311" class="LineNr">311 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">4</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/half-red4&quot;</span>
<span id="L312" class="LineNr">312 </span> red <span class="Special">&lt;-</span> <a href='505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> <span class="Constant">0</span>, <span class="Constant">0x80</span>, <span class="Constant">0</span>
<span id="L313" class="LineNr">313 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> red, <span class="Constant">0x70</span>/<span class="Constant">112</span>, <span class="Constant">&quot;F - <a href='505colors.mu.html#L287'>test-nearest-color-euclidean-hsl</a>/half-red5&quot;</span>
<span id="L314" class="LineNr">314 </span><span class="Delimiter">}</span>
<span id="L315" class="LineNr">315 </span>
<span id="L316" class="LineNr">316 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L316'>euclidean-hsl-squared</a></span> h1: int, s1: int, l1: int, h2: int, s2: int, l2: int<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L317" class="LineNr">317 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L318" class="LineNr">318 </span> <span class="muComment"># hue</span>
<span id="L319" class="LineNr">319 </span> <span class="PreProc">var</span> tmp/eax: int <span class="Special">&lt;-</span> copy h1
<span id="L320" class="LineNr">320 </span> tmp <span class="Special">&lt;-</span> subtract h2
<span id="L321" class="LineNr">321 </span> tmp <span class="Special">&lt;-</span> multiply tmp
<span id="L322" class="LineNr">322 </span> <span class="muComment"># TODO: should we do something to reflect that hue is a cylindrical space?</span>
<span id="L323" class="LineNr">323 </span> <span class="muComment"># I can't come up with a failing test.</span>
<span id="L324" class="LineNr">324 </span> result <span class="Special">&lt;-</span> add tmp
<span id="L325" class="LineNr">325 </span> <span class="muComment"># saturation</span>
<span id="L326" class="LineNr">326 </span> tmp <span class="Special">&lt;-</span> copy s1
<span id="L327" class="LineNr">327 </span> tmp <span class="Special">&lt;-</span> subtract s2
<span id="L328" class="LineNr">328 </span> tmp <span class="Special">&lt;-</span> multiply tmp
<span id="L329" class="LineNr">329 </span> result <span class="Special">&lt;-</span> add tmp
<span id="L330" class="LineNr">330 </span> <span class="muComment"># luminance</span>
<span id="L331" class="LineNr">331 </span> tmp <span class="Special">&lt;-</span> copy l1
<span id="L332" class="LineNr">332 </span> tmp <span class="Special">&lt;-</span> subtract l2
<span id="L333" class="LineNr">333 </span> tmp <span class="Special">&lt;-</span> multiply tmp
<span id="L334" class="LineNr">334 </span> result <span class="Special">&lt;-</span> add tmp
<span id="L335" class="LineNr">335 </span> <span class="PreProc">return</span> result
<span id="L336" class="LineNr">336 </span><span class="Delimiter">}</span>
<span id="L337" class="LineNr">337 </span>
<span id="L338" class="LineNr">338 </span><span class="muComment">###</span>
<span id="L339" class="LineNr">339 </span>
<span id="L340" class="LineNr">340 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L340'>maximum</a></span> a: int, b: int<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L341" class="LineNr">341 </span> <span class="PreProc">var</span> a2/eax: int <span class="Special">&lt;-</span> copy a
<span id="L342" class="LineNr">342 </span> compare a2, b
<span id="L343" class="LineNr">343 </span> <span class="Delimiter">{</span>
<span id="L344" class="LineNr">344 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L345" class="LineNr">345 </span> <span class="PreProc">return</span> a
<span id="L346" class="LineNr">346 </span> <span class="Delimiter">}</span>
<span id="L347" class="LineNr">347 </span> <span class="PreProc">return</span> b
<span id="L348" class="LineNr">348 </span><span class="Delimiter">}</span>
<span id="L349" class="LineNr">349 </span>
<span id="L350" class="LineNr">350 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='505colors.mu.html#L350'>minimum</a></span> a: int, b: int<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L351" class="LineNr">351 </span> <span class="PreProc">var</span> a2/eax: int <span class="Special">&lt;-</span> copy a
<span id="L352" class="LineNr">352 </span> compare a2, b
<span id="L353" class="LineNr">353 </span> <span class="Delimiter">{</span>
<span id="L354" class="LineNr">354 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L355" class="LineNr">355 </span> <span class="PreProc">return</span> a
<span id="L356" class="LineNr">356 </span> <span class="Delimiter">}</span>
<span id="L357" class="LineNr">357 </span> <span class="PreProc">return</span> b
<span id="L358" class="LineNr">358 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>

18
html/506math.mu.html generated
View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 506math.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,15 +16,15 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.LineNr { }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

24
html/507line.mu.html generated
View File

@ -1,33 +1,33 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 507line.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.LineNr { }
.Constant { color: #008787; }
.muRegEbx { color: #5f00ff; }
.muRegEdx { color: #af5f00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

20
html/508circle.mu.html generated
View File

@ -1,32 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 508circle.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

24
html/509bezier.mu.html generated
View File

@ -1,33 +1,33 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - 509bezier.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEbx { color: #5f00ff; }
.Constant { color: #008787; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.muRegEdx { color: #af5f00; }
.LineNr { }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,27 +1,24 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex1.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/*.subx</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.LineNr { }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -51,11 +48,9 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex1.mu'>https://github.com/akkartik/mu/blob/main/ex1.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/*.subx'>https://github.com/akkartik/mu/blob/main/apps/*.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr">1 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex1.mu.html#L1'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L2" class="LineNr">2 </span> <span class="PreProc">loop</span>
<span id="L3" class="LineNr">3 </span><span class="Delimiter">}</span>
<span id="L1" class="LineNr">1 </span>
</pre>
</body>
</html>

309
html/apps/colors.mu.html generated Normal file
View File

@ -0,0 +1,309 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mu - apps/colors.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.LineNr { }
.muRegEsi { color: #005faf; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.CommentedCode { color: #8a8a8a; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/apps/colors.mu'>https://github.com/akkartik/mu/blob/main/apps/colors.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Return colors 'near' a given r/g/b value (expressed in hex)</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># If we did this rigorously we'd need to implement cosines. So we won't.</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment">#</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># To build:</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># $ ./translate apps/colors.mu</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment">#</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Example session:</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space&gt; aa 0 aa</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># 5</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># This means only color 5 in the default palette is similar to #aa00aa.</span>
<span id="L12" class="LineNr"> 12 </span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L13'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> <span class="PreProc">var</span> in-storage: (stream byte <span class="Constant">0x10</span>)
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> in/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address in-storage
<span id="L16" class="LineNr"> 16 </span> <span class="Delimiter">{</span>
<span id="L17" class="LineNr"> 17 </span> <span class="muComment"># print prompt</span>
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> x/eax: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space&gt; &quot;</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x28</span>/y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L19" class="LineNr"> 19 </span> <span class="muComment"># read line from keyboard</span>
<span id="L20" class="LineNr"> 20 </span> <a href='../106stream.subx.html#L20'>clear-stream</a> in
<span id="L21" class="LineNr"> 21 </span> <span class="Delimiter">{</span>
<span id="L22" class="LineNr"> 22 </span> <a href='../500fake-screen.mu.html#L237'>draw-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='../102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L24" class="LineNr"> 24 </span> compare key, <span class="Constant">0xa</span>/newline
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">break-if-=</span>
<span id="L26" class="LineNr"> 26 </span> compare key, <span class="Constant">0</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">loop-if-=</span>
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> key2/eax: int <span class="Special">&lt;-</span> copy key
<span id="L29" class="LineNr"> 29 </span> <a href='../115write-byte.subx.html#L12'>append-byte</a> in, key2
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special">&lt;-</span> copy key2
<span id="L31" class="LineNr"> 31 </span> <a href='../501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, g, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
<span id="L32" class="LineNr"> 32 </span> <a href='../501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">loop</span>
<span id="L34" class="LineNr"> 34 </span> <span class="Delimiter">}</span>
<span id="L35" class="LineNr"> 35 </span> <a href='../500fake-screen.mu.html#L251'>clear-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L36" class="LineNr"> 36 </span> <span class="muComment"># parse</span>
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> a/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L40" class="LineNr"> 40 </span> <span class="muComment"># a, b, c = r, g, b</span>
<span id="L41" class="LineNr"> 41 </span> a, b, c <span class="Special">&lt;-</span> <a href='colors.mu.html#L65'>parse</a> in
<span id="L42" class="LineNr"> 42 </span><span class="CommentedCode">#? set-cursor-position screen, 0x10/x, 0x1a/y</span>
<span id="L43" class="LineNr"> 43 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, a, 7/fg, 0/bg</span>
<span id="L44" class="LineNr"> 44 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L45" class="LineNr"> 45 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, b, 7/fg, 0/bg</span>
<span id="L46" class="LineNr"> 46 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L47" class="LineNr"> 47 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, c, 7/fg, 0/bg</span>
<span id="L48" class="LineNr"> 48 </span> a, b, c <span class="Special">&lt;-</span> <a href='../505colors.mu.html#L51'>hsl</a> a, b, c
<span id="L49" class="LineNr"> 49 </span> <span class="muComment"># return all colors in the same quadrant in h, s and l</span>
<span id="L50" class="LineNr"> 50 </span> <a href='colors.mu.html#L189'>print-nearby-colors</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, a, b, c
<span id="L51" class="LineNr"> 51 </span> <span class="muComment"># another metric</span>
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">var</span> color/eax: int <span class="Special">&lt;-</span> <a href='../505colors.mu.html#L260'>nearest-color-euclidean-hsl</a> a, b, c
<span id="L53" class="LineNr"> 53 </span> <a href='../500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/x, <span class="Constant">0x26</span>/y
<span id="L54" class="LineNr"> 54 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;nearest (euclidean, h/s/l): &quot;</span>, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
<span id="L55" class="LineNr"> 55 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L56" class="LineNr"> 56 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
<span id="L57" class="LineNr"> 57 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0</span>/fg, color
<span id="L58" class="LineNr"> 58 </span> <span class="muComment">#</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">loop</span>
<span id="L60" class="LineNr"> 60 </span> <span class="Delimiter">}</span>
<span id="L61" class="LineNr"> 61 </span><span class="Delimiter">}</span>
<span id="L62" class="LineNr"> 62 </span>
<span id="L63" class="LineNr"> 63 </span><span class="muComment"># read exactly 3 words in a single line</span>
<span id="L64" class="LineNr"> 64 </span><span class="muComment"># Each word consists of exactly 1 or 2 hex bytes. No hex prefix.</span>
<span id="L65" class="LineNr"> 65 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L65'>parse</a></span> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="muRegEcx">ecx</span>: int, _/<span class="muRegEdx">edx</span>: int, _/<span class="muRegEbx">ebx</span>: int <span class="Delimiter">{</span>
<span id="L66" class="LineNr"> 66 </span> <span class="muComment"># read first byte of r</span>
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special">&lt;-</span> <a href='../112read-byte.subx.html#L13'>read-byte</a> in
<span id="L68" class="LineNr"> 68 </span> <span class="Delimiter">{</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='../118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L70" class="LineNr"> 70 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">break-if-!=</span>
<span id="L72" class="LineNr"> 72 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid byte 0 of r&quot;</span>
<span id="L73" class="LineNr"> 73 </span> <span class="Delimiter">}</span>
<span id="L74" class="LineNr"> 74 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L176'>fast-hex-digit-value</a> tmp
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> r/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L76" class="LineNr"> 76 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x10/y</span>
<span id="L77" class="LineNr"> 77 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, r, 7/fg, 0/bg</span>
<span id="L78" class="LineNr"> 78 </span> <span class="muComment"># read second byte of r</span>
<span id="L79" class="LineNr"> 79 </span> tmp <span class="Special">&lt;-</span> <a href='../112read-byte.subx.html#L13'>read-byte</a> in
<span id="L80" class="LineNr"> 80 </span> <span class="Delimiter">{</span>
<span id="L81" class="LineNr"> 81 </span> <span class="Delimiter">{</span>
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='../118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L83" class="LineNr"> 83 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L84" class="LineNr"> 84 </span> <span class="Delimiter">}</span>
<span id="L85" class="LineNr"> 85 </span> <span class="PreProc">break-if-=</span>
<span id="L86" class="LineNr"> 86 </span> r <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>
<span id="L87" class="LineNr"> 87 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L176'>fast-hex-digit-value</a> tmp
<span id="L88" class="LineNr"> 88 </span><span class="CommentedCode">#? {</span>
<span id="L89" class="LineNr"> 89 </span><span class="CommentedCode">#? var foo/eax: int &lt;- copy tmp</span>
<span id="L90" class="LineNr"> 90 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x11/y</span>
<span id="L91" class="LineNr"> 91 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg, 0/bg</span>
<span id="L92" class="LineNr"> 92 </span><span class="CommentedCode">#? }</span>
<span id="L93" class="LineNr"> 93 </span> r <span class="Special">&lt;-</span> add tmp
<span id="L94" class="LineNr"> 94 </span><span class="CommentedCode">#? {</span>
<span id="L95" class="LineNr"> 95 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x12/y</span>
<span id="L96" class="LineNr"> 96 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, r, 7/fg, 0/bg</span>
<span id="L97" class="LineNr"> 97 </span><span class="CommentedCode">#? }</span>
<span id="L98" class="LineNr"> 98 </span> tmp <span class="Special">&lt;-</span> <a href='../112read-byte.subx.html#L13'>read-byte</a> in <span class="muComment"># skip space</span>
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">}</span>
<span id="L100" class="LineNr">100 </span> <span class="muComment"># read first byte of g</span>
<span id="L101" class="LineNr">101 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special">&lt;-</span> <a href='../112read-byte.subx.html#L13'>read-byte</a> in
<span id="L102" class="LineNr">102 </span> <span class="Delimiter">{</span>
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='../118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L104" class="LineNr">104 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L105" class="LineNr">105 </span> <span class="PreProc">break-if-!=</span>
<span id="L106" class="LineNr">106 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid byte 0 of g&quot;</span>
<span id="L107" class="LineNr">107 </span> <span class="Delimiter">}</span>
<span id="L108" class="LineNr">108 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L176'>fast-hex-digit-value</a> tmp
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> g/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L110" class="LineNr">110 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x13/y</span>
<span id="L111" class="LineNr">111 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, g, 7/fg, 0/bg</span>
<span id="L112" class="LineNr">112 </span> <span class="muComment"># read second byte of g</span>
<span id="L113" class="LineNr">113 </span> tmp <span class="Special">&lt;-</span> <a href='../112read-byte.subx.html#L13'>read-byte</a> in
<span id="L114" class="LineNr">114 </span> <span class="Delimiter">{</span>
<span id="L115" class="LineNr">115 </span> <span class="Delimiter">{</span>
<span id="L116" class="LineNr">116 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='../118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L117" class="LineNr">117 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L118" class="LineNr">118 </span> <span class="Delimiter">}</span>
<span id="L119" class="LineNr">119 </span> <span class="PreProc">break-if-=</span>
<span id="L120" class="LineNr">120 </span> g <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>
<span id="L121" class="LineNr">121 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L176'>fast-hex-digit-value</a> tmp
<span id="L122" class="LineNr">122 </span><span class="CommentedCode">#? {</span>
<span id="L123" class="LineNr">123 </span><span class="CommentedCode">#? var foo/eax: int &lt;- copy tmp</span>
<span id="L124" class="LineNr">124 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x14/y</span>
<span id="L125" class="LineNr">125 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg, 0/bg</span>
<span id="L126" class="LineNr">126 </span><span class="CommentedCode">#? }</span>
<span id="L127" class="LineNr">127 </span> g <span class="Special">&lt;-</span> add tmp
<span id="L128" class="LineNr">128 </span><span class="CommentedCode">#? {</span>
<span id="L129" class="LineNr">129 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x15/y</span>
<span id="L130" class="LineNr">130 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, g, 7/fg, 0/bg</span>
<span id="L131" class="LineNr">131 </span><span class="CommentedCode">#? }</span>
<span id="L132" class="LineNr">132 </span> tmp <span class="Special">&lt;-</span> <a href='../112read-byte.subx.html#L13'>read-byte</a> in <span class="muComment"># skip space</span>
<span id="L133" class="LineNr">133 </span> <span class="Delimiter">}</span>
<span id="L134" class="LineNr">134 </span> <span class="muComment"># read first byte of b</span>
<span id="L135" class="LineNr">135 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special">&lt;-</span> <a href='../112read-byte.subx.html#L13'>read-byte</a> in
<span id="L136" class="LineNr">136 </span> <span class="Delimiter">{</span>
<span id="L137" class="LineNr">137 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='../118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L138" class="LineNr">138 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L139" class="LineNr">139 </span> <span class="PreProc">break-if-!=</span>
<span id="L140" class="LineNr">140 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid byte 0 of b&quot;</span>
<span id="L141" class="LineNr">141 </span> <span class="Delimiter">}</span>
<span id="L142" class="LineNr">142 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L176'>fast-hex-digit-value</a> tmp
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> b/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L144" class="LineNr">144 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x16/y</span>
<span id="L145" class="LineNr">145 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, b, 7/fg, 0/bg</span>
<span id="L146" class="LineNr">146 </span> <span class="muComment"># read second byte of b</span>
<span id="L147" class="LineNr">147 </span> <span class="Delimiter">{</span>
<span id="L148" class="LineNr">148 </span> <span class="Delimiter">{</span>
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special">&lt;-</span> <a href='../309stream.subx.html#L6'>stream-empty?</a> in
<span id="L150" class="LineNr">150 </span> compare done?, <span class="Constant">0</span>/false
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">}</span>
<span id="L152" class="LineNr">152 </span> <span class="PreProc">break-if-!=</span>
<span id="L153" class="LineNr">153 </span> tmp <span class="Special">&lt;-</span> <a href='../112read-byte.subx.html#L13'>read-byte</a> in
<span id="L154" class="LineNr">154 </span> <span class="Delimiter">{</span>
<span id="L155" class="LineNr">155 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='../118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L156" class="LineNr">156 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L157" class="LineNr">157 </span> <span class="Delimiter">}</span>
<span id="L158" class="LineNr">158 </span> <span class="PreProc">break-if-=</span>
<span id="L159" class="LineNr">159 </span> b <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>
<span id="L160" class="LineNr">160 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L176'>fast-hex-digit-value</a> tmp
<span id="L161" class="LineNr">161 </span><span class="CommentedCode">#? {</span>
<span id="L162" class="LineNr">162 </span><span class="CommentedCode">#? var foo/eax: int &lt;- copy tmp</span>
<span id="L163" class="LineNr">163 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x17/y</span>
<span id="L164" class="LineNr">164 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg, 0/bg</span>
<span id="L165" class="LineNr">165 </span><span class="CommentedCode">#? }</span>
<span id="L166" class="LineNr">166 </span> b <span class="Special">&lt;-</span> add tmp
<span id="L167" class="LineNr">167 </span><span class="CommentedCode">#? {</span>
<span id="L168" class="LineNr">168 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x18/y</span>
<span id="L169" class="LineNr">169 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, b, 7/fg, 0/bg</span>
<span id="L170" class="LineNr">170 </span><span class="CommentedCode">#? }</span>
<span id="L171" class="LineNr">171 </span> <span class="Delimiter">}</span>
<span id="L172" class="LineNr">172 </span> <span class="PreProc">return</span> r, g, b
<span id="L173" class="LineNr">173 </span><span class="Delimiter">}</span>
<span id="L174" class="LineNr">174 </span>
<span id="L175" class="LineNr">175 </span><span class="muComment"># no error checking</span>
<span id="L176" class="LineNr">176 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L176'>fast-hex-digit-value</a></span> in: byte<span class="PreProc"> -&gt; </span>_/eax: byte <span class="Delimiter">{</span>
<span id="L177" class="LineNr">177 </span> <span class="PreProc">var</span> result/eax: byte <span class="Special">&lt;-</span> copy in
<span id="L178" class="LineNr">178 </span> compare result, <span class="Constant">0x39</span>
<span id="L179" class="LineNr">179 </span> <span class="Delimiter">{</span>
<span id="L180" class="LineNr">180 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L181" class="LineNr">181 </span> result <span class="Special">&lt;-</span> subtract <span class="Constant">0x30</span>/<span class="Constant">0</span>
<span id="L182" class="LineNr">182 </span> <span class="PreProc">return</span> result
<span id="L183" class="LineNr">183 </span> <span class="Delimiter">}</span>
<span id="L184" class="LineNr">184 </span> result <span class="Special">&lt;-</span> subtract <span class="Constant">0x61</span>/a
<span id="L185" class="LineNr">185 </span> result <span class="Special">&lt;-</span> add <span class="Constant">0xa</span>/<span class="Constant">10</span>
<span id="L186" class="LineNr">186 </span> <span class="PreProc">return</span> result
<span id="L187" class="LineNr">187 </span><span class="Delimiter">}</span>
<span id="L188" class="LineNr">188 </span>
<span id="L189" class="LineNr">189 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L189'>print-nearby-colors</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), h: int, s: int, l: int <span class="Delimiter">{</span>
<span id="L190" class="LineNr">190 </span><span class="CommentedCode">#? set-cursor-position screen, 0x10/x, 0x1c/y</span>
<span id="L191" class="LineNr">191 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, h, 7/fg, 0/bg</span>
<span id="L192" class="LineNr">192 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L193" class="LineNr">193 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, s, 7/fg, 0/bg</span>
<span id="L194" class="LineNr">194 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L195" class="LineNr">195 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, l, 7/fg, 0/bg</span>
<span id="L196" class="LineNr">196 </span> <span class="muComment"># save just top 2 bits of each, so that we narrow down to 1/64th of the volume</span>
<span id="L197" class="LineNr">197 </span> shift-right h, <span class="Constant">6</span>
<span id="L198" class="LineNr">198 </span> shift-right s, <span class="Constant">6</span>
<span id="L199" class="LineNr">199 </span> shift-right l, <span class="Constant">6</span>
<span id="L200" class="LineNr">200 </span><span class="CommentedCode">#? set-cursor-position screen, 0x10/x, 0x1/y</span>
<span id="L201" class="LineNr">201 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, h, 7/fg, 0/bg</span>
<span id="L202" class="LineNr">202 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L203" class="LineNr">203 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, s, 7/fg, 0/bg</span>
<span id="L204" class="LineNr">204 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L205" class="LineNr">205 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, l, 7/fg, 0/bg</span>
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> a/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L209" class="LineNr">209 </span> <span class="PreProc">var</span> color/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L210" class="LineNr">210 </span> <span class="PreProc">var</span> y/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L211" class="LineNr">211 </span> <span class="Delimiter">{</span>
<span id="L212" class="LineNr">212 </span> compare color, <span class="Constant">0x100</span>
<span id="L213" class="LineNr">213 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L214" class="LineNr">214 </span> a, b, c <span class="Special">&lt;-</span> <a href='../316colors.subx.html#L7'>color-rgb</a> color
<span id="L215" class="LineNr">215 </span> a, b, c <span class="Special">&lt;-</span> <a href='../505colors.mu.html#L51'>hsl</a> a, b, c
<span id="L216" class="LineNr">216 </span> a <span class="Special">&lt;-</span> shift-right <span class="Constant">6</span>
<span id="L217" class="LineNr">217 </span> b <span class="Special">&lt;-</span> shift-right <span class="Constant">6</span>
<span id="L218" class="LineNr">218 </span> c <span class="Special">&lt;-</span> shift-right <span class="Constant">6</span>
<span id="L219" class="LineNr">219 </span> <span class="Delimiter">{</span>
<span id="L220" class="LineNr">220 </span> compare a, h
<span id="L221" class="LineNr">221 </span> <span class="PreProc">break-if-!=</span>
<span id="L222" class="LineNr">222 </span> compare b, s
<span id="L223" class="LineNr">223 </span> <span class="PreProc">break-if-!=</span>
<span id="L224" class="LineNr">224 </span> compare c, l
<span id="L225" class="LineNr">225 </span> <span class="PreProc">break-if-!=</span>
<span id="L226" class="LineNr">226 </span> <a href='../500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/x, y
<span id="L227" class="LineNr">227 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L228" class="LineNr">228 </span> <a href='../500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x14</span>/x, y
<span id="L229" class="LineNr">229 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L230" class="LineNr">230 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0</span>/fg, color
<span id="L231" class="LineNr">231 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L232" class="LineNr">232 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, a, 7/fg, 0/bg</span>
<span id="L233" class="LineNr">233 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L234" class="LineNr">234 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, b, 7/fg, 0/bg</span>
<span id="L235" class="LineNr">235 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L236" class="LineNr">236 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, c, 7/fg, 0/bg</span>
<span id="L237" class="LineNr">237 </span> y <span class="Special">&lt;-</span> increment
<span id="L238" class="LineNr">238 </span> <span class="Delimiter">}</span>
<span id="L239" class="LineNr">239 </span> color <span class="Special">&lt;-</span> increment
<span id="L240" class="LineNr">240 </span> <span class="PreProc">loop</span>
<span id="L241" class="LineNr">241 </span> <span class="Delimiter">}</span>
<span id="L242" class="LineNr">242 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

74
html/apps/ex1.mu.html generated Normal file
View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mu - apps/ex1.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.LineNr { }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
-->
</style>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex1.mu'>https://github.com/akkartik/mu/blob/main/apps/ex1.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># The simplest possible bare-metal program.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate apps/ex1.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># bochs -f bochsrc # bochsrc loads code.img</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment">#</span>
<span id="L10" class="LineNr">10 </span><span class="muComment"># Expected output: blank screen with no errors</span>
<span id="L11" class="LineNr">11 </span>
<span id="L12" class="LineNr">12 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex1.mu.html#L12'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L13" class="LineNr">13 </span> <span class="PreProc">loop</span>
<span id="L14" class="LineNr">14 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

View File

@ -1,31 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex10.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/ex10.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.muRegEcx { color: #870000; }
.LineNr { }
.Constant { color: #008787; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -55,12 +55,12 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex10.mu'>https://github.com/akkartik/mu/blob/main/ex10.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex10.mu'>https://github.com/akkartik/mu/blob/main/apps/ex10.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Demo of mouse support.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate ex10.mu # emits code.img</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate apps/ex10.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
@ -70,12 +70,12 @@ if ('onhashchange' in window) {
<span id="L11" class="LineNr">11 </span><span class="muComment"># Values between -256 and +255 as you move the mouse over the window.</span>
<span id="L12" class="LineNr">12 </span><span class="muComment"># You might need to click on the window once.</span>
<span id="L13" class="LineNr">13 </span>
<span id="L14" class="LineNr">14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex10.mu.html#L14'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr">14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex10.mu.html#L14'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L15" class="LineNr">15 </span> <span class="muComment"># repeatedly print out mouse driver results if non-zero</span>
<span id="L16" class="LineNr">16 </span> $main:event-loop: <span class="Delimiter">{</span>
<span id="L17" class="LineNr">17 </span> <span class="PreProc">var</span> dx/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> dy/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L19" class="LineNr">19 </span> dx, dy <span class="Special">&lt;-</span> <a href='boot.subx.html#L1443'>read-mouse-event</a>
<span id="L19" class="LineNr">19 </span> dx, dy <span class="Special">&lt;-</span> read-mouse-event
<span id="L20" class="LineNr">20 </span> <span class="Delimiter">{</span>
<span id="L21" class="LineNr">21 </span> compare dx, <span class="Constant">0</span>
<span id="L22" class="LineNr">22 </span> <span class="PreProc">break-if-!=</span>
@ -86,15 +86,15 @@ if ('onhashchange' in window) {
<span id="L27" class="LineNr">27 </span> <span class="Delimiter">{</span>
<span id="L28" class="LineNr">28 </span> <span class="PreProc">var</span> dummy1/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L29" class="LineNr">29 </span> <span class="PreProc">var</span> dummy2/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L30" class="LineNr">30 </span> dummy1, dummy2 <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L256'>draw-text-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L30" class="LineNr">30 </span> dummy1, dummy2 <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L256'>draw-text-wrapping-right-then-down-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L31" class="LineNr">31 </span> <span class="Delimiter">}</span>
<span id="L32" class="LineNr">32 </span> <span class="Delimiter">{</span>
<span id="L33" class="LineNr">33 </span> <span class="PreProc">var</span> dummy/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L34" class="LineNr">34 </span> dx, dummy <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, dx, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L34" class="LineNr">34 </span> dx, dummy <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, dx, <span class="Constant">0</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L35" class="LineNr">35 </span> <span class="Delimiter">}</span>
<span id="L36" class="LineNr">36 </span> <span class="Delimiter">{</span>
<span id="L37" class="LineNr">37 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L38" class="LineNr">38 </span> dummy, dy <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, dy, <span class="Constant">5</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L38" class="LineNr">38 </span> dummy, dy <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L364'>draw-int32-decimal-wrapping-right-then-down-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, dy, <span class="Constant">5</span>/x, <span class="Constant">0x10</span>/y, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L39" class="LineNr">39 </span> <span class="Delimiter">}</span>
<span id="L40" class="LineNr">40 </span> <span class="PreProc">loop</span>
<span id="L41" class="LineNr">41 </span> <span class="Delimiter">}</span>

View File

@ -1,35 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex11.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/ex11.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.LineNr { }
.muRegEsi { color: #005faf; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -59,12 +59,12 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex11.mu'>https://github.com/akkartik/mu/blob/main/ex11.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex11.mu'>https://github.com/akkartik/mu/blob/main/apps/ex11.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Demo of an interactive app: controlling a Bezier curve on screen</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate ex11.mu # emits code.img</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate apps/ex11.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
@ -74,12 +74,12 @@ if ('onhashchange' in window) {
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># between control points, and arrow keys to move the control point at the</span>
<span id="L12" class="LineNr"> 12 </span><span class="muComment"># cursor.</span>
<span id="L13" class="LineNr"> 13 </span>
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L14'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L14'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> env-storage: <a href='ex11.mu.html#L25'>environment</a>
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> env/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> address env-storage
<span id="L17" class="LineNr"> 17 </span> <a href='ex11.mu.html#L233'>initialize-environment</a> env, <span class="Constant">0x200</span> <span class="Constant">0x20</span>, <span class="Constant">0x180</span> <span class="Constant">0x90</span>, <span class="Constant">0x180</span> <span class="Constant">0x160</span>
<span id="L18" class="LineNr"> 18 </span> <span class="Delimiter">{</span>
<span id="L19" class="LineNr"> 19 </span> <a href='ex11.mu.html#L37'>render</a> <a href='500fake-screen.mu.html#L14'>screen</a>, env
<span id="L19" class="LineNr"> 19 </span> <a href='ex11.mu.html#L37'>render</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, env
<span id="L20" class="LineNr"> 20 </span> <a href='ex11.mu.html#L101'>edit</a> keyboard, env
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">loop</span>
<span id="L22" class="LineNr"> 22 </span> <span class="Delimiter">}</span>
@ -97,34 +97,34 @@ if ('onhashchange' in window) {
<span id="L34" class="LineNr"> 34 </span> y: int
<span id="L35" class="LineNr"> 35 </span><span class="Delimiter">}</span>
<span id="L36" class="LineNr"> 36 </span>
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L37'>render</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L38" class="LineNr"> 38 </span> <a href='500fake-screen.mu.html#L251'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L37" class="LineNr"> 37 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L37'>render</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L38" class="LineNr"> 38 </span> <a href='../500fake-screen.mu.html#L251'>clear-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> tmp-ah/<span class="muRegEcx">ecx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p0
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> tmp/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">var</span> tmp/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *tmp-ah
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> p0/<span class="muRegEbx">ebx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy tmp
<span id="L43" class="LineNr"> 43 </span> tmp-ah <span class="Special">&lt;-</span> get self, p1
<span id="L44" class="LineNr"> 44 </span> tmp <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
<span id="L44" class="LineNr"> 44 </span> tmp <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *tmp-ah
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> p1/<span class="muRegEdx">edx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy tmp
<span id="L46" class="LineNr"> 46 </span> tmp-ah <span class="Special">&lt;-</span> get self, p2
<span id="L47" class="LineNr"> 47 </span> tmp <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *tmp-ah
<span id="L47" class="LineNr"> 47 </span> tmp <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *tmp-ah
<span id="L48" class="LineNr"> 48 </span> <span class="PreProc">var</span> p2/<span class="muRegEcx">ecx</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy tmp
<span id="L49" class="LineNr"> 49 </span> <span class="muComment"># control lines</span>
<span id="L50" class="LineNr"> 50 </span> <a href='ex11.mu.html#L216'>line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p0, p1, <span class="Constant">7</span>/color
<span id="L51" class="LineNr"> 51 </span> <a href='ex11.mu.html#L216'>line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p1, p2, <span class="Constant">7</span>/color
<span id="L50" class="LineNr"> 50 </span> <a href='ex11.mu.html#L216'>line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, p0, p1, <span class="Constant">7</span>/color
<span id="L51" class="LineNr"> 51 </span> <a href='ex11.mu.html#L216'>line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, p1, p2, <span class="Constant">7</span>/color
<span id="L52" class="LineNr"> 52 </span> <span class="muComment"># curve above control lines</span>
<span id="L53" class="LineNr"> 53 </span> <a href='ex11.mu.html#L64'>bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p0, p1, p2, <span class="Constant">0xc</span>/color
<span id="L53" class="LineNr"> 53 </span> <a href='ex11.mu.html#L64'>bezier</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, p0, p1, p2, <span class="Constant">0xc</span>/color
<span id="L54" class="LineNr"> 54 </span> <span class="muComment"># points above curve</span>
<span id="L55" class="LineNr"> 55 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p0, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
<span id="L56" class="LineNr"> 56 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p1, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
<span id="L57" class="LineNr"> 57 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, p2, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
<span id="L55" class="LineNr"> 55 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, p0, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
<span id="L56" class="LineNr"> 56 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, p1, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
<span id="L57" class="LineNr"> 57 </span> <a href='ex11.mu.html#L226'>disc</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, p2, <span class="Constant">3</span>/radius, <span class="Constant">7</span>/color <span class="Constant">0xf</span>/border
<span id="L58" class="LineNr"> 58 </span> <span class="muComment"># cursor last of all</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> cursor-ah/eax: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L61" class="LineNr"> 61 </span> <a href='ex11.mu.html#L77'>cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <a href='ex11.mu.html#L77'>cursor</a>, <span class="Constant">0xa</span>/side, <span class="Constant">3</span>/color
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L61" class="LineNr"> 61 </span> <a href='ex11.mu.html#L77'>cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <a href='ex11.mu.html#L77'>cursor</a>, <span class="Constant">0xa</span>/side, <span class="Constant">3</span>/color
<span id="L62" class="LineNr"> 62 </span><span class="Delimiter">}</span>
<span id="L63" class="LineNr"> 63 </span>
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L64'>bezier</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p0: (addr <a href='ex11.mu.html#L32'>point</a>), _p1: (addr <a href='ex11.mu.html#L32'>point</a>), _p2: (addr <a href='ex11.mu.html#L32'>point</a>), color: int <span class="Delimiter">{</span>
<span id="L64" class="LineNr"> 64 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L64'>bezier</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _p0: (addr <a href='ex11.mu.html#L32'>point</a>), _p1: (addr <a href='ex11.mu.html#L32'>point</a>), _p2: (addr <a href='ex11.mu.html#L32'>point</a>), color: int <span class="Delimiter">{</span>
<span id="L65" class="LineNr"> 65 </span> <span class="PreProc">var</span> p0/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p0
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> x0/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special">&lt;-</span> get p0, x
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> y0/<span class="muRegEdx">edx</span>: (addr int) <span class="Special">&lt;-</span> get p0, y
@ -134,10 +134,10 @@ if ('onhashchange' in window) {
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">var</span> p2/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p2
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> x2/<span class="muRegEdi">edi</span>: (addr int) <span class="Special">&lt;-</span> get p2, x
<span id="L73" class="LineNr"> 73 </span> <span class="PreProc">var</span> y2/<span class="muRegEsi">esi</span>: (addr int) <span class="Special">&lt;-</span> get p2, y
<span id="L74" class="LineNr"> 74 </span> <a href='509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *x0 *y0, *x1 *y1, *x2 *y2, color
<span id="L74" class="LineNr"> 74 </span> <a href='../509bezier.mu.html#L14'>draw-monotonic-bezier</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *x0 *y0, *x1 *y1, *x2 *y2, color
<span id="L75" class="LineNr"> 75 </span><span class="Delimiter">}</span>
<span id="L76" class="LineNr"> 76 </span>
<span id="L77" class="LineNr"> 77 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L77'>cursor</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p: (addr <a href='ex11.mu.html#L32'>point</a>), side: int, color: int <span class="Delimiter">{</span>
<span id="L77" class="LineNr"> 77 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L77'>cursor</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _p: (addr <a href='ex11.mu.html#L32'>point</a>), side: int, color: int <span class="Delimiter">{</span>
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> half-side/eax: int <span class="Special">&lt;-</span> copy side
<span id="L79" class="LineNr"> 79 </span> half-side <span class="Special">&lt;-</span> shift-right <span class="Constant">1</span>
<span id="L80" class="LineNr"> 80 </span> <span class="PreProc">var</span> p/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p
@ -149,21 +149,21 @@ if ('onhashchange' in window) {
<span id="L86" class="LineNr"> 86 </span> top-y <span class="Special">&lt;-</span> subtract half-side
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> max/eax: int <span class="Special">&lt;-</span> copy left-x
<span id="L88" class="LineNr"> 88 </span> max <span class="Special">&lt;-</span> add side
<span id="L89" class="LineNr"> 89 </span> <a href='507line.mu.html#L64'>draw-horizontal-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, top-y, left-x, max, color
<span id="L89" class="LineNr"> 89 </span> <a href='../507line.mu.html#L64'>draw-horizontal-line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, top-y, left-x, max, color
<span id="L90" class="LineNr"> 90 </span> max <span class="Special">&lt;-</span> copy top-y
<span id="L91" class="LineNr"> 91 </span> max <span class="Special">&lt;-</span> add side
<span id="L92" class="LineNr"> 92 </span> <a href='507line.mu.html#L75'>draw-vertical-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, left-x, top-y, max, color
<span id="L92" class="LineNr"> 92 </span> <a href='../507line.mu.html#L75'>draw-vertical-line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, left-x, top-y, max, color
<span id="L93" class="LineNr"> 93 </span> <span class="PreProc">var</span> right-x/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy left-x
<span id="L94" class="LineNr"> 94 </span> right-x <span class="Special">&lt;-</span> add side
<span id="L95" class="LineNr"> 95 </span> <a href='507line.mu.html#L75'>draw-vertical-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, right-x, top-y, max, color
<span id="L95" class="LineNr"> 95 </span> <a href='../507line.mu.html#L75'>draw-vertical-line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, right-x, top-y, max, color
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> bottom-y/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy top-y
<span id="L97" class="LineNr"> 97 </span> bottom-y <span class="Special">&lt;-</span> add side
<span id="L98" class="LineNr"> 98 </span> <a href='507line.mu.html#L64'>draw-horizontal-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, bottom-y, left-x, right-x, color
<span id="L98" class="LineNr"> 98 </span> <a href='../507line.mu.html#L64'>draw-horizontal-line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, bottom-y, left-x, right-x, color
<span id="L99" class="LineNr"> 99 </span><span class="Delimiter">}</span>
<span id="L100" class="LineNr">100 </span>
<span id="L101" class="LineNr">101 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L101'>edit</a></span> keyboard: (addr keyboard), _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L103" class="LineNr">103 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='../102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L104" class="LineNr">104 </span> compare key, <span class="Constant">0</span>
<span id="L105" class="LineNr">105 </span> <span class="PreProc">loop-if-=</span>
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">{</span>
@ -205,33 +205,33 @@ if ('onhashchange' in window) {
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> p1-ah/<span class="muRegEdx">edx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p1
<span id="L143" class="LineNr">143 </span> <span class="PreProc">var</span> p2-ah/<span class="muRegEbx">ebx</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p2
<span id="L144" class="LineNr">144 </span> <span class="Delimiter">{</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> p0?/eax: boolean <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p0-ah, *cursor-ah
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> p0?/eax: boolean <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L448'>handle-equal?</a> *p0-ah, *cursor-ah
<span id="L146" class="LineNr">146 </span> compare p0?, <span class="Constant">0</span>/false
<span id="L147" class="LineNr">147 </span> <span class="PreProc">break-if-=</span>
<span id="L148" class="LineNr">148 </span> copy-object p1-ah, cursor-ah
<span id="L149" class="LineNr">149 </span> <span class="PreProc">return</span>
<span id="L150" class="LineNr">150 </span> <span class="Delimiter">}</span>
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">{</span>
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> p1?/eax: boolean <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p1-ah, *cursor-ah
<span id="L152" class="LineNr">152 </span> <span class="PreProc">var</span> p1?/eax: boolean <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L448'>handle-equal?</a> *p1-ah, *cursor-ah
<span id="L153" class="LineNr">153 </span> compare p1?, <span class="Constant">0</span>/false
<span id="L154" class="LineNr">154 </span> <span class="PreProc">break-if-=</span>
<span id="L155" class="LineNr">155 </span> copy-object p2-ah, cursor-ah
<span id="L156" class="LineNr">156 </span> <span class="PreProc">return</span>
<span id="L157" class="LineNr">157 </span> <span class="Delimiter">}</span>
<span id="L158" class="LineNr">158 </span> <span class="Delimiter">{</span>
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> p2?/eax: boolean <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L448'>handle-equal?</a> *p2-ah, *cursor-ah
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> p2?/eax: boolean <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L448'>handle-equal?</a> *p2-ah, *cursor-ah
<span id="L160" class="LineNr">160 </span> compare p2?, <span class="Constant">0</span>/false
<span id="L161" class="LineNr">161 </span> <span class="PreProc">break-if-=</span>
<span id="L162" class="LineNr">162 </span> copy-object p0-ah, cursor-ah
<span id="L163" class="LineNr">163 </span> <span class="PreProc">return</span>
<span id="L164" class="LineNr">164 </span> <span class="Delimiter">}</span>
<span id="L165" class="LineNr">165 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;lost cursor&quot;</span>
<span id="L165" class="LineNr">165 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;lost cursor&quot;</span>
<span id="L166" class="LineNr">166 </span><span class="Delimiter">}</span>
<span id="L167" class="LineNr">167 </span>
<span id="L168" class="LineNr">168 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L168'>cursor-left</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEsi">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L172" class="LineNr">172 </span> <span class="PreProc">var</span> cursor-x/eax: (addr int) <span class="Special">&lt;-</span> get <a href='ex11.mu.html#L77'>cursor</a>, x
<span id="L173" class="LineNr">173 </span> compare *cursor-x, <span class="Constant">0x20</span>
<span id="L174" class="LineNr">174 </span> <span class="Delimiter">{</span>
@ -243,7 +243,7 @@ if ('onhashchange' in window) {
<span id="L180" class="LineNr">180 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L180'>cursor-right</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L181" class="LineNr">181 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L182" class="LineNr">182 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEsi">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L183" class="LineNr">183 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L184" class="LineNr">184 </span> <span class="PreProc">var</span> cursor-x/eax: (addr int) <span class="Special">&lt;-</span> get <a href='ex11.mu.html#L77'>cursor</a>, x
<span id="L185" class="LineNr">185 </span> compare *cursor-x, <span class="Constant">0x3f0</span>
<span id="L186" class="LineNr">186 </span> <span class="Delimiter">{</span>
@ -255,7 +255,7 @@ if ('onhashchange' in window) {
<span id="L192" class="LineNr">192 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L192'>cursor-up</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L193" class="LineNr">193 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L194" class="LineNr">194 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEsi">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L196" class="LineNr">196 </span> <span class="PreProc">var</span> cursor-y/eax: (addr int) <span class="Special">&lt;-</span> get <a href='ex11.mu.html#L77'>cursor</a>, y
<span id="L197" class="LineNr">197 </span> compare *cursor-y, <span class="Constant">0x20</span>
<span id="L198" class="LineNr">198 </span> <span class="Delimiter">{</span>
@ -267,7 +267,7 @@ if ('onhashchange' in window) {
<span id="L204" class="LineNr">204 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L204'>cursor-down</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Delimiter">{</span>
<span id="L205" class="LineNr">205 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L206" class="LineNr">206 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEsi">esi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L207" class="LineNr">207 </span> <span class="PreProc">var</span> <a href='ex11.mu.html#L77'>cursor</a>/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *cursor-ah
<span id="L208" class="LineNr">208 </span> <span class="PreProc">var</span> cursor-y/eax: (addr int) <span class="Special">&lt;-</span> get <a href='ex11.mu.html#L77'>cursor</a>, y
<span id="L209" class="LineNr">209 </span> compare *cursor-y, <span class="Constant">0x2f0</span>
<span id="L210" class="LineNr">210 </span> <span class="Delimiter">{</span>
@ -276,36 +276,36 @@ if ('onhashchange' in window) {
<span id="L213" class="LineNr">213 </span> <span class="Delimiter">}</span>
<span id="L214" class="LineNr">214 </span><span class="Delimiter">}</span>
<span id="L215" class="LineNr">215 </span>
<span id="L216" class="LineNr">216 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L216'>line</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p0: (addr <a href='ex11.mu.html#L32'>point</a>), _p1: (addr <a href='ex11.mu.html#L32'>point</a>), color: int <span class="Delimiter">{</span>
<span id="L216" class="LineNr">216 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L216'>line</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _p0: (addr <a href='ex11.mu.html#L32'>point</a>), _p1: (addr <a href='ex11.mu.html#L32'>point</a>), color: int <span class="Delimiter">{</span>
<span id="L217" class="LineNr">217 </span> <span class="PreProc">var</span> p0/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p0
<span id="L218" class="LineNr">218 </span> <span class="PreProc">var</span> x0/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special">&lt;-</span> get p0, x
<span id="L219" class="LineNr">219 </span> <span class="PreProc">var</span> y0/<span class="muRegEdx">edx</span>: (addr int) <span class="Special">&lt;-</span> get p0, y
<span id="L220" class="LineNr">220 </span> <span class="PreProc">var</span> p1/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p1
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> x1/<span class="muRegEbx">ebx</span>: (addr int) <span class="Special">&lt;-</span> get p1, x
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> y1/eax: (addr int) <span class="Special">&lt;-</span> get p1, y
<span id="L223" class="LineNr">223 </span> <a href='507line.mu.html#L1'>draw-line</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *x0 *y0, *x1 *y1, color
<span id="L223" class="LineNr">223 </span> <a href='../507line.mu.html#L1'>draw-line</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *x0 *y0, *x1 *y1, color
<span id="L224" class="LineNr">224 </span><span class="Delimiter">}</span>
<span id="L225" class="LineNr">225 </span>
<span id="L226" class="LineNr">226 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L226'>disc</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _p: (addr <a href='ex11.mu.html#L32'>point</a>), radius: int, color: int, border-color: int <span class="Delimiter">{</span>
<span id="L226" class="LineNr">226 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L226'>disc</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _p: (addr <a href='ex11.mu.html#L32'>point</a>), radius: int, color: int, border-color: int <span class="Delimiter">{</span>
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> p/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> copy _p
<span id="L228" class="LineNr">228 </span> <span class="PreProc">var</span> x/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special">&lt;-</span> get p, x
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: (addr int) <span class="Special">&lt;-</span> get p, y
<span id="L230" class="LineNr">230 </span> <a href='508circle.mu.html#L80'>draw-disc</a> <a href='500fake-screen.mu.html#L14'>screen</a>, *x *y, radius, color, border-color
<span id="L230" class="LineNr">230 </span> <a href='../508circle.mu.html#L80'>draw-disc</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, *x *y, radius, color, border-color
<span id="L231" class="LineNr">231 </span><span class="Delimiter">}</span>
<span id="L232" class="LineNr">232 </span>
<span id="L233" class="LineNr">233 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex11.mu.html#L233'>initialize-environment</a></span> _self: (addr <a href='ex11.mu.html#L25'>environment</a>), x0: int, y0: int, x1: int, y1: int, x2: int, y2: int <span class="Delimiter">{</span>
<span id="L234" class="LineNr">234 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='ex11.mu.html#L25'>environment</a>) <span class="Special">&lt;-</span> copy _self
<span id="L235" class="LineNr">235 </span> <span class="PreProc">var</span> p0-ah/eax: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p0
<span id="L236" class="LineNr">236 </span> <a href='120allocate.subx.html#L43'>allocate</a> p0-ah
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> p0/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p0-ah
<span id="L236" class="LineNr">236 </span> <a href='../120allocate.subx.html#L43'>allocate</a> p0-ah
<span id="L237" class="LineNr">237 </span> <span class="PreProc">var</span> p0/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *p0-ah
<span id="L238" class="LineNr">238 </span> <a href='ex11.mu.html#L253'>initialize-point</a> p0, x0 y0
<span id="L239" class="LineNr">239 </span> <span class="PreProc">var</span> p1-ah/eax: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p1
<span id="L240" class="LineNr">240 </span> <a href='120allocate.subx.html#L43'>allocate</a> p1-ah
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> p1/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p1-ah
<span id="L240" class="LineNr">240 </span> <a href='../120allocate.subx.html#L43'>allocate</a> p1-ah
<span id="L241" class="LineNr">241 </span> <span class="PreProc">var</span> p1/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *p1-ah
<span id="L242" class="LineNr">242 </span> <a href='ex11.mu.html#L253'>initialize-point</a> p1, x1 y1
<span id="L243" class="LineNr">243 </span> <span class="PreProc">var</span> p2-ah/eax: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, p2
<span id="L244" class="LineNr">244 </span> <a href='120allocate.subx.html#L43'>allocate</a> p2-ah
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> p2/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *p2-ah
<span id="L244" class="LineNr">244 </span> <a href='../120allocate.subx.html#L43'>allocate</a> p2-ah
<span id="L245" class="LineNr">245 </span> <span class="PreProc">var</span> p2/eax: (addr <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *p2-ah
<span id="L246" class="LineNr">246 </span> <a href='ex11.mu.html#L253'>initialize-point</a> p2, x2 y2
<span id="L247" class="LineNr">247 </span> <span class="muComment"># cursor initially at p0</span>
<span id="L248" class="LineNr">248 </span> <span class="PreProc">var</span> cursor-ah/<span class="muRegEdi">edi</span>: (addr handle <a href='ex11.mu.html#L32'>point</a>) <span class="Special">&lt;-</span> get self, <a href='ex11.mu.html#L77'>cursor</a>

92
html/apps/ex12.mu.html generated Normal file
View File

@ -0,0 +1,92 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mu - apps/ex12.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.LineNr { }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex12.mu'>https://github.com/akkartik/mu/blob/main/apps/ex12.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Checking the timer.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate apps/ex12.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># bochs -f bochsrc # bochsrc loads code.img</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment">#</span>
<span id="L10" class="LineNr">10 </span><span class="muComment"># Expected output: text with slowly updating colors</span>
<span id="L11" class="LineNr">11 </span>
<span id="L12" class="LineNr">12 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex12.mu.html#L12'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L13" class="LineNr">13 </span> <span class="PreProc">var</span> fg/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L14" class="LineNr">14 </span> <span class="PreProc">var</span> prev-timer-counter/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L15" class="LineNr">15 </span> <span class="Delimiter">{</span>
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;hello from baremetal Mu!&quot;</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0x400</span>/xmax, <span class="Constant">0x10</span>/y, fg, <span class="Constant">0</span>/bg
<span id="L17" class="LineNr">17 </span> <span class="muComment"># wait for timer to bump</span>
<span id="L18" class="LineNr">18 </span> <span class="Delimiter">{</span>
<span id="L19" class="LineNr">19 </span> <span class="PreProc">var</span> curr-timer-counter/eax: int <span class="Special">&lt;-</span> <a href='../319timer.subx.html#L3'>timer-counter</a>
<span id="L20" class="LineNr">20 </span> compare curr-timer-counter, prev-timer-counter
<span id="L21" class="LineNr">21 </span> <span class="PreProc">loop-if-=</span>
<span id="L22" class="LineNr">22 </span> prev-timer-counter <span class="Special">&lt;-</span> copy curr-timer-counter
<span id="L23" class="LineNr">23 </span> <span class="Delimiter">}</span>
<span id="L24" class="LineNr">24 </span> <span class="muComment"># switch color</span>
<span id="L25" class="LineNr">25 </span> fg <span class="Special">&lt;-</span> increment
<span id="L26" class="LineNr">26 </span> <span class="PreProc">loop</span>
<span id="L27" class="LineNr">27 </span> <span class="Delimiter">}</span>
<span id="L28" class="LineNr">28 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

View File

@ -1,32 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex2.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/ex2.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -56,18 +56,18 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex2.mu'>https://github.com/akkartik/mu/blob/main/ex2.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex2.mu'>https://github.com/akkartik/mu/blob/main/apps/ex2.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Test out the video mode by filling in the screen with pixels.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate ex2.mu # emits code.img</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate apps/ex2.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># bochs -f bochsrc # bochsrc loads code.img</span>
<span id="L9" class="LineNr"> 9 </span>
<span id="L10" class="LineNr">10 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex2.mu.html#L10'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L10" class="LineNr">10 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex2.mu.html#L10'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L11" class="LineNr">11 </span> <span class="PreProc">var</span> y/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L12" class="LineNr">12 </span> <span class="Delimiter">{</span>
<span id="L13" class="LineNr">13 </span> compare y, <span class="Constant">0x300</span>/screen-height=<span class="Constant">768</span>
@ -78,7 +78,7 @@ if ('onhashchange' in window) {
<span id="L18" class="LineNr">18 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L19" class="LineNr">19 </span> <span class="PreProc">var</span> color/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L20" class="LineNr">20 </span> color <span class="Special">&lt;-</span> and <span class="Constant">0xff</span>
<span id="L21" class="LineNr">21 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a> x, y, color
<span id="L21" class="LineNr">21 </span> <a href='../500fake-screen.mu.html#L483'>pixel</a> <a href='../500fake-screen.mu.html#L14'>screen</a> x, y, color
<span id="L22" class="LineNr">22 </span> x <span class="Special">&lt;-</span> increment
<span id="L23" class="LineNr">23 </span> <span class="PreProc">loop</span>
<span id="L24" class="LineNr">24 </span> <span class="Delimiter">}</span>

View File

@ -1,32 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex3.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/ex3.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -56,13 +56,13 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex3.mu'>https://github.com/akkartik/mu/blob/main/ex3.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex3.mu'>https://github.com/akkartik/mu/blob/main/apps/ex3.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Draw pixels in response to keyboard events, starting from the top-left</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># and in raster order.</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment">#</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># To build a disk image:</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># ./translate ex3.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># ./translate apps/ex3.mu # emits code.img</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># To run:</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># Or:</span>
@ -71,14 +71,14 @@ if ('onhashchange' in window) {
<span id="L11" class="LineNr">11 </span><span class="muComment"># Expected output: a new green pixel starting from the top left corner of the</span>
<span id="L12" class="LineNr">12 </span><span class="muComment"># screen every time you press a key (letter or digit)</span>
<span id="L13" class="LineNr">13 </span>
<span id="L14" class="LineNr">14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex3.mu.html#L14'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr">14 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex3.mu.html#L14'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L17" class="LineNr">17 </span> <span class="Delimiter">{</span>
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='../102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L19" class="LineNr">19 </span> compare key, <span class="Constant">0</span>
<span id="L20" class="LineNr">20 </span> <span class="PreProc">loop-if-=</span> <span class="muComment"># busy wait</span>
<span id="L21" class="LineNr">21 </span> <a href='101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, <span class="Constant">0x31</span>/green
<span id="L21" class="LineNr">21 </span> <a href='../101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, <span class="Constant">0x31</span>/green
<span id="L22" class="LineNr">22 </span> x <span class="Special">&lt;-</span> increment
<span id="L23" class="LineNr">23 </span> compare x, <span class="Constant">0x400</span>/screen-width=<span class="Constant">1024</span>
<span id="L24" class="LineNr">24 </span> <span class="Delimiter">{</span>

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex4.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/ex4.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,13 +17,13 @@ a { color:inherit; }
.PreProc { color: #c000c0; }
.LineNr { }
.Constant { color: #008787; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -53,12 +53,12 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex4.mu'>https://github.com/akkartik/mu/blob/main/ex4.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex4.mu'>https://github.com/akkartik/mu/blob/main/apps/ex4.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Draw a character using the built-in font (GNU unifont)</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate ex4.mu # emits code.img</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate apps/ex4.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
@ -66,8 +66,8 @@ if ('onhashchange' in window) {
<span id="L9" class="LineNr"> 9 </span><span class="muComment">#</span>
<span id="L10" class="LineNr">10 </span><span class="muComment"># Expected output: letter 'A' in green near the top-left corner of screen</span>
<span id="L11" class="LineNr">11 </span>
<span id="L12" class="LineNr">12 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex4.mu.html#L12'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L13" class="LineNr">13 </span> <a href='500fake-screen.mu.html#L130'>draw-code-point</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x41</span>/A, <span class="Constant">2</span>/row, <span class="Constant">1</span>/col, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L12" class="LineNr">12 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex4.mu.html#L12'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L13" class="LineNr">13 </span> <a href='../500fake-screen.mu.html#L130'>draw-code-point</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x41</span>/A, <span class="Constant">2</span>/row, <span class="Constant">1</span>/col, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L14" class="LineNr">14 </span><span class="Delimiter">}</span>
</pre>
</body>

View File

@ -1,30 +1,30 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex5.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/ex5.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -54,13 +54,13 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex5.mu'>https://github.com/akkartik/mu/blob/main/ex5.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex5.mu'>https://github.com/akkartik/mu/blob/main/apps/ex5.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Draw a single line of ASCII text using the built-in font (GNU unifont)</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># Also demonstrates bounds-checking _before_ drawing.</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment">#</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># To build a disk image:</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># ./translate ex5.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># ./translate apps/ex5.mu # emits code.img</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># To run:</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># Or:</span>
@ -68,9 +68,9 @@ if ('onhashchange' in window) {
<span id="L10" class="LineNr">10 </span><span class="muComment">#</span>
<span id="L11" class="LineNr">11 </span><span class="muComment"># Expected output: text in green near the top-left corner of screen</span>
<span id="L12" class="LineNr">12 </span>
<span id="L13" class="LineNr">13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex5.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr">14 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;hello from baremetal Mu!&quot;</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0x400</span>/xmax, <span class="Constant">0x10</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L15" class="LineNr">15 </span> dummy <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;you shouldn't see this&quot;</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0xa0</span>/xmax, <span class="Constant">0x30</span>/y, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg <span class="muComment"># xmax is too narrow</span>
<span id="L13" class="LineNr">13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex5.mu.html#L13'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr">14 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;hello from baremetal Mu!&quot;</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0x400</span>/xmax, <span class="Constant">0x10</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L15" class="LineNr">15 </span> dummy <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;you shouldn't see this&quot;</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0xa0</span>/xmax, <span class="Constant">0x30</span>/y, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg <span class="muComment"># xmax is too narrow</span>
<span id="L16" class="LineNr">16 </span><span class="Delimiter">}</span>
</pre>
</body>

95
html/apps/ex6.mu.html generated Normal file
View File

@ -0,0 +1,95 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mu - apps/ex6.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEcx { color: #870000; }
.LineNr { }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex6.mu'>https://github.com/akkartik/mu/blob/main/apps/ex6.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Drawing ASCII text incrementally.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate apps/ex6.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># bochs -f bochsrc # bochsrc loads code.img</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment">#</span>
<span id="L10" class="LineNr">10 </span><span class="muComment"># Expected output: a box and text that doesn't overflow it</span>
<span id="L11" class="LineNr">11 </span>
<span id="L12" class="LineNr">12 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex6.mu.html#L12'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L13" class="LineNr">13 </span> <span class="muComment"># drawing text within a bounding box</span>
<span id="L14" class="LineNr">14 </span> <a href='../503manhattan-line.mu.html#L1'>draw-box-on-real-screen</a> <span class="Constant">0xf</span>, <span class="Constant">0x1f</span>, <span class="Constant">0x79</span>, <span class="Constant">0x51</span>, <span class="Constant">0x4</span>
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>
<span id="L17" class="LineNr">17 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;hello &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L18" class="LineNr">18 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;from &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L19" class="LineNr">19 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;baremetal &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L20" class="LineNr">20 </span> x, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;Mu!&quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L21" class="LineNr">21 </span>
<span id="L22" class="LineNr">22 </span> <span class="muComment"># drawing at the cursor in multiple directions</span>
<span id="L23" class="LineNr">23 </span> <a href='../501draw-text.mu.html#L493'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;abc&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L24" class="LineNr">24 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;def&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L25" class="LineNr">25 </span>
<span id="L26" class="LineNr">26 </span> <span class="muComment"># test drawing near the edge</span>
<span id="L27" class="LineNr">27 </span> x <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;R&quot;</span>, <span class="Constant">0x7f</span>/x, <span class="Constant">0x80</span>/xmax=screen-width, <span class="Constant">0x18</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L28" class="LineNr">28 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;wrapped from R&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L29" class="LineNr">29 </span>
<span id="L30" class="LineNr">30 </span> x <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L399'>draw-text-downward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;D&quot;</span>, <span class="Constant">0x20</span>/x, <span class="Constant">0x2f</span>/y, <span class="Constant">0x30</span>/ymax=screen-height, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L31" class="LineNr">31 </span> <a href='../501draw-text.mu.html#L493'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;wrapped from D&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L32" class="LineNr">32 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

View File

@ -1,30 +1,30 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex7.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/ex7.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -54,12 +54,12 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex7.mu'>https://github.com/akkartik/mu/blob/main/ex7.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex7.mu'>https://github.com/akkartik/mu/blob/main/apps/ex7.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Cursor-based motions.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate ex7.mu # emits code.img</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate apps/ex7.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
@ -68,36 +68,36 @@ if ('onhashchange' in window) {
<span id="L10" class="LineNr">10 </span><span class="muComment"># Expected output: an interactive game a bit like &quot;snakes&quot;. Try pressing h, j,</span>
<span id="L11" class="LineNr">11 </span><span class="muComment"># k, l.</span>
<span id="L12" class="LineNr">12 </span>
<span id="L13" class="LineNr">13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex7.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L13" class="LineNr">13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex7.mu.html#L13'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr">14 </span> <span class="PreProc">var</span> space/eax: grapheme <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>
<span id="L15" class="LineNr">15 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L15" class="LineNr">15 </span> <a href='../500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0</span>, <span class="Constant">0</span>
<span id="L16" class="LineNr">16 </span> <span class="Delimiter">{</span>
<span id="L17" class="LineNr">17 </span> <a href='500fake-screen.mu.html#L237'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L17" class="LineNr">17 </span> <a href='../500fake-screen.mu.html#L237'>draw-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, space
<span id="L18" class="LineNr">18 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='../102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L19" class="LineNr">19 </span> <span class="Delimiter">{</span>
<span id="L20" class="LineNr">20 </span> compare key, <span class="Constant">0x68</span>/h
<span id="L21" class="LineNr">21 </span> <span class="PreProc">break-if-!=</span>
<span id="L22" class="LineNr">22 </span> <a href='501draw-text.mu.html#L92'>draw-code-point-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>/dash, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L23" class="LineNr">23 </span> <a href='501draw-text.mu.html#L3'>move-cursor-left</a> <span class="Constant">0</span>
<span id="L22" class="LineNr">22 </span> <a href='../501draw-text.mu.html#L92'>draw-code-point-at-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>/dash, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L23" class="LineNr">23 </span> <a href='../501draw-text.mu.html#L3'>move-cursor-left</a> <span class="Constant">0</span>
<span id="L24" class="LineNr">24 </span> <span class="Delimiter">}</span>
<span id="L25" class="LineNr">25 </span> <span class="Delimiter">{</span>
<span id="L26" class="LineNr">26 </span> compare key, <span class="Constant">0x6a</span>/j
<span id="L27" class="LineNr">27 </span> <span class="PreProc">break-if-!=</span>
<span id="L28" class="LineNr">28 </span> <a href='501draw-text.mu.html#L92'>draw-code-point-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x7c</span>/vertical-bar, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L29" class="LineNr">29 </span> <a href='501draw-text.mu.html#L47'>move-cursor-down</a> <span class="Constant">0</span>
<span id="L28" class="LineNr">28 </span> <a href='../501draw-text.mu.html#L92'>draw-code-point-at-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x7c</span>/vertical-bar, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L29" class="LineNr">29 </span> <a href='../501draw-text.mu.html#L47'>move-cursor-down</a> <span class="Constant">0</span>
<span id="L30" class="LineNr">30 </span> <span class="Delimiter">}</span>
<span id="L31" class="LineNr">31 </span> <span class="Delimiter">{</span>
<span id="L32" class="LineNr">32 </span> compare key, <span class="Constant">0x6b</span>/k
<span id="L33" class="LineNr">33 </span> <span class="PreProc">break-if-!=</span>
<span id="L34" class="LineNr">34 </span> <a href='501draw-text.mu.html#L92'>draw-code-point-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x7c</span>/vertical-bar, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L35" class="LineNr">35 </span> <a href='501draw-text.mu.html#L34'>move-cursor-up</a> <span class="Constant">0</span>
<span id="L34" class="LineNr">34 </span> <a href='../501draw-text.mu.html#L92'>draw-code-point-at-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x7c</span>/vertical-bar, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L35" class="LineNr">35 </span> <a href='../501draw-text.mu.html#L34'>move-cursor-up</a> <span class="Constant">0</span>
<span id="L36" class="LineNr">36 </span> <span class="Delimiter">}</span>
<span id="L37" class="LineNr">37 </span> <span class="Delimiter">{</span>
<span id="L38" class="LineNr">38 </span> compare key, <span class="Constant">0x6c</span>/l
<span id="L39" class="LineNr">39 </span> <span class="PreProc">break-if-!=</span>
<span id="L40" class="LineNr">40 </span> <span class="PreProc">var</span> g/eax: code-point <span class="Special">&lt;-</span> copy <span class="Constant">0x2d</span>/dash
<span id="L41" class="LineNr">41 </span> <a href='501draw-text.mu.html#L92'>draw-code-point-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>/dash, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L42" class="LineNr">42 </span> <a href='501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
<span id="L41" class="LineNr">41 </span> <a href='../501draw-text.mu.html#L92'>draw-code-point-at-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x2d</span>/dash, <span class="Constant">0x31</span>/fg, <span class="Constant">0</span>/bg
<span id="L42" class="LineNr">42 </span> <a href='../501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
<span id="L43" class="LineNr">43 </span> <span class="Delimiter">}</span>
<span id="L44" class="LineNr">44 </span> <span class="PreProc">loop</span>
<span id="L45" class="LineNr">45 </span> <span class="Delimiter">}</span>

View File

@ -1,30 +1,30 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex8.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/ex8.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -54,17 +54,17 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex8.mu'>https://github.com/akkartik/mu/blob/main/ex8.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex8.mu'>https://github.com/akkartik/mu/blob/main/apps/ex8.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Demo of floating-point support.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate ex8.mu # emits code.img</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate apps/ex8.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># bochs -f bochsrc # bochsrc loads code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Set a breakpoint at 0x7c00 and start stepping.</span>
<span id="L8" class="LineNr"> 8 </span>
<span id="L9" class="LineNr"> 9 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex8.mu.html#L9'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L9" class="LineNr"> 9 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex8.mu.html#L9'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L10" class="LineNr">10 </span> <span class="PreProc">var</span> n/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L11" class="LineNr">11 </span> <span class="PreProc">var</span> result/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> convert n
<span id="L12" class="LineNr">12 </span><span class="Delimiter">}</span>

View File

@ -1,32 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex9.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/ex9.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -56,13 +56,13 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex9.mu'>https://github.com/akkartik/mu/blob/main/ex9.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/ex9.mu'>https://github.com/akkartik/mu/blob/main/apps/ex9.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Demo of reading and writing to disk.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># Steps for trying it out:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># 1. Translate this example into a disk image code.img.</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># ./translate ex9.mu</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># ./translate apps/ex9.mu</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># 2. Build a second disk image data.img containing some text.</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># dd if=/dev/zero of=data.img count=20160</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># echo 'abc def ghi' |dd of=data.img conv=notrunc</span>
@ -75,26 +75,26 @@ if ('onhashchange' in window) {
<span id="L15" class="LineNr">15 </span><span class="muComment"># 6. Notice that the data disk now contains the word count of the original text.</span>
<span id="L16" class="LineNr">16 </span><span class="muComment"># xxd data.img |head</span>
<span id="L17" class="LineNr">17 </span>
<span id="L18" class="LineNr">18 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex9.mu.html#L18'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L18" class="LineNr">18 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex9.mu.html#L18'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L19" class="LineNr">19 </span> <span class="PreProc">var</span> text-storage: (stream byte <span class="Constant">0x200</span>)
<span id="L20" class="LineNr">20 </span> <span class="PreProc">var</span> text/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address text-storage
<span id="L21" class="LineNr">21 </span> <a href='boot.subx.html#L974'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, text
<span id="L21" class="LineNr">21 </span> load-sectors data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, text
<span id="L22" class="LineNr">22 </span>
<span id="L23" class="LineNr">23 </span> <span class="PreProc">var</span> <a href='ex9.mu.html#L31'>word-count</a>/eax: int <span class="Special">&lt;-</span> <a href='ex9.mu.html#L31'>word-count</a> text
<span id="L24" class="LineNr">24 </span>
<span id="L25" class="LineNr">25 </span> <span class="PreProc">var</span> result-storage: (stream byte <span class="Constant">0x10</span>)
<span id="L26" class="LineNr">26 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: (addr stream byte) <span class="Special">&lt;-</span> address result-storage
<span id="L27" class="LineNr">27 </span> <a href='126write-int-decimal.subx.html#L8'>write-int32-decimal</a> result, <a href='ex9.mu.html#L31'>word-count</a>
<span id="L28" class="LineNr">28 </span> <a href='boot.subx.html#L1037'>store-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, result
<span id="L27" class="LineNr">27 </span> <a href='../126write-int-decimal.subx.html#L8'>write-int32-decimal</a> result, <a href='ex9.mu.html#L31'>word-count</a>
<span id="L28" class="LineNr">28 </span> store-sectors data-disk, <span class="Constant">0</span>/lba, <span class="Constant">1</span>/num-sectors, result
<span id="L29" class="LineNr">29 </span><span class="Delimiter">}</span>
<span id="L30" class="LineNr">30 </span>
<span id="L31" class="LineNr">31 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex9.mu.html#L31'>word-count</a></span> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L32" class="LineNr">32 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L33" class="LineNr">33 </span> <span class="Delimiter">{</span>
<span id="L34" class="LineNr">34 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special">&lt;-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
<span id="L34" class="LineNr">34 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special">&lt;-</span> <a href='../309stream.subx.html#L6'>stream-empty?</a> in
<span id="L35" class="LineNr">35 </span> compare done?, <span class="Constant">0</span>/false
<span id="L36" class="LineNr">36 </span> <span class="PreProc">break-if-!=</span>
<span id="L37" class="LineNr">37 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special">&lt;-</span> <a href='403unicode.mu.html#L92'>read-grapheme</a> in
<span id="L37" class="LineNr">37 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special">&lt;-</span> <a href='../403unicode.mu.html#L92'>read-grapheme</a> in
<span id="L38" class="LineNr">38 </span> <span class="Delimiter">{</span>
<span id="L39" class="LineNr">39 </span> compare g, <span class="Constant">0x20</span>/space
<span id="L40" class="LineNr">40 </span> <span class="PreProc">break-if-!=</span>

1097
html/apps/hest-life.mu.html generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>Mu - img.mu</title>
<title>Mu - apps/img.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
@ -61,19 +61,19 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/img.mu'>https://github.com/akkartik/mu/blob/main/img.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/img.mu'>https://github.com/akkartik/mu/blob/main/apps/img.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># load an image from disk and display it on screen</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># $ ./translate shell/*.mu # generates code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># Load a pbm, pgm or ppm image (no more than 255 levels)</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># $ ./translate apps/img.mu # generates code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># Load a pbm, pgm or ppm image (no more than 255 levels) in the data disk</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># $ dd if=/dev/zero of=data.img count=20160</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ cat x.pbm |dd of=data.img conv=notrunc</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ dd if=x.pbm of=data.img conv=notrunc</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># or</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ cat t.pgm |dd of=data.img conv=notrunc</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ dd if=t.pgm of=data.img conv=notrunc</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># or</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># $ cat snail.ppm |dd of=data.img conv=notrunc</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># $ dd if=snail.ppm of=data.img conv=notrunc</span>
<span id="L12" class="LineNr"> 12 </span><span class="muComment"># To run:</span>
<span id="L13" class="LineNr"> 13 </span><span class="muComment"># $ qemu-system-i386 -hda code.img -hdb data.img</span>
<span id="L14" class="LineNr"> 14 </span>
@ -88,37 +88,37 @@ if ('onhashchange' in window) {
<span id="L23" class="LineNr"> 23 </span> data: (handle array byte)
<span id="L24" class="LineNr"> 24 </span><span class="Delimiter">}</span>
<span id="L25" class="LineNr"> 25 </span>
<span id="L26" class="LineNr"> 26 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L26'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L26" class="LineNr"> 26 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L26'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> img-storage: <a href='img.mu.html#L15'>image</a>
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> img/<span class="muRegEsi">esi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> address img-storage
<span id="L29" class="LineNr"> 29 </span> <a href='img.mu.html#L33'>load-image</a> img, data-disk
<span id="L30" class="LineNr"> 30 </span> <a href='img.mu.html#L96'>render-image</a> <a href='500fake-screen.mu.html#L14'>screen</a>, img, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x300</span>/width, <span class="Constant">0x300</span>/height
<span id="L30" class="LineNr"> 30 </span> <a href='img.mu.html#L96'>render-image</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, img, <span class="Constant">0</span>/x, <span class="Constant">0</span>/y, <span class="Constant">0x300</span>/width, <span class="Constant">0x300</span>/height
<span id="L31" class="LineNr"> 31 </span><span class="Delimiter">}</span>
<span id="L32" class="LineNr"> 32 </span>
<span id="L33" class="LineNr"> 33 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L33'>load-image</a></span> self: (addr <a href='img.mu.html#L15'>image</a>), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L34" class="LineNr"> 34 </span> <span class="muComment"># data-disk -&gt; stream</span>
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">var</span> s-storage: (stream byte <span class="Constant">0x200000</span>) <span class="muComment"># 512* 0x1000 sectors</span>
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">var</span> s/<span class="muRegEbx">ebx</span>: (addr stream byte) <span class="Special">&lt;-</span> address s-storage
<span id="L37" class="LineNr"> 37 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;loading sectors from data disk&quot;</span>, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg
<span id="L38" class="LineNr"> 38 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L39" class="LineNr"> 39 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L40" class="LineNr"> 40 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0x100</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L41" class="LineNr"> 41 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0x200</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L42" class="LineNr"> 42 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0x300</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L43" class="LineNr"> 43 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0x400</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L44" class="LineNr"> 44 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0x500</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L45" class="LineNr"> 45 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0x600</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L46" class="LineNr"> 46 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0x700</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L47" class="LineNr"> 47 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0x800</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L48" class="LineNr"> 48 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0x900</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L49" class="LineNr"> 49 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0xa00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L50" class="LineNr"> 50 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0xb00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L51" class="LineNr"> 51 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0xc00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L52" class="LineNr"> 52 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0xd00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L53" class="LineNr"> 53 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0xe00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L54" class="LineNr"> 54 </span> <a href='boot.subx.html#L976'>load-sectors</a> data-disk, <span class="Constant">0xf00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L55" class="LineNr"> 55 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;parsing&quot;</span>, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg
<span id="L56" class="LineNr"> 56 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L37" class="LineNr"> 37 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;loading sectors from data disk&quot;</span>, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg
<span id="L38" class="LineNr"> 38 </span> <a href='../501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L39" class="LineNr"> 39 </span> load-sectors data-disk, <span class="Constant">0</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L40" class="LineNr"> 40 </span> load-sectors data-disk, <span class="Constant">0x100</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L41" class="LineNr"> 41 </span> load-sectors data-disk, <span class="Constant">0x200</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L42" class="LineNr"> 42 </span> load-sectors data-disk, <span class="Constant">0x300</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L43" class="LineNr"> 43 </span> load-sectors data-disk, <span class="Constant">0x400</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L44" class="LineNr"> 44 </span> load-sectors data-disk, <span class="Constant">0x500</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L45" class="LineNr"> 45 </span> load-sectors data-disk, <span class="Constant">0x600</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L46" class="LineNr"> 46 </span> load-sectors data-disk, <span class="Constant">0x700</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L47" class="LineNr"> 47 </span> load-sectors data-disk, <span class="Constant">0x800</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L48" class="LineNr"> 48 </span> load-sectors data-disk, <span class="Constant">0x900</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L49" class="LineNr"> 49 </span> load-sectors data-disk, <span class="Constant">0xa00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L50" class="LineNr"> 50 </span> load-sectors data-disk, <span class="Constant">0xb00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L51" class="LineNr"> 51 </span> load-sectors data-disk, <span class="Constant">0xc00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L52" class="LineNr"> 52 </span> load-sectors data-disk, <span class="Constant">0xd00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L53" class="LineNr"> 53 </span> load-sectors data-disk, <span class="Constant">0xe00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L54" class="LineNr"> 54 </span> load-sectors data-disk, <span class="Constant">0xf00</span>/lba, <span class="Constant">0x100</span>/sectors, s
<span id="L55" class="LineNr"> 55 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;parsing&quot;</span>, <span class="Constant">3</span>/fg, <span class="Constant">0</span>/bg
<span id="L56" class="LineNr"> 56 </span> <a href='../501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L57" class="LineNr"> 57 </span> <a href='img.mu.html#L60'>initialize-image</a> self, s
<span id="L58" class="LineNr"> 58 </span><span class="Delimiter">}</span>
<span id="L59" class="LineNr"> 59 </span>
@ -126,9 +126,9 @@ if ('onhashchange' in window) {
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> copy _self
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> mode-storage: slice
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> mode/<span class="muRegEcx">ecx</span>: (addr slice) <span class="Special">&lt;-</span> address mode-storage
<span id="L64" class="LineNr"> 64 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, mode
<span id="L64" class="LineNr"> 64 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, mode
<span id="L65" class="LineNr"> 65 </span> <span class="Delimiter">{</span>
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> P1?/eax: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> mode, <span class="Constant">&quot;P1&quot;</span>
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> P1?/eax: boolean <span class="Special">&lt;-</span> <a href='../123slice.subx.html#L120'>slice-equal?</a> mode, <span class="Constant">&quot;P1&quot;</span>
<span id="L67" class="LineNr"> 67 </span> compare P1?, <span class="Constant">0</span>/false
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">break-if-=</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> type-a/eax: (addr int) <span class="Special">&lt;-</span> get self, <span class="PreProc">type</span>
@ -137,7 +137,7 @@ if ('onhashchange' in window) {
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">return</span>
<span id="L73" class="LineNr"> 73 </span> <span class="Delimiter">}</span>
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">{</span>
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> P2?/eax: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> mode, <span class="Constant">&quot;P2&quot;</span>
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> P2?/eax: boolean <span class="Special">&lt;-</span> <a href='../123slice.subx.html#L120'>slice-equal?</a> mode, <span class="Constant">&quot;P2&quot;</span>
<span id="L76" class="LineNr"> 76 </span> compare P2?, <span class="Constant">0</span>/false
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">break-if-=</span>
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> type-a/eax: (addr int) <span class="Special">&lt;-</span> get self, <span class="PreProc">type</span>
@ -146,7 +146,7 @@ if ('onhashchange' in window) {
<span id="L81" class="LineNr"> 81 </span> <span class="PreProc">return</span>
<span id="L82" class="LineNr"> 82 </span> <span class="Delimiter">}</span>
<span id="L83" class="LineNr"> 83 </span> <span class="Delimiter">{</span>
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> P3?/eax: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> mode, <span class="Constant">&quot;P3&quot;</span>
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> P3?/eax: boolean <span class="Special">&lt;-</span> <a href='../123slice.subx.html#L120'>slice-equal?</a> mode, <span class="Constant">&quot;P3&quot;</span>
<span id="L85" class="LineNr"> 85 </span> compare P3?, <span class="Constant">0</span>/false
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">break-if-=</span>
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> type-a/eax: (addr int) <span class="Special">&lt;-</span> get self, <span class="PreProc">type</span>
@ -154,17 +154,17 @@ if ('onhashchange' in window) {
<span id="L89" class="LineNr"> 89 </span> <a href='img.mu.html#L727'>initialize-image-from-ppm</a> self, in
<span id="L90" class="LineNr"> 90 </span> <span class="PreProc">return</span>
<span id="L91" class="LineNr"> 91 </span> <span class="Delimiter">}</span>
<span id="L92" class="LineNr"> 92 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;initialize-image: unrecognized <a href='img.mu.html#L15'>image</a> type&quot;</span>
<span id="L92" class="LineNr"> 92 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;initialize-image: unrecognized <a href='img.mu.html#L15'>image</a> type&quot;</span>
<span id="L93" class="LineNr"> 93 </span><span class="Delimiter">}</span>
<span id="L94" class="LineNr"> 94 </span>
<span id="L95" class="LineNr"> 95 </span><span class="muComment"># dispatch to a few variants with mostly identical boilerplate</span>
<span id="L96" class="LineNr"> 96 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L96'>render-image</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L96" class="LineNr"> 96 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L96'>render-image</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> img/<span class="muRegEsi">esi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> copy _img
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">var</span> type-a/eax: (addr int) <span class="Special">&lt;-</span> get img, <span class="PreProc">type</span>
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">{</span>
<span id="L100" class="LineNr"> 100 </span> compare *type-a, <span class="Constant">1</span>/pbm
<span id="L101" class="LineNr"> 101 </span> <span class="PreProc">break-if-!=</span>
<span id="L102" class="LineNr"> 102 </span> <a href='img.mu.html#L168'>render-pbm-image</a> <a href='500fake-screen.mu.html#L14'>screen</a>, img, xmin, ymin, width, height
<span id="L102" class="LineNr"> 102 </span> <a href='img.mu.html#L168'>render-pbm-image</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, img, xmin, ymin, width, height
<span id="L103" class="LineNr"> 103 </span> <span class="PreProc">return</span>
<span id="L104" class="LineNr"> 104 </span> <span class="Delimiter">}</span>
<span id="L105" class="LineNr"> 105 </span> <span class="Delimiter">{</span>
@ -173,7 +173,7 @@ if ('onhashchange' in window) {
<span id="L108" class="LineNr"> 108 </span> <span class="PreProc">var</span> img2-storage: <a href='img.mu.html#L15'>image</a>
<span id="L109" class="LineNr"> 109 </span> <span class="PreProc">var</span> img2/<span class="muRegEdi">edi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> address img2-storage
<span id="L110" class="LineNr"> 110 </span> <a href='img.mu.html#L432'>dither-pgm-unordered</a> img, img2
<span id="L111" class="LineNr"> 111 </span> <a href='img.mu.html#L1083'>render-raw-image</a> <a href='500fake-screen.mu.html#L14'>screen</a>, img2, xmin, ymin, width, height
<span id="L111" class="LineNr"> 111 </span> <a href='img.mu.html#L1083'>render-raw-image</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, img2, xmin, ymin, width, height
<span id="L112" class="LineNr"> 112 </span> <span class="PreProc">return</span>
<span id="L113" class="LineNr"> 113 </span> <span class="Delimiter">}</span>
<span id="L114" class="LineNr"> 114 </span> <span class="Delimiter">{</span>
@ -182,10 +182,10 @@ if ('onhashchange' in window) {
<span id="L117" class="LineNr"> 117 </span> <span class="PreProc">var</span> img2-storage: <a href='img.mu.html#L15'>image</a>
<span id="L118" class="LineNr"> 118 </span> <span class="PreProc">var</span> img2/<span class="muRegEdi">edi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> address img2-storage
<span id="L119" class="LineNr"> 119 </span> <a href='img.mu.html#L877'>dither-ppm-unordered</a> img, img2
<span id="L120" class="LineNr"> 120 </span> <a href='img.mu.html#L1083'>render-raw-image</a> <a href='500fake-screen.mu.html#L14'>screen</a>, img2, xmin, ymin, width, height
<span id="L120" class="LineNr"> 120 </span> <a href='img.mu.html#L1083'>render-raw-image</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, img2, xmin, ymin, width, height
<span id="L121" class="LineNr"> 121 </span> <span class="PreProc">return</span>
<span id="L122" class="LineNr"> 122 </span> <span class="Delimiter">}</span>
<span id="L123" class="LineNr"> 123 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;render-image: unrecognized <a href='img.mu.html#L15'>image</a> type&quot;</span>
<span id="L123" class="LineNr"> 123 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;render-image: unrecognized <a href='img.mu.html#L15'>image</a> type&quot;</span>
<span id="L124" class="LineNr"> 124 </span><span class="Delimiter">}</span>
<span id="L125" class="LineNr"> 125 </span>
<span id="L126" class="LineNr"> 126 </span><span class="muComment">## helpers</span>
@ -196,11 +196,11 @@ if ('onhashchange' in window) {
<span id="L131" class="LineNr"> 131 </span> <span class="PreProc">var</span> curr-word-storage: slice
<span id="L132" class="LineNr"> 132 </span> <span class="PreProc">var</span> curr-word/<span class="muRegEcx">ecx</span>: (addr slice) <span class="Special">&lt;-</span> address curr-word-storage
<span id="L133" class="LineNr"> 133 </span> <span class="muComment"># load width, height</span>
<span id="L134" class="LineNr"> 134 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L135" class="LineNr"> 135 </span> <span class="PreProc">var</span> tmp/eax: int <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L134" class="LineNr"> 134 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L135" class="LineNr"> 135 </span> <span class="PreProc">var</span> tmp/eax: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L136" class="LineNr"> 136 </span> <span class="PreProc">var</span> width/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L137" class="LineNr"> 137 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L138" class="LineNr"> 138 </span> tmp <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L137" class="LineNr"> 137 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L138" class="LineNr"> 138 </span> tmp <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L139" class="LineNr"> 139 </span> <span class="PreProc">var</span> height/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L140" class="LineNr"> 140 </span> <span class="muComment"># save width, height</span>
<span id="L141" class="LineNr"> 141 </span> <span class="PreProc">var</span> dest/eax: (addr int) <span class="Special">&lt;-</span> get self, width
@ -212,14 +212,14 @@ if ('onhashchange' in window) {
<span id="L147" class="LineNr"> 147 </span> capacity <span class="Special">&lt;-</span> multiply height
<span id="L148" class="LineNr"> 148 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdi">edi</span>: (addr handle array byte) <span class="Special">&lt;-</span> get self, data
<span id="L149" class="LineNr"> 149 </span> populate data-ah, capacity
<span id="L150" class="LineNr"> 150 </span> <span class="PreProc">var</span> _data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L150" class="LineNr"> 150 </span> <span class="PreProc">var</span> _data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L151" class="LineNr"> 151 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _data
<span id="L152" class="LineNr"> 152 </span> <span class="PreProc">var</span> i/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L153" class="LineNr"> 153 </span> <span class="Delimiter">{</span>
<span id="L154" class="LineNr"> 154 </span> compare i, capacity
<span id="L155" class="LineNr"> 155 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L156" class="LineNr"> 156 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L157" class="LineNr"> 157 </span> <span class="PreProc">var</span> src/eax: int <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L156" class="LineNr"> 156 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L157" class="LineNr"> 157 </span> <span class="PreProc">var</span> src/eax: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L158" class="LineNr"> 158 </span> <span class="Delimiter">{</span>
<span id="L159" class="LineNr"> 159 </span> <span class="PreProc">var</span> dest/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special">&lt;-</span> index data, i
<span id="L160" class="LineNr"> 160 </span> copy-byte-to *dest, src
@ -230,7 +230,7 @@ if ('onhashchange' in window) {
<span id="L165" class="LineNr"> 165 </span><span class="Delimiter">}</span>
<span id="L166" class="LineNr"> 166 </span>
<span id="L167" class="LineNr"> 167 </span><span class="muComment"># render a black-and-white ascii bitmap (each pixel is 0 or 1)</span>
<span id="L168" class="LineNr"> 168 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L168'>render-pbm-image</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L168" class="LineNr"> 168 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L168'>render-pbm-image</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L169" class="LineNr"> 169 </span> <span class="PreProc">var</span> img/<span class="muRegEsi">esi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> copy _img
<span id="L170" class="LineNr"> 170 </span> <span class="muComment"># yratio = height/img-&gt;height</span>
<span id="L171" class="LineNr"> 171 </span> <span class="PreProc">var</span> img-height-a/eax: (addr int) <span class="Special">&lt;-</span> get img, height
@ -245,7 +245,7 @@ if ('onhashchange' in window) {
<span id="L180" class="LineNr"> 180 </span> xratio <span class="Special">&lt;-</span> divide img-width-f
<span id="L181" class="LineNr"> 181 </span> <span class="muComment"># esi = img-&gt;data</span>
<span id="L182" class="LineNr"> 182 </span> <span class="PreProc">var</span> img-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get img, data
<span id="L183" class="LineNr"> 183 </span> <span class="PreProc">var</span> _img-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *img-data-ah
<span id="L183" class="LineNr"> 183 </span> <span class="PreProc">var</span> _img-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *img-data-ah
<span id="L184" class="LineNr"> 184 </span> <span class="PreProc">var</span> img-data/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _img-data
<span id="L185" class="LineNr"> 185 </span> <span class="PreProc">var</span> len/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> length img-data
<span id="L186" class="LineNr"> 186 </span> <span class="muComment">#</span>
@ -276,10 +276,10 @@ if ('onhashchange' in window) {
<span id="L211" class="LineNr"> 211 </span> compare idx, len
<span id="L212" class="LineNr"> 212 </span> <span class="Delimiter">{</span>
<span id="L213" class="LineNr"> 213 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L214" class="LineNr"> 214 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
<span id="L215" class="LineNr"> 215 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
<span id="L216" class="LineNr"> 216 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
<span id="L217" class="LineNr"> 217 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
<span id="L214" class="LineNr"> 214 </span> <a href='../500fake-screen.mu.html#L190'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
<span id="L215" class="LineNr"> 215 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
<span id="L216" class="LineNr"> 216 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
<span id="L217" class="LineNr"> 217 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
<span id="L218" class="LineNr"> 218 </span> <span class="Delimiter">}</span>
<span id="L219" class="LineNr"> 219 </span> <span class="PreProc">var</span> src-a/eax: (addr byte) <span class="Special">&lt;-</span> index img-data, idx
<span id="L220" class="LineNr"> 220 </span> <span class="PreProc">var</span> src/eax: byte <span class="Special">&lt;-</span> copy-byte *src-a
@ -293,7 +293,7 @@ if ('onhashchange' in window) {
<span id="L228" class="LineNr"> 228 </span> screenx <span class="Special">&lt;-</span> add xmin
<span id="L229" class="LineNr"> 229 </span> <span class="PreProc">var</span> screeny/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> convert y
<span id="L230" class="LineNr"> 230 </span> screeny <span class="Special">&lt;-</span> add ymin
<span id="L231" class="LineNr"> 231 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, screenx, screeny, color-int
<span id="L231" class="LineNr"> 231 </span> <a href='../500fake-screen.mu.html#L483'>pixel</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, screenx, screeny, color-int
<span id="L232" class="LineNr"> 232 </span> x <span class="Special">&lt;-</span> add one-f
<span id="L233" class="LineNr"> 233 </span> <span class="PreProc">loop</span>
<span id="L234" class="LineNr"> 234 </span> <span class="Delimiter">}</span>
@ -308,19 +308,19 @@ if ('onhashchange' in window) {
<span id="L243" class="LineNr"> 243 </span> <span class="PreProc">var</span> curr-word-storage: slice
<span id="L244" class="LineNr"> 244 </span> <span class="PreProc">var</span> curr-word/<span class="muRegEcx">ecx</span>: (addr slice) <span class="Special">&lt;-</span> address curr-word-storage
<span id="L245" class="LineNr"> 245 </span> <span class="muComment"># load width, height</span>
<span id="L246" class="LineNr"> 246 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L247" class="LineNr"> 247 </span> <span class="PreProc">var</span> tmp/eax: int <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L246" class="LineNr"> 246 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L247" class="LineNr"> 247 </span> <span class="PreProc">var</span> tmp/eax: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L248" class="LineNr"> 248 </span> <span class="PreProc">var</span> width/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L249" class="LineNr"> 249 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L250" class="LineNr"> 250 </span> tmp <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L249" class="LineNr"> 249 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L250" class="LineNr"> 250 </span> tmp <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L251" class="LineNr"> 251 </span> <span class="PreProc">var</span> height/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L252" class="LineNr"> 252 </span> <span class="muComment"># check and save color levels</span>
<span id="L253" class="LineNr"> 253 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L253" class="LineNr"> 253 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L254" class="LineNr"> 254 </span> <span class="Delimiter">{</span>
<span id="L255" class="LineNr"> 255 </span> tmp <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L255" class="LineNr"> 255 </span> tmp <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L256" class="LineNr"> 256 </span> compare tmp, <span class="Constant">0xff</span>
<span id="L257" class="LineNr"> 257 </span> <span class="PreProc">break-if-=</span>
<span id="L258" class="LineNr"> 258 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;levels of grey is not 255; continuing and hoping for the best&quot;</span>, <span class="Constant">0x2b</span>/fg <span class="Constant">0</span>/bg
<span id="L258" class="LineNr"> 258 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, <span class="Constant">&quot;levels of grey is not 255; continuing and hoping for the best&quot;</span>, <span class="Constant">0x2b</span>/fg <span class="Constant">0</span>/bg
<span id="L259" class="LineNr"> 259 </span> <span class="Delimiter">}</span>
<span id="L260" class="LineNr"> 260 </span> <span class="PreProc">var</span> dest/<span class="muRegEdi">edi</span>: (addr int) <span class="Special">&lt;-</span> get self, max
<span id="L261" class="LineNr"> 261 </span> copy-to *dest, tmp
@ -334,14 +334,14 @@ if ('onhashchange' in window) {
<span id="L269" class="LineNr"> 269 </span> capacity <span class="Special">&lt;-</span> multiply height
<span id="L270" class="LineNr"> 270 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdi">edi</span>: (addr handle array byte) <span class="Special">&lt;-</span> get self, data
<span id="L271" class="LineNr"> 271 </span> populate data-ah, capacity
<span id="L272" class="LineNr"> 272 </span> <span class="PreProc">var</span> _data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L272" class="LineNr"> 272 </span> <span class="PreProc">var</span> _data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L273" class="LineNr"> 273 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _data
<span id="L274" class="LineNr"> 274 </span> <span class="PreProc">var</span> i/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L275" class="LineNr"> 275 </span> <span class="Delimiter">{</span>
<span id="L276" class="LineNr"> 276 </span> compare i, capacity
<span id="L277" class="LineNr"> 277 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L278" class="LineNr"> 278 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L279" class="LineNr"> 279 </span> <span class="PreProc">var</span> src/eax: int <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L278" class="LineNr"> 278 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L279" class="LineNr"> 279 </span> <span class="PreProc">var</span> src/eax: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L280" class="LineNr"> 280 </span> <span class="Delimiter">{</span>
<span id="L281" class="LineNr"> 281 </span> <span class="PreProc">var</span> dest/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special">&lt;-</span> index data, i
<span id="L282" class="LineNr"> 282 </span> copy-byte-to *dest, src
@ -352,7 +352,7 @@ if ('onhashchange' in window) {
<span id="L287" class="LineNr"> 287 </span><span class="Delimiter">}</span>
<span id="L288" class="LineNr"> 288 </span>
<span id="L289" class="LineNr"> 289 </span><span class="muComment"># render a greyscale ascii &quot;greymap&quot; (each pixel is a shade of grey from 0 to 255) by quantizing the shades</span>
<span id="L290" class="LineNr"> 290 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L290'>render-pgm-image</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L290" class="LineNr"> 290 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L290'>render-pgm-image</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L291" class="LineNr"> 291 </span> <span class="PreProc">var</span> img/<span class="muRegEsi">esi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> copy _img
<span id="L292" class="LineNr"> 292 </span> <span class="muComment"># yratio = height/img-&gt;height</span>
<span id="L293" class="LineNr"> 293 </span> <span class="PreProc">var</span> img-height-a/eax: (addr int) <span class="Special">&lt;-</span> get img, height
@ -367,7 +367,7 @@ if ('onhashchange' in window) {
<span id="L302" class="LineNr"> 302 </span> xratio <span class="Special">&lt;-</span> divide img-width-f
<span id="L303" class="LineNr"> 303 </span> <span class="muComment"># esi = img-&gt;data</span>
<span id="L304" class="LineNr"> 304 </span> <span class="PreProc">var</span> img-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get img, data
<span id="L305" class="LineNr"> 305 </span> <span class="PreProc">var</span> _img-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *img-data-ah
<span id="L305" class="LineNr"> 305 </span> <span class="PreProc">var</span> _img-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *img-data-ah
<span id="L306" class="LineNr"> 306 </span> <span class="PreProc">var</span> img-data/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _img-data
<span id="L307" class="LineNr"> 307 </span> <span class="PreProc">var</span> len/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> length img-data
<span id="L308" class="LineNr"> 308 </span> <span class="muComment">#</span>
@ -398,10 +398,10 @@ if ('onhashchange' in window) {
<span id="L333" class="LineNr"> 333 </span> compare idx, len
<span id="L334" class="LineNr"> 334 </span> <span class="Delimiter">{</span>
<span id="L335" class="LineNr"> 335 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L336" class="LineNr"> 336 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
<span id="L337" class="LineNr"> 337 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
<span id="L338" class="LineNr"> 338 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
<span id="L339" class="LineNr"> 339 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
<span id="L336" class="LineNr"> 336 </span> <a href='../500fake-screen.mu.html#L190'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
<span id="L337" class="LineNr"> 337 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
<span id="L338" class="LineNr"> 338 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
<span id="L339" class="LineNr"> 339 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
<span id="L340" class="LineNr"> 340 </span> <span class="Delimiter">}</span>
<span id="L341" class="LineNr"> 341 </span> <span class="PreProc">var</span> src-a/eax: (addr byte) <span class="Special">&lt;-</span> index img-data, idx
<span id="L342" class="LineNr"> 342 </span> <span class="PreProc">var</span> src/eax: byte <span class="Special">&lt;-</span> copy-byte *src-a
@ -410,7 +410,7 @@ if ('onhashchange' in window) {
<span id="L345" class="LineNr"> 345 </span> screenx <span class="Special">&lt;-</span> add xmin
<span id="L346" class="LineNr"> 346 </span> <span class="PreProc">var</span> screeny/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> convert y
<span id="L347" class="LineNr"> 347 </span> screeny <span class="Special">&lt;-</span> add ymin
<span id="L348" class="LineNr"> 348 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, screenx, screeny, color-int
<span id="L348" class="LineNr"> 348 </span> <a href='../500fake-screen.mu.html#L483'>pixel</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, screenx, screeny, color-int
<span id="L349" class="LineNr"> 349 </span> x <span class="Special">&lt;-</span> add one-f
<span id="L350" class="LineNr"> 350 </span> <span class="PreProc">loop</span>
<span id="L351" class="LineNr"> 351 </span> <span class="Delimiter">}</span>
@ -453,13 +453,13 @@ if ('onhashchange' in window) {
<span id="L388" class="LineNr"> 388 </span> <span class="PreProc">var</span> dest/<span class="muRegEdi">edi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> copy _dest
<span id="L389" class="LineNr"> 389 </span> <span class="PreProc">var</span> dest-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get dest, data
<span id="L390" class="LineNr"> 390 </span> populate dest-data-ah, capacity
<span id="L391" class="LineNr"> 391 </span> <span class="PreProc">var</span> _dest-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *dest-data-ah
<span id="L391" class="LineNr"> 391 </span> <span class="PreProc">var</span> _dest-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *dest-data-ah
<span id="L392" class="LineNr"> 392 </span> <span class="PreProc">var</span> dest-data/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _dest-data
<span id="L393" class="LineNr"> 393 </span> <span class="muComment"># needs a buffer to temporarily hold more than 256 levels of precision</span>
<span id="L394" class="LineNr"> 394 </span> <span class="PreProc">var</span> errors-storage: (array int <span class="Constant">0xc0000</span>)
<span id="L395" class="LineNr"> 395 </span> <span class="PreProc">var</span> errors/<span class="muRegEbx">ebx</span>: (addr array int) <span class="Special">&lt;-</span> address errors-storage
<span id="L396" class="LineNr"> 396 </span> <span class="PreProc">var</span> src-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get src, data
<span id="L397" class="LineNr"> 397 </span> <span class="PreProc">var</span> _src-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *src-data-ah
<span id="L397" class="LineNr"> 397 </span> <span class="PreProc">var</span> _src-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *src-data-ah
<span id="L398" class="LineNr"> 398 </span> <span class="PreProc">var</span> src-data/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _src-data
<span id="L399" class="LineNr"> 399 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L400" class="LineNr"> 400 </span> <span class="Delimiter">{</span>
@ -488,7 +488,7 @@ if ('onhashchange' in window) {
<span id="L423" class="LineNr"> 423 </span> x <span class="Special">&lt;-</span> increment
<span id="L424" class="LineNr"> 424 </span> <span class="PreProc">loop</span>
<span id="L425" class="LineNr"> 425 </span> <span class="Delimiter">}</span>
<span id="L426" class="LineNr"> 426 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L426" class="LineNr"> 426 </span> <a href='../501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L427" class="LineNr"> 427 </span> y <span class="Special">&lt;-</span> increment
<span id="L428" class="LineNr"> 428 </span> <span class="PreProc">loop</span>
<span id="L429" class="LineNr"> 429 </span> <span class="Delimiter">}</span>
@ -527,13 +527,13 @@ if ('onhashchange' in window) {
<span id="L462" class="LineNr"> 462 </span> <span class="PreProc">var</span> dest/<span class="muRegEdi">edi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> copy _dest
<span id="L463" class="LineNr"> 463 </span> <span class="PreProc">var</span> dest-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get dest, data
<span id="L464" class="LineNr"> 464 </span> populate dest-data-ah, capacity
<span id="L465" class="LineNr"> 465 </span> <span class="PreProc">var</span> _dest-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *dest-data-ah
<span id="L465" class="LineNr"> 465 </span> <span class="PreProc">var</span> _dest-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *dest-data-ah
<span id="L466" class="LineNr"> 466 </span> <span class="PreProc">var</span> dest-data/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _dest-data
<span id="L467" class="LineNr"> 467 </span> <span class="muComment"># needs a buffer to temporarily hold more than 256 levels of precision</span>
<span id="L468" class="LineNr"> 468 </span> <span class="PreProc">var</span> errors-storage: (array int <span class="Constant">0xc0000</span>)
<span id="L469" class="LineNr"> 469 </span> <span class="PreProc">var</span> errors/<span class="muRegEbx">ebx</span>: (addr array int) <span class="Special">&lt;-</span> address errors-storage
<span id="L470" class="LineNr"> 470 </span> <span class="PreProc">var</span> src-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get src, data
<span id="L471" class="LineNr"> 471 </span> <span class="PreProc">var</span> _src-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *src-data-ah
<span id="L471" class="LineNr"> 471 </span> <span class="PreProc">var</span> _src-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *src-data-ah
<span id="L472" class="LineNr"> 472 </span> <span class="PreProc">var</span> src-data/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _src-data
<span id="L473" class="LineNr"> 473 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L474" class="LineNr"> 474 </span> <span class="Delimiter">{</span>
@ -732,7 +732,7 @@ if ('onhashchange' in window) {
<span id="L667" class="LineNr"> 667 </span> x <span class="Special">&lt;-</span> increment
<span id="L668" class="LineNr"> 668 </span> <span class="PreProc">loop</span>
<span id="L669" class="LineNr"> 669 </span> <span class="Delimiter">}</span>
<span id="L670" class="LineNr"> 670 </span> <a href='501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L670" class="LineNr"> 670 </span> <a href='../501draw-text.mu.html#L65'>move-cursor-to-left-margin-of-next-line</a> <span class="Constant">0</span>/screen
<span id="L671" class="LineNr"> 671 </span> y <span class="Special">&lt;-</span> increment
<span id="L672" class="LineNr"> 672 </span> <span class="PreProc">loop</span>
<span id="L673" class="LineNr"> 673 </span> <span class="Delimiter">}</span>
@ -759,8 +759,8 @@ if ('onhashchange' in window) {
<span id="L694" class="LineNr"> 694 </span><span class="CommentedCode">#? break-if-&lt;=</span>
<span id="L695" class="LineNr"> 695 </span><span class="CommentedCode">#? return</span>
<span id="L696" class="LineNr"> 696 </span><span class="CommentedCode">#? }</span>
<span id="L697" class="LineNr"> 697 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, s, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
<span id="L698" class="LineNr"> 698 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, d, fg <span class="Constant">0</span>/bg
<span id="L697" class="LineNr"> 697 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, s, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
<span id="L698" class="LineNr"> 698 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, d, fg <span class="Constant">0</span>/bg
<span id="L699" class="LineNr"> 699 </span><span class="Delimiter">}</span>
<span id="L700" class="LineNr"> 700 </span>
<span id="L701" class="LineNr"> 701 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L701'>psx</a></span> s: (addr array byte), d: int, fg: int, x: int, y: int <span class="Delimiter">{</span>
@ -784,8 +784,8 @@ if ('onhashchange' in window) {
<span id="L719" class="LineNr"> 719 </span><span class="CommentedCode">#? break-if-&lt;=</span>
<span id="L720" class="LineNr"> 720 </span><span class="CommentedCode">#? return</span>
<span id="L721" class="LineNr"> 721 </span><span class="CommentedCode">#? }</span>
<span id="L722" class="LineNr"> 722 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, s, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
<span id="L723" class="LineNr"> 723 </span> <a href='501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, d, fg <span class="Constant">0</span>/bg
<span id="L722" class="LineNr"> 722 </span> <a href='../501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, s, <span class="Constant">7</span>/fg <span class="Constant">0</span>/bg
<span id="L723" class="LineNr"> 723 </span> <a href='../501draw-text.mu.html#L333'>draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, d, fg <span class="Constant">0</span>/bg
<span id="L724" class="LineNr"> 724 </span><span class="Delimiter">}</span>
<span id="L725" class="LineNr"> 725 </span>
<span id="L726" class="LineNr"> 726 </span><span class="muComment"># import a color ascii &quot;pixmap&quot; (each pixel consists of 3 shades of r/g/b from 0 to 255)</span>
@ -794,19 +794,19 @@ if ('onhashchange' in window) {
<span id="L729" class="LineNr"> 729 </span> <span class="PreProc">var</span> curr-word-storage: slice
<span id="L730" class="LineNr"> 730 </span> <span class="PreProc">var</span> curr-word/<span class="muRegEcx">ecx</span>: (addr slice) <span class="Special">&lt;-</span> address curr-word-storage
<span id="L731" class="LineNr"> 731 </span> <span class="muComment"># load width, height</span>
<span id="L732" class="LineNr"> 732 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L733" class="LineNr"> 733 </span> <span class="PreProc">var</span> tmp/eax: int <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L732" class="LineNr"> 732 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L733" class="LineNr"> 733 </span> <span class="PreProc">var</span> tmp/eax: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L734" class="LineNr"> 734 </span> <span class="PreProc">var</span> width/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L735" class="LineNr"> 735 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L736" class="LineNr"> 736 </span> tmp <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L735" class="LineNr"> 735 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L736" class="LineNr"> 736 </span> tmp <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L737" class="LineNr"> 737 </span> <span class="PreProc">var</span> height/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L738" class="LineNr"> 738 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L738" class="LineNr"> 738 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L739" class="LineNr"> 739 </span> <span class="muComment"># check color levels</span>
<span id="L740" class="LineNr"> 740 </span> <span class="Delimiter">{</span>
<span id="L741" class="LineNr"> 741 </span> tmp <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L741" class="LineNr"> 741 </span> tmp <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L742" class="LineNr"> 742 </span> compare tmp, <span class="Constant">0xff</span>
<span id="L743" class="LineNr"> 743 </span> <span class="PreProc">break-if-=</span>
<span id="L744" class="LineNr"> 744 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;initialize-image-from-ppm: supports exactly 255 levels per rgb channel&quot;</span>
<span id="L744" class="LineNr"> 744 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;initialize-image-from-ppm: supports exactly 255 levels per rgb channel&quot;</span>
<span id="L745" class="LineNr"> 745 </span> <span class="Delimiter">}</span>
<span id="L746" class="LineNr"> 746 </span> <span class="PreProc">var</span> dest/<span class="muRegEdi">edi</span>: (addr int) <span class="Special">&lt;-</span> get self, max
<span id="L747" class="LineNr"> 747 </span> copy-to *dest, tmp
@ -825,14 +825,14 @@ if ('onhashchange' in window) {
<span id="L760" class="LineNr"> 760 </span> <span class="muComment">#</span>
<span id="L761" class="LineNr"> 761 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdi">edi</span>: (addr handle array byte) <span class="Special">&lt;-</span> get self, data
<span id="L762" class="LineNr"> 762 </span> populate data-ah, capacity
<span id="L763" class="LineNr"> 763 </span> <span class="PreProc">var</span> _data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L763" class="LineNr"> 763 </span> <span class="PreProc">var</span> _data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L764" class="LineNr"> 764 </span> <span class="PreProc">var</span> data/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _data
<span id="L765" class="LineNr"> 765 </span> <span class="PreProc">var</span> i/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L766" class="LineNr"> 766 </span> <span class="Delimiter">{</span>
<span id="L767" class="LineNr"> 767 </span> compare i, capacity
<span id="L768" class="LineNr"> 768 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L769" class="LineNr"> 769 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L770" class="LineNr"> 770 </span> <span class="PreProc">var</span> src/eax: int <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L769" class="LineNr"> 769 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, curr-word
<span id="L770" class="LineNr"> 770 </span> <span class="PreProc">var</span> src/eax: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> curr-word
<span id="L771" class="LineNr"> 771 </span> <span class="Delimiter">{</span>
<span id="L772" class="LineNr"> 772 </span> <span class="PreProc">var</span> dest/<span class="muRegEcx">ecx</span>: (addr byte) <span class="Special">&lt;-</span> index data, i
<span id="L773" class="LineNr"> 773 </span> copy-byte-to *dest, src
@ -843,7 +843,7 @@ if ('onhashchange' in window) {
<span id="L778" class="LineNr"> 778 </span><span class="Delimiter">}</span>
<span id="L779" class="LineNr"> 779 </span>
<span id="L780" class="LineNr"> 780 </span><span class="muComment"># import a color ascii &quot;pixmap&quot; (each pixel consists of 3 shades of r/g/b from 0 to 255)</span>
<span id="L781" class="LineNr"> 781 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L781'>render-ppm-image</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L781" class="LineNr"> 781 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L781'>render-ppm-image</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L782" class="LineNr"> 782 </span> <span class="PreProc">var</span> img/<span class="muRegEsi">esi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> copy _img
<span id="L783" class="LineNr"> 783 </span> <span class="muComment"># yratio = height/img-&gt;height</span>
<span id="L784" class="LineNr"> 784 </span> <span class="PreProc">var</span> img-height-a/eax: (addr int) <span class="Special">&lt;-</span> get img, height
@ -858,7 +858,7 @@ if ('onhashchange' in window) {
<span id="L793" class="LineNr"> 793 </span> xratio <span class="Special">&lt;-</span> divide img-width-f
<span id="L794" class="LineNr"> 794 </span> <span class="muComment"># esi = img-&gt;data</span>
<span id="L795" class="LineNr"> 795 </span> <span class="PreProc">var</span> img-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get img, data
<span id="L796" class="LineNr"> 796 </span> <span class="PreProc">var</span> _img-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *img-data-ah
<span id="L796" class="LineNr"> 796 </span> <span class="PreProc">var</span> _img-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *img-data-ah
<span id="L797" class="LineNr"> 797 </span> <span class="PreProc">var</span> img-data/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _img-data
<span id="L798" class="LineNr"> 798 </span> <span class="PreProc">var</span> len/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> length img-data
<span id="L799" class="LineNr"> 799 </span> <span class="muComment">#</span>
@ -895,10 +895,10 @@ if ('onhashchange' in window) {
<span id="L830" class="LineNr"> 830 </span> compare idx, len
<span id="L831" class="LineNr"> 831 </span> <span class="Delimiter">{</span>
<span id="L832" class="LineNr"> 832 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L833" class="LineNr"> 833 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
<span id="L834" class="LineNr"> 834 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
<span id="L835" class="LineNr"> 835 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
<span id="L836" class="LineNr"> 836 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
<span id="L833" class="LineNr"> 833 </span> <a href='../500fake-screen.mu.html#L190'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
<span id="L834" class="LineNr"> 834 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
<span id="L835" class="LineNr"> 835 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
<span id="L836" class="LineNr"> 836 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
<span id="L837" class="LineNr"> 837 </span> <span class="Delimiter">}</span>
<span id="L838" class="LineNr"> 838 </span> <span class="muComment"># r channel</span>
<span id="L839" class="LineNr"> 839 </span> <span class="PreProc">var</span> r: int
@ -925,12 +925,12 @@ if ('onhashchange' in window) {
<span id="L860" class="LineNr"> 860 </span> <span class="Delimiter">}</span>
<span id="L861" class="LineNr"> 861 </span> idx <span class="Special">&lt;-</span> increment
<span id="L862" class="LineNr"> 862 </span> <span class="muComment"># plot nearest color</span>
<span id="L863" class="LineNr"> 863 </span> <span class="PreProc">var</span> color/eax: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L1'>nearest-color-euclidean</a> r, g, b
<span id="L863" class="LineNr"> 863 </span> <span class="PreProc">var</span> color/eax: int <span class="Special">&lt;-</span> <a href='../505colors.mu.html#L1'>nearest-color-euclidean</a> r, g, b
<span id="L864" class="LineNr"> 864 </span> <span class="PreProc">var</span> screenx/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> convert x
<span id="L865" class="LineNr"> 865 </span> screenx <span class="Special">&lt;-</span> add xmin
<span id="L866" class="LineNr"> 866 </span> <span class="PreProc">var</span> screeny/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> convert y
<span id="L867" class="LineNr"> 867 </span> screeny <span class="Special">&lt;-</span> add ymin
<span id="L868" class="LineNr"> 868 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, screenx, screeny, color
<span id="L868" class="LineNr"> 868 </span> <a href='../500fake-screen.mu.html#L483'>pixel</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, screenx, screeny, color
<span id="L869" class="LineNr"> 869 </span> x <span class="Special">&lt;-</span> add one-f
<span id="L870" class="LineNr"> 870 </span> <span class="PreProc">loop</span>
<span id="L871" class="LineNr"> 871 </span> <span class="Delimiter">}</span>
@ -972,7 +972,7 @@ if ('onhashchange' in window) {
<span id="L907" class="LineNr"> 907 </span> <span class="PreProc">var</span> dest/<span class="muRegEdi">edi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> copy _dest
<span id="L908" class="LineNr"> 908 </span> <span class="PreProc">var</span> dest-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get dest, data
<span id="L909" class="LineNr"> 909 </span> populate dest-data-ah, capacity
<span id="L910" class="LineNr"> 910 </span> <span class="PreProc">var</span> _dest-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *dest-data-ah
<span id="L910" class="LineNr"> 910 </span> <span class="PreProc">var</span> _dest-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *dest-data-ah
<span id="L911" class="LineNr"> 911 </span> <span class="PreProc">var</span> dest-data/<span class="muRegEdi">edi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _dest-data
<span id="L912" class="LineNr"> 912 </span> <span class="muComment"># error buffers per r/g/b channel</span>
<span id="L913" class="LineNr"> 913 </span> <span class="PreProc">var</span> red-errors-storage: (array int <span class="Constant">0xc0000</span>)
@ -989,7 +989,7 @@ if ('onhashchange' in window) {
<span id="L924" class="LineNr"> 924 </span> copy-to blue-errors, tmp
<span id="L925" class="LineNr"> 925 </span> <span class="muComment"># transform 'data'</span>
<span id="L926" class="LineNr"> 926 </span> <span class="PreProc">var</span> src-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get src, data
<span id="L927" class="LineNr"> 927 </span> <span class="PreProc">var</span> _src-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *src-data-ah
<span id="L927" class="LineNr"> 927 </span> <span class="PreProc">var</span> _src-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *src-data-ah
<span id="L928" class="LineNr"> 928 </span> <span class="PreProc">var</span> src-data/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _src-data
<span id="L929" class="LineNr"> 929 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L930" class="LineNr"> 930 </span> <span class="Delimiter">{</span>
@ -1056,7 +1056,7 @@ if ('onhashchange' in window) {
<span id="L991" class="LineNr"> 991 </span><span class="CommentedCode">#? draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, green-level, 2/fg 0/bg</span>
<span id="L992" class="LineNr"> 992 </span><span class="CommentedCode">#? draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, blue-level, 9/fg 0/bg</span>
<span id="L993" class="LineNr"> 993 </span><span class="CommentedCode">#? }</span>
<span id="L994" class="LineNr"> 994 </span> <span class="PreProc">var</span> nearest-color-index/eax: int <span class="Special">&lt;-</span> <a href='505colors.mu.html#L1'>nearest-color-euclidean</a> red-level, green-level, blue-level
<span id="L994" class="LineNr"> 994 </span> <span class="PreProc">var</span> nearest-color-index/eax: int <span class="Special">&lt;-</span> <a href='../505colors.mu.html#L1'>nearest-color-euclidean</a> red-level, green-level, blue-level
<span id="L995" class="LineNr"> 995 </span> <span class="Delimiter">{</span>
<span id="L996" class="LineNr"> 996 </span> <span class="PreProc">var</span> nearest-color-index-byte/eax: byte <span class="Special">&lt;-</span> copy-byte nearest-color-index
<span id="L997" class="LineNr"> 997 </span> <a href='img.mu.html#L635'>_write-raw-buffer</a> dest-data, x, y, src-width, nearest-color-index-byte
@ -1069,7 +1069,7 @@ if ('onhashchange' in window) {
<span id="L1004" class="LineNr">1004 </span> <span class="PreProc">var</span> tmp-red-level/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L1005" class="LineNr">1005 </span> <span class="PreProc">var</span> tmp-green-level/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L1006" class="LineNr">1006 </span> <span class="PreProc">var</span> tmp-blue-level/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L1007" class="LineNr">1007 </span> tmp-red-level, tmp-green-level, tmp-blue-level <span class="Special">&lt;-</span> <a href='316colors.subx.html#L7'>color-rgb</a> nearest-color-index
<span id="L1007" class="LineNr">1007 </span> tmp-red-level, tmp-green-level, tmp-blue-level <span class="Special">&lt;-</span> <a href='../316colors.subx.html#L7'>color-rgb</a> nearest-color-index
<span id="L1008" class="LineNr">1008 </span> copy-to red-level, tmp-red-level
<span id="L1009" class="LineNr">1009 </span> copy-to green-level, tmp-green-level
<span id="L1010" class="LineNr">1010 </span> copy-to blue-level, tmp-blue-level
@ -1145,7 +1145,7 @@ if ('onhashchange' in window) {
<span id="L1080" class="LineNr">1080 </span><span class="Delimiter">}</span>
<span id="L1081" class="LineNr">1081 </span>
<span id="L1082" class="LineNr">1082 </span><span class="muComment"># each byte in the image data is a color of the current palette</span>
<span id="L1083" class="LineNr">1083 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L1083'>render-raw-image</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L1083" class="LineNr">1083 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='img.mu.html#L1083'>render-raw-image</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), _img: (addr <a href='img.mu.html#L15'>image</a>), xmin: int, ymin: int, width: int, height: int <span class="Delimiter">{</span>
<span id="L1084" class="LineNr">1084 </span> <span class="PreProc">var</span> img/<span class="muRegEsi">esi</span>: (addr <a href='img.mu.html#L15'>image</a>) <span class="Special">&lt;-</span> copy _img
<span id="L1085" class="LineNr">1085 </span> <span class="muComment"># yratio = height/img-&gt;height</span>
<span id="L1086" class="LineNr">1086 </span> <span class="PreProc">var</span> img-height-a/eax: (addr int) <span class="Special">&lt;-</span> get img, height
@ -1160,7 +1160,7 @@ if ('onhashchange' in window) {
<span id="L1095" class="LineNr">1095 </span> xratio <span class="Special">&lt;-</span> divide img-width-f
<span id="L1096" class="LineNr">1096 </span> <span class="muComment"># esi = img-&gt;data</span>
<span id="L1097" class="LineNr">1097 </span> <span class="PreProc">var</span> img-data-ah/eax: (addr handle array byte) <span class="Special">&lt;-</span> get img, data
<span id="L1098" class="LineNr">1098 </span> <span class="PreProc">var</span> _img-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *img-data-ah
<span id="L1098" class="LineNr">1098 </span> <span class="PreProc">var</span> _img-data/eax: (addr array byte) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *img-data-ah
<span id="L1099" class="LineNr">1099 </span> <span class="PreProc">var</span> img-data/<span class="muRegEsi">esi</span>: (addr array byte) <span class="Special">&lt;-</span> copy _img-data
<span id="L1100" class="LineNr">1100 </span> <span class="PreProc">var</span> len/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> length img-data
<span id="L1101" class="LineNr">1101 </span> <span class="muComment">#</span>
@ -1191,10 +1191,10 @@ if ('onhashchange' in window) {
<span id="L1126" class="LineNr">1126 </span> compare idx, len
<span id="L1127" class="LineNr">1127 </span> <span class="Delimiter">{</span>
<span id="L1128" class="LineNr">1128 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L1129" class="LineNr">1129 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
<span id="L1130" class="LineNr">1130 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
<span id="L1131" class="LineNr">1131 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
<span id="L1132" class="LineNr">1132 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
<span id="L1129" class="LineNr">1129 </span> <a href='../500fake-screen.mu.html#L190'>set-cursor-position</a> <span class="Constant">0</span>/screen, <span class="Constant">0x20</span>/x <span class="Constant">0x20</span>/y
<span id="L1130" class="LineNr">1130 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgx, <span class="Constant">3</span>/fg <span class="Constant">0</span>/bg
<span id="L1131" class="LineNr">1131 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, imgy, <span class="Constant">4</span>/fg <span class="Constant">0</span>/bg
<span id="L1132" class="LineNr">1132 </span> <a href='../501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <span class="Constant">0</span>/screen, idx, <span class="Constant">5</span>/fg <span class="Constant">0</span>/bg
<span id="L1133" class="LineNr">1133 </span> <span class="Delimiter">}</span>
<span id="L1134" class="LineNr">1134 </span> <span class="PreProc">var</span> color-a/eax: (addr byte) <span class="Special">&lt;-</span> index img-data, idx
<span id="L1135" class="LineNr">1135 </span> <span class="PreProc">var</span> color/eax: byte <span class="Special">&lt;-</span> copy-byte *color-a
@ -1203,7 +1203,7 @@ if ('onhashchange' in window) {
<span id="L1138" class="LineNr">1138 </span> screenx <span class="Special">&lt;-</span> add xmin
<span id="L1139" class="LineNr">1139 </span> <span class="PreProc">var</span> screeny/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> convert y
<span id="L1140" class="LineNr">1140 </span> screeny <span class="Special">&lt;-</span> add ymin
<span id="L1141" class="LineNr">1141 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, screenx, screeny, color-int
<span id="L1141" class="LineNr">1141 </span> <a href='../500fake-screen.mu.html#L483'>pixel</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, screenx, screeny, color-int
<span id="L1142" class="LineNr">1142 </span> x <span class="Special">&lt;-</span> add one-f
<span id="L1143" class="LineNr">1143 </span> <span class="PreProc">loop</span>
<span id="L1144" class="LineNr">1144 </span> <span class="Delimiter">}</span>

320
html/apps/life.mu.html generated Normal file
View File

@ -0,0 +1,320 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mu - apps/life.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.LineNr { }
.muRegEsi { color: #005faf; }
.muRegEdi { color: #00af00; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.CommentedCode { color: #8a8a8a; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/apps/life.mu'>https://github.com/akkartik/mu/blob/main/apps/life.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Conway's Game of Life</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># $ ./translate apps/life.mu</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span>
<span id="L8" class="LineNr"> 8 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L8'>state</a></span> _grid: (addr array boolean), x: int, y: int<span class="PreProc"> -&gt; </span>_/eax: boolean <span class="Delimiter">{</span>
<span id="L9" class="LineNr"> 9 </span> <span class="muComment"># clip at the edge</span>
<span id="L10" class="LineNr"> 10 </span> compare x, <span class="Constant">0</span>
<span id="L11" class="LineNr"> 11 </span> <span class="Delimiter">{</span>
<span id="L12" class="LineNr"> 12 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L13" class="LineNr"> 13 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L14" class="LineNr"> 14 </span> <span class="Delimiter">}</span>
<span id="L15" class="LineNr"> 15 </span> compare y, <span class="Constant">0</span>
<span id="L16" class="LineNr"> 16 </span> <span class="Delimiter">{</span>
<span id="L17" class="LineNr"> 17 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L19" class="LineNr"> 19 </span> <span class="Delimiter">}</span>
<span id="L20" class="LineNr"> 20 </span> compare x, <span class="Constant">0x100</span>/width
<span id="L21" class="LineNr"> 21 </span> <span class="Delimiter">{</span>
<span id="L22" class="LineNr"> 22 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L24" class="LineNr"> 24 </span> <span class="Delimiter">}</span>
<span id="L25" class="LineNr"> 25 </span> compare y, <span class="Constant">0xc0</span>/height
<span id="L26" class="LineNr"> 26 </span> <span class="Delimiter">{</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">return</span> <span class="Constant">0</span>/false
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">}</span>
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> idx/eax: int <span class="Special">&lt;-</span> copy y
<span id="L31" class="LineNr"> 31 </span> idx <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/log2width
<span id="L32" class="LineNr"> 32 </span> idx <span class="Special">&lt;-</span> add x
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">var</span> grid/<span class="muRegEsi">esi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid
<span id="L34" class="LineNr"> 34 </span> <span class="PreProc">var</span> result/eax: (addr boolean) <span class="Special">&lt;-</span> index grid, idx
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">return</span> *result
<span id="L36" class="LineNr"> 36 </span><span class="Delimiter">}</span>
<span id="L37" class="LineNr"> 37 </span>
<span id="L38" class="LineNr"> 38 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L38'>set-state</a></span> _grid: (addr array boolean), x: int, y: int, val: boolean <span class="Delimiter">{</span>
<span id="L39" class="LineNr"> 39 </span> <span class="muComment"># don't bother checking bounds</span>
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">var</span> idx/eax: int <span class="Special">&lt;-</span> copy y
<span id="L41" class="LineNr"> 41 </span> idx <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/log2width
<span id="L42" class="LineNr"> 42 </span> idx <span class="Special">&lt;-</span> add x
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> grid/<span class="muRegEsi">esi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid
<span id="L44" class="LineNr"> 44 </span> <span class="PreProc">var</span> result/eax: (addr boolean) <span class="Special">&lt;-</span> index grid, idx
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> src/<span class="muRegEcx">ecx</span>: boolean <span class="Special">&lt;-</span> copy val
<span id="L46" class="LineNr"> 46 </span> copy-to *result, src
<span id="L47" class="LineNr"> 47 </span><span class="Delimiter">}</span>
<span id="L48" class="LineNr"> 48 </span>
<span id="L49" class="LineNr"> 49 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L49'>num-live-neighbors</a></span> grid: (addr array boolean), x: int, y: int<span class="PreProc"> -&gt; </span>_/eax: int <span class="Delimiter">{</span>
<span id="L50" class="LineNr"> 50 </span> <span class="PreProc">var</span> result/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L51" class="LineNr"> 51 </span> <span class="muComment"># row above: zig</span>
<span id="L52" class="LineNr"> 52 </span> decrement y
<span id="L53" class="LineNr"> 53 </span> decrement x
<span id="L54" class="LineNr"> 54 </span> <span class="PreProc">var</span> s/eax: boolean <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
<span id="L55" class="LineNr"> 55 </span> <span class="Delimiter">{</span>
<span id="L56" class="LineNr"> 56 </span> compare s, <span class="Constant">0</span>/false
<span id="L57" class="LineNr"> 57 </span> <span class="PreProc">break-if-=</span>
<span id="L58" class="LineNr"> 58 </span> result <span class="Special">&lt;-</span> increment
<span id="L59" class="LineNr"> 59 </span> <span class="Delimiter">}</span>
<span id="L60" class="LineNr"> 60 </span> increment x
<span id="L61" class="LineNr"> 61 </span> s <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
<span id="L62" class="LineNr"> 62 </span> <span class="Delimiter">{</span>
<span id="L63" class="LineNr"> 63 </span> compare s, <span class="Constant">0</span>/false
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if-=</span>
<span id="L65" class="LineNr"> 65 </span> result <span class="Special">&lt;-</span> increment
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">}</span>
<span id="L67" class="LineNr"> 67 </span> increment x
<span id="L68" class="LineNr"> 68 </span> s <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
<span id="L69" class="LineNr"> 69 </span> <span class="Delimiter">{</span>
<span id="L70" class="LineNr"> 70 </span> compare s, <span class="Constant">0</span>/false
<span id="L71" class="LineNr"> 71 </span> <span class="PreProc">break-if-=</span>
<span id="L72" class="LineNr"> 72 </span> result <span class="Special">&lt;-</span> increment
<span id="L73" class="LineNr"> 73 </span> <span class="Delimiter">}</span>
<span id="L74" class="LineNr"> 74 </span> <span class="muComment"># curr row: zag</span>
<span id="L75" class="LineNr"> 75 </span> increment y
<span id="L76" class="LineNr"> 76 </span> s <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">{</span>
<span id="L78" class="LineNr"> 78 </span> compare s, <span class="Constant">0</span>/false
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">break-if-=</span>
<span id="L80" class="LineNr"> 80 </span> result <span class="Special">&lt;-</span> increment
<span id="L81" class="LineNr"> 81 </span> <span class="Delimiter">}</span>
<span id="L82" class="LineNr"> 82 </span> subtract-from x, <span class="Constant">2</span>
<span id="L83" class="LineNr"> 83 </span> s <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
<span id="L84" class="LineNr"> 84 </span> <span class="Delimiter">{</span>
<span id="L85" class="LineNr"> 85 </span> compare s, <span class="Constant">0</span>/false
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">break-if-=</span>
<span id="L87" class="LineNr"> 87 </span> result <span class="Special">&lt;-</span> increment
<span id="L88" class="LineNr"> 88 </span> <span class="Delimiter">}</span>
<span id="L89" class="LineNr"> 89 </span> <span class="muComment"># row below: zig</span>
<span id="L90" class="LineNr"> 90 </span> increment y
<span id="L91" class="LineNr"> 91 </span> s <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
<span id="L92" class="LineNr"> 92 </span> <span class="Delimiter">{</span>
<span id="L93" class="LineNr"> 93 </span> compare s, <span class="Constant">0</span>/false
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">break-if-=</span>
<span id="L95" class="LineNr"> 95 </span> result <span class="Special">&lt;-</span> increment
<span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">}</span>
<span id="L97" class="LineNr"> 97 </span> increment x
<span id="L98" class="LineNr"> 98 </span> s <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
<span id="L99" class="LineNr"> 99 </span> <span class="Delimiter">{</span>
<span id="L100" class="LineNr">100 </span> compare s, <span class="Constant">0</span>/false
<span id="L101" class="LineNr">101 </span> <span class="PreProc">break-if-=</span>
<span id="L102" class="LineNr">102 </span> result <span class="Special">&lt;-</span> increment
<span id="L103" class="LineNr">103 </span> <span class="Delimiter">}</span>
<span id="L104" class="LineNr">104 </span> increment x
<span id="L105" class="LineNr">105 </span> s <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">{</span>
<span id="L107" class="LineNr">107 </span> compare s, <span class="Constant">0</span>/false
<span id="L108" class="LineNr">108 </span> <span class="PreProc">break-if-=</span>
<span id="L109" class="LineNr">109 </span> result <span class="Special">&lt;-</span> increment
<span id="L110" class="LineNr">110 </span> <span class="Delimiter">}</span>
<span id="L111" class="LineNr">111 </span> <span class="PreProc">return</span> result
<span id="L112" class="LineNr">112 </span><span class="Delimiter">}</span>
<span id="L113" class="LineNr">113 </span>
<span id="L114" class="LineNr">114 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L114'>step</a></span> old-grid: (addr array boolean), new-grid: (addr array boolean) <span class="Delimiter">{</span>
<span id="L115" class="LineNr">115 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L116" class="LineNr">116 </span> <span class="Delimiter">{</span>
<span id="L117" class="LineNr">117 </span> compare y, <span class="Constant">0xc0</span>/height
<span id="L118" class="LineNr">118 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L119" class="LineNr">119 </span> <span class="PreProc">var</span> x/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L120" class="LineNr">120 </span> <span class="Delimiter">{</span>
<span id="L121" class="LineNr">121 </span> compare x, <span class="Constant">0x100</span>/width
<span id="L122" class="LineNr">122 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L123" class="LineNr">123 </span> <span class="PreProc">var</span> n/eax: int <span class="Special">&lt;-</span> <a href='life.mu.html#L49'>num-live-neighbors</a> old-grid, x, y
<span id="L124" class="LineNr">124 </span> <span class="muComment"># if neighbors &lt; 2, die of loneliness</span>
<span id="L125" class="LineNr">125 </span> <span class="Delimiter">{</span>
<span id="L126" class="LineNr">126 </span> compare n, <span class="Constant">2</span>
<span id="L127" class="LineNr">127 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L128" class="LineNr">128 </span> <a href='life.mu.html#L38'>set-state</a> new-grid, x, y, <span class="Constant">0</span>/dead
<span id="L129" class="LineNr">129 </span> <span class="Delimiter">}</span>
<span id="L130" class="LineNr">130 </span> <span class="muComment"># if neighbors &gt; 3, die of overcrowding</span>
<span id="L131" class="LineNr">131 </span> <span class="Delimiter">{</span>
<span id="L132" class="LineNr">132 </span> compare n, <span class="Constant">3</span>
<span id="L133" class="LineNr">133 </span> <span class="PreProc">break-if-&lt;=</span>
<span id="L134" class="LineNr">134 </span> <a href='life.mu.html#L38'>set-state</a> new-grid, x, y, <span class="Constant">0</span>/dead
<span id="L135" class="LineNr">135 </span> <span class="Delimiter">}</span>
<span id="L136" class="LineNr">136 </span> <span class="muComment"># if neighbors = 2, preserve state</span>
<span id="L137" class="LineNr">137 </span> <span class="Delimiter">{</span>
<span id="L138" class="LineNr">138 </span> compare n, <span class="Constant">2</span>
<span id="L139" class="LineNr">139 </span> <span class="PreProc">break-if-!=</span>
<span id="L140" class="LineNr">140 </span> <span class="PreProc">var</span> old-state/eax: boolean <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> old-grid, x, y
<span id="L141" class="LineNr">141 </span> <a href='life.mu.html#L38'>set-state</a> new-grid, x, y, old-state
<span id="L142" class="LineNr">142 </span> <span class="Delimiter">}</span>
<span id="L143" class="LineNr">143 </span> <span class="muComment"># if neighbors = 3, cell quickens to life</span>
<span id="L144" class="LineNr">144 </span> <span class="Delimiter">{</span>
<span id="L145" class="LineNr">145 </span> compare n, <span class="Constant">3</span>
<span id="L146" class="LineNr">146 </span> <span class="PreProc">break-if-!=</span>
<span id="L147" class="LineNr">147 </span> <a href='life.mu.html#L38'>set-state</a> new-grid, x, y, <span class="Constant">1</span>/live
<span id="L148" class="LineNr">148 </span> <span class="Delimiter">}</span>
<span id="L149" class="LineNr">149 </span> x <span class="Special">&lt;-</span> increment
<span id="L150" class="LineNr">150 </span> <span class="PreProc">loop</span>
<span id="L151" class="LineNr">151 </span> <span class="Delimiter">}</span>
<span id="L152" class="LineNr">152 </span> y <span class="Special">&lt;-</span> increment
<span id="L153" class="LineNr">153 </span> <span class="PreProc">loop</span>
<span id="L154" class="LineNr">154 </span> <span class="Delimiter">}</span>
<span id="L155" class="LineNr">155 </span><span class="Delimiter">}</span>
<span id="L156" class="LineNr">156 </span>
<span id="L157" class="LineNr">157 </span><span class="muComment"># color a square of size 'side' starting at x*side, y*side</span>
<span id="L158" class="LineNr">158 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L158'>render-square</a></span> _x: int, _y: int, color: int <span class="Delimiter">{</span>
<span id="L159" class="LineNr">159 </span> <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy _y
<span id="L160" class="LineNr">160 </span> y <span class="Special">&lt;-</span> shift-left <span class="Constant">2</span>/log2side
<span id="L161" class="LineNr">161 </span> <span class="PreProc">var</span> side/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">1</span>
<span id="L162" class="LineNr">162 </span> side <span class="Special">&lt;-</span> shift-left <span class="Constant">2</span>/log2side
<span id="L163" class="LineNr">163 </span> <span class="PreProc">var</span> ymax/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy y
<span id="L164" class="LineNr">164 </span> ymax <span class="Special">&lt;-</span> add side
<span id="L165" class="LineNr">165 </span> <span class="Delimiter">{</span>
<span id="L166" class="LineNr">166 </span> compare y, ymax
<span id="L167" class="LineNr">167 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L168" class="LineNr">168 </span> <span class="Delimiter">{</span>
<span id="L169" class="LineNr">169 </span> <span class="PreProc">var</span> x/eax: int <span class="Special">&lt;-</span> copy _x
<span id="L170" class="LineNr">170 </span> x <span class="Special">&lt;-</span> shift-left <span class="Constant">2</span>/log2side
<span id="L171" class="LineNr">171 </span> <span class="PreProc">var</span> xmax/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy x
<span id="L172" class="LineNr">172 </span> xmax <span class="Special">&lt;-</span> add side
<span id="L173" class="LineNr">173 </span> <span class="Delimiter">{</span>
<span id="L174" class="LineNr">174 </span> compare x, xmax
<span id="L175" class="LineNr">175 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L176" class="LineNr">176 </span> <a href='../101screen.subx.html#L8'>pixel-on-real-screen</a> x, y, color
<span id="L177" class="LineNr">177 </span> x <span class="Special">&lt;-</span> increment
<span id="L178" class="LineNr">178 </span> <span class="PreProc">loop</span>
<span id="L179" class="LineNr">179 </span> <span class="Delimiter">}</span>
<span id="L180" class="LineNr">180 </span> <span class="Delimiter">}</span>
<span id="L181" class="LineNr">181 </span> y <span class="Special">&lt;-</span> increment
<span id="L182" class="LineNr">182 </span> <span class="PreProc">loop</span>
<span id="L183" class="LineNr">183 </span> <span class="Delimiter">}</span>
<span id="L184" class="LineNr">184 </span><span class="Delimiter">}</span>
<span id="L185" class="LineNr">185 </span>
<span id="L186" class="LineNr">186 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L186'>render</a></span> grid: (addr array boolean) <span class="Delimiter">{</span>
<span id="L187" class="LineNr">187 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L188" class="LineNr">188 </span> <span class="Delimiter">{</span>
<span id="L189" class="LineNr">189 </span> compare y, <span class="Constant">0xc0</span>/height
<span id="L190" class="LineNr">190 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L191" class="LineNr">191 </span> <span class="PreProc">var</span> x/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L192" class="LineNr">192 </span> <span class="Delimiter">{</span>
<span id="L193" class="LineNr">193 </span> compare x, <span class="Constant">0x100</span>/width
<span id="L194" class="LineNr">194 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L195" class="LineNr">195 </span> <span class="PreProc">var</span> <a href='life.mu.html#L8'>state</a>/eax: boolean <span class="Special">&lt;-</span> <a href='life.mu.html#L8'>state</a> grid, x, y
<span id="L196" class="LineNr">196 </span> compare <a href='life.mu.html#L8'>state</a>, <span class="Constant">0</span>/false
<span id="L197" class="LineNr">197 </span> <span class="Delimiter">{</span>
<span id="L198" class="LineNr">198 </span> <span class="PreProc">break-if-=</span>
<span id="L199" class="LineNr">199 </span> <a href='life.mu.html#L158'>render-square</a> x, y, <span class="Constant">3</span>/cyan
<span id="L200" class="LineNr">200 </span> <span class="Delimiter">}</span>
<span id="L201" class="LineNr">201 </span> compare <a href='life.mu.html#L8'>state</a>, <span class="Constant">0</span>/false
<span id="L202" class="LineNr">202 </span> <span class="Delimiter">{</span>
<span id="L203" class="LineNr">203 </span> <span class="PreProc">break-if-!=</span>
<span id="L204" class="LineNr">204 </span> <a href='life.mu.html#L158'>render-square</a> x, y, <span class="Constant">0</span>/black
<span id="L205" class="LineNr">205 </span> <span class="Delimiter">}</span>
<span id="L206" class="LineNr">206 </span> x <span class="Special">&lt;-</span> increment
<span id="L207" class="LineNr">207 </span> <span class="PreProc">loop</span>
<span id="L208" class="LineNr">208 </span> <span class="Delimiter">}</span>
<span id="L209" class="LineNr">209 </span> y <span class="Special">&lt;-</span> increment
<span id="L210" class="LineNr">210 </span> <span class="PreProc">loop</span>
<span id="L211" class="LineNr">211 </span> <span class="Delimiter">}</span>
<span id="L212" class="LineNr">212 </span><span class="Delimiter">}</span>
<span id="L213" class="LineNr">213 </span>
<span id="L214" class="LineNr">214 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L214'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L215" class="LineNr">215 </span><span class="CommentedCode">#? # allocate on the stack</span>
<span id="L216" class="LineNr">216 </span><span class="CommentedCode">#? var grid1-storage: (array boolean 0xc000) # width * height</span>
<span id="L217" class="LineNr">217 </span><span class="CommentedCode">#? var grid1/esi: (addr array boolean) &lt;- address grid1-storage</span>
<span id="L218" class="LineNr">218 </span><span class="CommentedCode">#? var grid2-storage: (array boolean 0xc000) # width * height</span>
<span id="L219" class="LineNr">219 </span><span class="CommentedCode">#? var grid2/edi: (addr array boolean) &lt;- address grid2-storage</span>
<span id="L220" class="LineNr">220 </span> <span class="muComment"># allocate on the heap</span>
<span id="L221" class="LineNr">221 </span> <span class="PreProc">var</span> grid1-storage: (handle array boolean)
<span id="L222" class="LineNr">222 </span> <span class="PreProc">var</span> grid1-ah/eax: (addr handle array boolean) <span class="Special">&lt;-</span> address grid1-storage
<span id="L223" class="LineNr">223 </span> populate grid1-ah, <span class="Constant">0xc000</span> <span class="muComment"># width * height</span>
<span id="L224" class="LineNr">224 </span> <span class="PreProc">var</span> _grid1/eax: (addr array boolean) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *grid1-ah
<span id="L225" class="LineNr">225 </span> <span class="PreProc">var</span> grid1/<span class="muRegEsi">esi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid1
<span id="L226" class="LineNr">226 </span> <span class="PreProc">var</span> grid2-storage: (handle array boolean)
<span id="L227" class="LineNr">227 </span> <span class="PreProc">var</span> grid2-ah/eax: (addr handle array boolean) <span class="Special">&lt;-</span> address grid2-storage
<span id="L228" class="LineNr">228 </span> populate grid2-ah, <span class="Constant">0xc000</span> <span class="muComment"># width * height</span>
<span id="L229" class="LineNr">229 </span> <span class="PreProc">var</span> _grid2/eax: (addr array boolean) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *grid2-ah
<span id="L230" class="LineNr">230 </span> <span class="PreProc">var</span> grid2/<span class="muRegEdi">edi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid2
<span id="L231" class="LineNr">231 </span> <span class="muComment"># initialize grid1</span>
<span id="L232" class="LineNr">232 </span> <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x80</span>, <span class="Constant">0x5f</span>, <span class="Constant">1</span>/live
<span id="L233" class="LineNr">233 </span> <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x81</span>, <span class="Constant">0x5f</span>, <span class="Constant">1</span>/live
<span id="L234" class="LineNr">234 </span> <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x7f</span>, <span class="Constant">0x60</span>, <span class="Constant">1</span>/live
<span id="L235" class="LineNr">235 </span> <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x80</span>, <span class="Constant">0x60</span>, <span class="Constant">1</span>/live
<span id="L236" class="LineNr">236 </span> <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x80</span>, <span class="Constant">0x61</span>, <span class="Constant">1</span>/live
<span id="L237" class="LineNr">237 </span> <span class="muComment"># render grid1</span>
<span id="L238" class="LineNr">238 </span> <a href='life.mu.html#L186'>render</a> grid1
<span id="L239" class="LineNr">239 </span> <span class="Delimiter">{</span>
<span id="L240" class="LineNr">240 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='../102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L241" class="LineNr">241 </span> compare key, <span class="Constant">0</span>
<span id="L242" class="LineNr">242 </span><span class="CommentedCode">#? loop-if-= # press key to step</span>
<span id="L243" class="LineNr">243 </span> <span class="PreProc">break-if-!=</span> <span class="muComment"># press key to quit # comment this out to run under bochs; I'm not sure why there's a newline in the keyboard buffer</span>
<span id="L244" class="LineNr">244 </span> <span class="muComment"># iter: grid1 -&gt; grid2</span>
<span id="L245" class="LineNr">245 </span> <a href='life.mu.html#L114'>step</a> grid1, grid2
<span id="L246" class="LineNr">246 </span> <a href='life.mu.html#L186'>render</a> grid2
<span id="L247" class="LineNr">247 </span> <span class="muComment"># iter: grid2 -&gt; grid1</span>
<span id="L248" class="LineNr">248 </span> <a href='life.mu.html#L114'>step</a> grid2, grid1
<span id="L249" class="LineNr">249 </span> <a href='life.mu.html#L186'>render</a> grid1
<span id="L250" class="LineNr">250 </span> <span class="PreProc">loop</span>
<span id="L251" class="LineNr">251 </span> <span class="Delimiter">}</span>
<span id="L252" class="LineNr">252 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

View File

@ -1,36 +1,36 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - mandelbrot-fixed.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/mandelbrot-fixed.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.muRegEbx { color: #5f00ff; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muTest { color: #5f8700; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -60,7 +60,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/mandelbrot-fixed.mu'>https://github.com/akkartik/mu/blob/main/mandelbrot-fixed.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/mandelbrot-fixed.mu'>https://github.com/akkartik/mu/blob/main/apps/mandelbrot-fixed.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Mandelbrot set using fixed-point numbers.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
@ -68,13 +68,13 @@ if ('onhashchange' in window) {
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># $ git clone <a href="https://github.com/akkartik/mu">https://github.com/akkartik/mu</a></span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># $ cd mu</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># Build on Linux:</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./translate mandelbrot-fixed.mu</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./translate apps/mandelbrot-fixed.mu</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># Build on other platforms (slow):</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ ./translate_emulated mandelbrot-fixed.mu</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ ./translate_emulated apps/mandelbrot-fixed.mu</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># Run:</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
<span id="L12" class="LineNr"> 12 </span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L13'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> <span class="muComment"># Initially the viewport is centered at 0, 0 in the scene.</span>
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> scene-cx-f: int
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> scene-cy-f: int
@ -82,7 +82,7 @@ if ('onhashchange' in window) {
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> scene-width-f: int
<span id="L19" class="LineNr"> 19 </span> copy-to scene-width-f, <span class="Constant">0x400</span>/<span class="Constant">4</span>
<span id="L20" class="LineNr"> 20 </span> <span class="Delimiter">{</span>
<span id="L21" class="LineNr"> 21 </span> <a href='mandelbrot-fixed.mu.html#L127'>mandelbrot</a> <a href='500fake-screen.mu.html#L14'>screen</a> scene-cx-f, scene-cy-f, scene-width-f
<span id="L21" class="LineNr"> 21 </span> <a href='mandelbrot-fixed.mu.html#L127'>mandelbrot</a> <a href='../500fake-screen.mu.html#L14'>screen</a> scene-cx-f, scene-cy-f, scene-width-f
<span id="L22" class="LineNr"> 22 </span> <span class="muComment"># move at an angle slowly towards the edge</span>
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> adj-f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L100'>multiply-fixed</a> scene-width-f, <span class="Constant">0x12</span>/<span class="Constant">0</span>.<span class="Constant">07</span>
<span id="L24" class="LineNr"> 24 </span> subtract-from scene-cx-f, adj-f
@ -102,7 +102,7 @@ if ('onhashchange' in window) {
<span id="L38" class="LineNr"> 38 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L39" class="LineNr"> 39 </span> <span class="Delimiter">{</span>
<span id="L40" class="LineNr"> 40 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L41" class="LineNr"> 41 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;int-to-fixed: overflow&quot;</span>
<span id="L41" class="LineNr"> 41 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;int-to-fixed: overflow&quot;</span>
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">}</span>
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">return</span> result-f
<span id="L44" class="LineNr"> 44 </span><span class="Delimiter">}</span>
@ -118,45 +118,45 @@ if ('onhashchange' in window) {
<span id="L54" class="LineNr"> 54 </span> <span class="muComment"># 0</span>
<span id="L55" class="LineNr"> 55 </span> <span class="PreProc">var</span> f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">0</span>
<span id="L56" class="LineNr"> 56 </span> <span class="PreProc">var</span> result/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L57" class="LineNr"> 57 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 0&quot;</span>
<span id="L57" class="LineNr"> 57 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 0&quot;</span>
<span id="L58" class="LineNr"> 58 </span> <span class="muComment"># 1</span>
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">1</span>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> result/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L61" class="LineNr"> 61 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1&quot;</span>
<span id="L61" class="LineNr"> 61 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1&quot;</span>
<span id="L62" class="LineNr"> 62 </span> <span class="muComment"># -1</span>
<span id="L63" class="LineNr"> 63 </span> <span class="PreProc">var</span> f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-1</span>
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">var</span> result/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L65" class="LineNr"> 65 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1&quot;</span>
<span id="L65" class="LineNr"> 65 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1&quot;</span>
<span id="L66" class="LineNr"> 66 </span> <span class="muComment"># 0.5 = 1/2</span>
<span id="L67" class="LineNr"> 67 </span> <span class="PreProc">var</span> f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">1</span>
<span id="L68" class="LineNr"> 68 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L69" class="LineNr"> 69 </span> <span class="PreProc">var</span> result/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L70" class="LineNr"> 70 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 0.5&quot;</span>
<span id="L70" class="LineNr"> 70 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">0</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 0.5&quot;</span>
<span id="L71" class="LineNr"> 71 </span> <span class="muComment"># -0.5 = -1/2</span>
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">var</span> f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-1</span>
<span id="L73" class="LineNr"> 73 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L74" class="LineNr"> 74 </span> <span class="PreProc">var</span> result/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L75" class="LineNr"> 75 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -0.5&quot;</span>
<span id="L75" class="LineNr"> 75 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -0.5&quot;</span>
<span id="L76" class="LineNr"> 76 </span> <span class="muComment"># 1.5 = 3/2</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">var</span> f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">3</span>
<span id="L78" class="LineNr"> 78 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L79" class="LineNr"> 79 </span> <span class="PreProc">var</span> result/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L80" class="LineNr"> 80 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1.5&quot;</span>
<span id="L80" class="LineNr"> 80 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1.5&quot;</span>
<span id="L81" class="LineNr"> 81 </span> <span class="muComment"># -1.5 = -3/2</span>
<span id="L82" class="LineNr"> 82 </span> <span class="PreProc">var</span> f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-3</span>
<span id="L83" class="LineNr"> 83 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">1</span>
<span id="L84" class="LineNr"> 84 </span> <span class="PreProc">var</span> result/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L85" class="LineNr"> 85 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1.5&quot;</span>
<span id="L85" class="LineNr"> 85 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1.5&quot;</span>
<span id="L86" class="LineNr"> 86 </span> <span class="muComment"># 1.25 = 5/4</span>
<span id="L87" class="LineNr"> 87 </span> <span class="PreProc">var</span> f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">5</span>
<span id="L88" class="LineNr"> 88 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">2</span>
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> result/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L90" class="LineNr"> 90 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1.25&quot;</span>
<span id="L90" class="LineNr"> 90 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">1</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - 1.25&quot;</span>
<span id="L91" class="LineNr"> 91 </span> <span class="muComment"># -1.25 = -5/4</span>
<span id="L92" class="LineNr"> 92 </span> <span class="PreProc">var</span> f/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L36'>int-to-fixed</a> <span class="Constant">-5</span>
<span id="L93" class="LineNr"> 93 </span> f <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">2</span>
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> result/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot-fixed.mu.html#L46'>fixed-to-int</a> f
<span id="L95" class="LineNr"> 95 </span> <a href='502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1.25&quot;</span>
<span id="L95" class="LineNr"> 95 </span> <a href='../502test.mu.html#L2'>check-ints-equal</a> result, <span class="Constant">-2</span>, <span class="Constant">&quot;F - <a href='mandelbrot-fixed.mu.html#L53'>test-fixed-conversion</a> - -1.25&quot;</span>
<span id="L96" class="LineNr"> 96 </span><span class="Delimiter">}</span>
<span id="L97" class="LineNr"> 97 </span>
<span id="L98" class="LineNr"> 98 </span><span class="muComment"># special routines for multiplying and dividing fixed-point numbers</span>
@ -166,7 +166,7 @@ if ('onhashchange' in window) {
<span id="L102" class="LineNr">102 </span> result <span class="Special">&lt;-</span> multiply b-f
<span id="L103" class="LineNr">103 </span> <span class="Delimiter">{</span>
<span id="L104" class="LineNr">104 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L105" class="LineNr">105 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;multiply-fixed: overflow&quot;</span>
<span id="L105" class="LineNr">105 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;multiply-fixed: overflow&quot;</span>
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">}</span>
<span id="L107" class="LineNr">107 </span> result <span class="Special">&lt;-</span> shift-right-signed <span class="Constant">8</span>/fixed-precision
<span id="L108" class="LineNr">108 </span> <span class="PreProc">return</span> result
@ -177,10 +177,10 @@ if ('onhashchange' in window) {
<span id="L113" class="LineNr">113 </span> result-f <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/fixed-precision
<span id="L114" class="LineNr">114 </span> <span class="Delimiter">{</span>
<span id="L115" class="LineNr">115 </span> <span class="PreProc">break-if-not-overflow</span>
<span id="L116" class="LineNr">116 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;divide-fixed: overflow&quot;</span>
<span id="L116" class="LineNr">116 </span> <a href='../317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;divide-fixed: overflow&quot;</span>
<span id="L117" class="LineNr">117 </span> <span class="Delimiter">}</span>
<span id="L118" class="LineNr">118 </span> <span class="PreProc">var</span> dummy-remainder/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L119" class="LineNr">119 </span> result-f, dummy-remainder <span class="Special">&lt;-</span> <a href='314divide.subx.html#L3'>integer-divide</a> result-f, b-f
<span id="L119" class="LineNr">119 </span> result-f, dummy-remainder <span class="Special">&lt;-</span> <a href='../314divide.subx.html#L3'>integer-divide</a> result-f, b-f
<span id="L120" class="LineNr">120 </span> <span class="PreProc">return</span> result-f
<span id="L121" class="LineNr">121 </span><span class="Delimiter">}</span>
<span id="L122" class="LineNr">122 </span>
@ -188,10 +188,10 @@ if ('onhashchange' in window) {
<span id="L124" class="LineNr">124 </span>
<span id="L125" class="LineNr">125 </span><span class="muComment"># adding and subtracting two fixed-point numbers can use existing instructions.</span>
<span id="L126" class="LineNr">126 </span>
<span id="L127" class="LineNr">127 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L127'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), scene-cx-f: int, scene-cy-f: int, scene-width-f: int <span class="Delimiter">{</span>
<span id="L127" class="LineNr">127 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-fixed.mu.html#L127'>mandelbrot</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), scene-cx-f: int, scene-cy-f: int, scene-width-f: int <span class="Delimiter">{</span>
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> a/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> b/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L130" class="LineNr">130 </span> a, b <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L130" class="LineNr">130 </span> a, b <span class="Special">&lt;-</span> <a href='../500fake-screen.mu.html#L86'>screen-size</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> width/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> copy a
<span id="L132" class="LineNr">132 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L133" class="LineNr">133 </span> <span class="PreProc">var</span> height/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> copy b
@ -211,10 +211,10 @@ if ('onhashchange' in window) {
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> color/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L148" class="LineNr">148 </span> <span class="Delimiter">{</span>
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> dummy/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L150" class="LineNr">150 </span> dummy, color <span class="Special">&lt;-</span> <a href='314divide.subx.html#L3'>integer-divide</a> iterations, <span class="Constant">0x18</span>/<span class="Constant">24</span>/size-of-cycle-0
<span id="L150" class="LineNr">150 </span> dummy, color <span class="Special">&lt;-</span> <a href='../314divide.subx.html#L3'>integer-divide</a> iterations, <span class="Constant">0x18</span>/<span class="Constant">24</span>/size-of-cycle-0
<span id="L151" class="LineNr">151 </span> color <span class="Special">&lt;-</span> add <span class="Constant">0x20</span>/cycle-0
<span id="L152" class="LineNr">152 </span> <span class="Delimiter">}</span>
<span id="L153" class="LineNr">153 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L153" class="LineNr">153 </span> <a href='../500fake-screen.mu.html#L483'>pixel</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L154" class="LineNr">154 </span> x <span class="Special">&lt;-</span> increment
<span id="L155" class="LineNr">155 </span> <span class="PreProc">loop</span>
<span id="L156" class="LineNr">156 </span> <span class="Delimiter">}</span>

View File

@ -1,34 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - mandelbrot-silhouette.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/mandelbrot-silhouette.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -58,7 +58,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/mandelbrot-silhouette.mu'>https://github.com/akkartik/mu/blob/main/mandelbrot-silhouette.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/mandelbrot-silhouette.mu'>https://github.com/akkartik/mu/blob/main/apps/mandelbrot-silhouette.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Mandelbrot set</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
@ -66,20 +66,20 @@ if ('onhashchange' in window) {
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># $ git clone <a href="https://github.com/akkartik/mu">https://github.com/akkartik/mu</a></span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># $ cd mu</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># Build on Linux:</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./translate mandelbrot.mu</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./translate apps/mandelbrot.mu</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># Build on other platforms (slow):</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ ./translate_emulated mandelbrot.mu</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ ./translate_emulated apps/mandelbrot.mu</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># Run:</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
<span id="L12" class="LineNr"> 12 </span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> <a href='mandelbrot-silhouette.mu.html#L17'>mandelbrot</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L13'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> <a href='mandelbrot-silhouette.mu.html#L17'>mandelbrot</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L15" class="LineNr"> 15 </span><span class="Delimiter">}</span>
<span id="L16" class="LineNr"> 16 </span>
<span id="L17" class="LineNr"> 17 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L17'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
<span id="L17" class="LineNr"> 17 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot-silhouette.mu.html#L17'>mandelbrot</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>) <span class="Delimiter">{</span>
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> a/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> b/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L20" class="LineNr"> 20 </span> a, b <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L20" class="LineNr"> 20 </span> a, b <span class="Special">&lt;-</span> <a href='../500fake-screen.mu.html#L86'>screen-size</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> width/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> copy a
<span id="L22" class="LineNr"> 22 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> height/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> copy b
@ -98,12 +98,12 @@ if ('onhashchange' in window) {
<span id="L36" class="LineNr"> 36 </span> compare iterations, <span class="Constant">0x400</span>/max
<span id="L37" class="LineNr"> 37 </span> <span class="Delimiter">{</span>
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L39" class="LineNr"> 39 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0xf</span>/white
<span id="L39" class="LineNr"> 39 </span> <a href='../500fake-screen.mu.html#L483'>pixel</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0xf</span>/white
<span id="L40" class="LineNr"> 40 </span> <span class="Delimiter">}</span>
<span id="L41" class="LineNr"> 41 </span> compare iterations, <span class="Constant">0x400</span>/max
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">{</span>
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">break-if-&lt;</span>
<span id="L44" class="LineNr"> 44 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0</span>/black
<span id="L44" class="LineNr"> 44 </span> <a href='../500fake-screen.mu.html#L483'>pixel</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, x, y, <span class="Constant">0</span>/black
<span id="L45" class="LineNr"> 45 </span> <span class="Delimiter">}</span>
<span id="L46" class="LineNr"> 46 </span> x <span class="Special">&lt;-</span> increment
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">loop</span>

View File

@ -1,35 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - mandelbrot.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/mandelbrot.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.muRegEbx { color: #5f00ff; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -59,7 +59,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/mandelbrot.mu'>https://github.com/akkartik/mu/blob/main/mandelbrot.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/mandelbrot.mu'>https://github.com/akkartik/mu/blob/main/apps/mandelbrot.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Mandelbrot set</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
@ -67,13 +67,13 @@ if ('onhashchange' in window) {
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># $ git clone <a href="https://github.com/akkartik/mu">https://github.com/akkartik/mu</a></span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># $ cd mu</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># Build on Linux:</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./translate mandelbrot.mu</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./translate apps/mandelbrot.mu</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># Build on other platforms (slow):</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ ./translate_emulated mandelbrot.mu</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># $ ./translate_emulated apps/mandelbrot.mu</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># Run:</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
<span id="L12" class="LineNr"> 12 </span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L13'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> <span class="muComment"># Initially the viewport is centered at 0, 0 in the scene.</span>
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> zero: float
<span id="L16" class="LineNr"> 16 </span> <span class="PreProc">var</span> scene-cx/<span class="Constant">xmm1</span>: float <span class="Special">&lt;-</span> copy zero
@ -82,16 +82,16 @@ if ('onhashchange' in window) {
<span id="L19" class="LineNr"> 19 </span> <span class="muComment"># scene-width-scale = 0.5</span>
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> scene-width-scale: float
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> dest/eax: (addr float) <span class="Special">&lt;-</span> address scene-width-scale
<span id="L22" class="LineNr"> 22 </span> <a href='408float.mu.html#L3'>fill-in-rational</a> dest, <span class="Constant">1</span>, <span class="Constant">2</span>
<span id="L22" class="LineNr"> 22 </span> <a href='../408float.mu.html#L3'>fill-in-rational</a> dest, <span class="Constant">1</span>, <span class="Constant">2</span>
<span id="L23" class="LineNr"> 23 </span> <span class="muComment"># scene-width = 4</span>
<span id="L24" class="LineNr"> 24 </span> <span class="PreProc">var</span> four: float
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">var</span> dest/eax: (addr float) <span class="Special">&lt;-</span> address four
<span id="L26" class="LineNr"> 26 </span> <a href='408float.mu.html#L3'>fill-in-rational</a> dest, <span class="Constant">4</span>, <span class="Constant">1</span>
<span id="L26" class="LineNr"> 26 </span> <a href='../408float.mu.html#L3'>fill-in-rational</a> dest, <span class="Constant">4</span>, <span class="Constant">1</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">var</span> scene-width/<span class="Constant">xmm3</span>: float <span class="Special">&lt;-</span> copy four
<span id="L28" class="LineNr"> 28 </span> <span class="Delimiter">{</span>
<span id="L29" class="LineNr"> 29 </span> <a href='mandelbrot.mu.html#L41'>mandelbrot</a> <a href='500fake-screen.mu.html#L14'>screen</a> scene-cx, scene-cy, scene-width
<span id="L29" class="LineNr"> 29 </span> <a href='mandelbrot.mu.html#L41'>mandelbrot</a> <a href='../500fake-screen.mu.html#L14'>screen</a> scene-cx, scene-cy, scene-width
<span id="L30" class="LineNr"> 30 </span> <span class="muComment"># move the center some % of the current screen-width</span>
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> adj/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> <a href='408float.mu.html#L18'>rational</a> <span class="Constant">2</span>, <span class="Constant">0x1c</span>/<span class="Constant">28</span>
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> adj/<span class="Constant">xmm0</span>: float <span class="Special">&lt;-</span> <a href='../408float.mu.html#L18'>rational</a> <span class="Constant">2</span>, <span class="Constant">0x1c</span>/<span class="Constant">28</span>
<span id="L32" class="LineNr"> 32 </span> adj <span class="Special">&lt;-</span> multiply scene-width
<span id="L33" class="LineNr"> 33 </span> scene-cx <span class="Special">&lt;-</span> subtract adj
<span id="L34" class="LineNr"> 34 </span> scene-cy <span class="Special">&lt;-</span> add adj
@ -101,10 +101,10 @@ if ('onhashchange' in window) {
<span id="L38" class="LineNr"> 38 </span> <span class="Delimiter">}</span>
<span id="L39" class="LineNr"> 39 </span><span class="Delimiter">}</span>
<span id="L40" class="LineNr"> 40 </span>
<span id="L41" class="LineNr"> 41 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L41'>mandelbrot</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), scene-cx: float, scene-cy: float, scene-width: float <span class="Delimiter">{</span>
<span id="L41" class="LineNr"> 41 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='mandelbrot.mu.html#L41'>mandelbrot</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), scene-cx: float, scene-cy: float, scene-width: float <span class="Delimiter">{</span>
<span id="L42" class="LineNr"> 42 </span> <span class="PreProc">var</span> a/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L43" class="LineNr"> 43 </span> <span class="PreProc">var</span> b/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L44" class="LineNr"> 44 </span> a, b <span class="Special">&lt;-</span> <a href='500fake-screen.mu.html#L86'>screen-size</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L44" class="LineNr"> 44 </span> a, b <span class="Special">&lt;-</span> <a href='../500fake-screen.mu.html#L86'>screen-size</a> <a href='../500fake-screen.mu.html#L14'>screen</a>
<span id="L45" class="LineNr"> 45 </span> <span class="PreProc">var</span> width/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> copy a
<span id="L46" class="LineNr"> 46 </span> width <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2-font-width
<span id="L47" class="LineNr"> 47 </span> <span class="PreProc">var</span> height/<span class="muRegEdi">edi</span>: int <span class="Special">&lt;-</span> copy b
@ -122,9 +122,9 @@ if ('onhashchange' in window) {
<span id="L59" class="LineNr"> 59 </span> <span class="PreProc">var</span> iterations/eax: int <span class="Special">&lt;-</span> <a href='mandelbrot.mu.html#L73'>mandelbrot-iterations-for-point</a> real, imaginary, <span class="Constant">0x400</span>/max
<span id="L60" class="LineNr"> 60 </span> iterations <span class="Special">&lt;-</span> shift-right <span class="Constant">3</span>
<span id="L61" class="LineNr"> 61 </span> <span class="PreProc">var</span> color/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L62" class="LineNr"> 62 </span> iterations, color <span class="Special">&lt;-</span> <a href='314divide.subx.html#L3'>integer-divide</a> iterations, <span class="Constant">0x18</span>/<span class="Constant">24</span>/size-of-cycle-0
<span id="L62" class="LineNr"> 62 </span> iterations, color <span class="Special">&lt;-</span> <a href='../314divide.subx.html#L3'>integer-divide</a> iterations, <span class="Constant">0x18</span>/<span class="Constant">24</span>/size-of-cycle-0
<span id="L63" class="LineNr"> 63 </span> color <span class="Special">&lt;-</span> add <span class="Constant">0x20</span>/cycle-0
<span id="L64" class="LineNr"> 64 </span> <a href='500fake-screen.mu.html#L483'>pixel</a> <a href='500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L64" class="LineNr"> 64 </span> <a href='../500fake-screen.mu.html#L483'>pixel</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, x, y, color
<span id="L65" class="LineNr"> 65 </span> x <span class="Special">&lt;-</span> increment
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">loop</span>
<span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">}</span>

View File

@ -1,34 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - rpn.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta charset="UTF-8">
<title>Mu - apps/rpn.mu</title>
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -58,7 +58,7 @@ if ('onhashchange' in window) {
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/rpn.mu'>https://github.com/akkartik/mu/blob/main/rpn.mu</a>
<a href='https://github.com/akkartik/mu/blob/main/apps/rpn.mu'>https://github.com/akkartik/mu/blob/main/apps/rpn.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Integer arithmetic using postfix notation</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
@ -66,7 +66,7 @@ if ('onhashchange' in window) {
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># Division not implemented yet.</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment">#</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># To build:</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./translate rpn.mu</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./translate apps/rpn.mu</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment">#</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># Example session:</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
@ -77,7 +77,7 @@ if ('onhashchange' in window) {
<span id="L15" class="LineNr"> 15 </span><span class="muComment">#</span>
<span id="L16" class="LineNr"> 16 </span><span class="muComment"># Error handling is non-existent. This is just a prototype.</span>
<span id="L17" class="LineNr"> 17 </span>
<span id="L18" class="LineNr"> 18 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L18'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L18" class="LineNr"> 18 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='rpn.mu.html#L18'>main</a></span> <a href='../500fake-screen.mu.html#L14'>screen</a>: (addr <a href='../500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L19" class="LineNr"> 19 </span> <span class="PreProc">var</span> in-storage: (stream byte <span class="Constant">0x80</span>)
<span id="L20" class="LineNr"> 20 </span> <span class="PreProc">var</span> in/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address in-storage
<span id="L21" class="LineNr"> 21 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
@ -85,30 +85,30 @@ if ('onhashchange' in window) {
<span id="L23" class="LineNr"> 23 </span> <span class="muComment"># read-eval-print loop</span>
<span id="L24" class="LineNr"> 24 </span> <span class="Delimiter">{</span>
<span id="L25" class="LineNr"> 25 </span> <span class="muComment"># print prompt</span>
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> x/eax: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;&gt; &quot;</span>, <span class="Constant">0</span>/x, <span class="Constant">0x80</span>/xmax, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L26" class="LineNr"> 26 </span> <span class="PreProc">var</span> x/eax: int <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;&gt; &quot;</span>, <span class="Constant">0</span>/x, <span class="Constant">0x80</span>/xmax, y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L27" class="LineNr"> 27 </span> <span class="muComment"># read line from keyboard</span>
<span id="L28" class="LineNr"> 28 </span> <a href='106stream.subx.html#L20'>clear-stream</a> in
<span id="L28" class="LineNr"> 28 </span> <a href='../106stream.subx.html#L20'>clear-stream</a> in
<span id="L29" class="LineNr"> 29 </span> <span class="Delimiter">{</span>
<span id="L30" class="LineNr"> 30 </span> <a href='500fake-screen.mu.html#L237'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L30" class="LineNr"> 30 </span> <a href='../500fake-screen.mu.html#L237'>draw-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, space
<span id="L31" class="LineNr"> 31 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='../102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L32" class="LineNr"> 32 </span> compare key, <span class="Constant">0xa</span>/newline
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">break-if-=</span>
<span id="L34" class="LineNr"> 34 </span> compare key, <span class="Constant">0</span>
<span id="L35" class="LineNr"> 35 </span> <span class="PreProc">loop-if-=</span>
<span id="L36" class="LineNr"> 36 </span> <span class="PreProc">var</span> key2/eax: int <span class="Special">&lt;-</span> copy key
<span id="L37" class="LineNr"> 37 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> in, key2
<span id="L37" class="LineNr"> 37 </span> <a href='../115write-byte.subx.html#L12'>append-byte</a> in, key2
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special">&lt;-</span> copy key2
<span id="L39" class="LineNr"> 39 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
<span id="L40" class="LineNr"> 40 </span> <a href='501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
<span id="L39" class="LineNr"> 39 </span> <a href='../501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, g, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
<span id="L40" class="LineNr"> 40 </span> <a href='../501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
<span id="L41" class="LineNr"> 41 </span> <span class="PreProc">loop</span>
<span id="L42" class="LineNr"> 42 </span> <span class="Delimiter">}</span>
<span id="L43" class="LineNr"> 43 </span> <span class="muComment"># clear cursor</span>
<span id="L44" class="LineNr"> 44 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, space, <span class="Constant">3</span>/fg/never-used, <span class="Constant">0</span>/bg
<span id="L44" class="LineNr"> 44 </span> <a href='../501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, space, <span class="Constant">3</span>/fg/never-used, <span class="Constant">0</span>/bg
<span id="L45" class="LineNr"> 45 </span> <span class="muComment"># parse and eval</span>
<span id="L46" class="LineNr"> 46 </span> <span class="PreProc">var</span> out/eax: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L62'>simplify</a> in
<span id="L47" class="LineNr"> 47 </span> <span class="muComment"># print</span>
<span id="L48" class="LineNr"> 48 </span> y <span class="Special">&lt;-</span> increment
<span id="L49" class="LineNr"> 49 </span> out, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, out, <span class="Constant">0</span>/xmin, y, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x30</span>/ymax, <span class="Constant">0</span>/x, y, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L49" class="LineNr"> 49 </span> out, y <span class="Special">&lt;-</span> <a href='../501draw-text.mu.html#L340'>draw-int32-decimal-wrapping-right-then-down</a> <a href='../500fake-screen.mu.html#L14'>screen</a>, out, <span class="Constant">0</span>/xmin, y, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x30</span>/ymax, <span class="Constant">0</span>/x, y, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L50" class="LineNr"> 50 </span> <span class="muComment"># newline</span>
<span id="L51" class="LineNr"> 51 </span> y <span class="Special">&lt;-</span> increment
<span id="L52" class="LineNr"> 52 </span> <span class="muComment">#</span>
@ -128,13 +128,13 @@ if ('onhashchange' in window) {
<span id="L66" class="LineNr"> 66 </span> <span class="PreProc">var</span> stack/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special">&lt;-</span> address stack-storage
<span id="L67" class="LineNr"> 67 </span> <a href='rpn.mu.html#L116'>initialize-int-stack</a> stack, <span class="Constant">0x10</span>
<span id="L68" class="LineNr"> 68 </span> $simplify:word-loop: <span class="Delimiter">{</span>
<span id="L69" class="LineNr"> 69 </span> <a href='127next-word.subx.html#L11'>next-word</a> in, word
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L9'>slice-empty?</a> word
<span id="L69" class="LineNr"> 69 </span> <a href='../127next-word.subx.html#L11'>next-word</a> in, word
<span id="L70" class="LineNr"> 70 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special">&lt;-</span> <a href='../123slice.subx.html#L9'>slice-empty?</a> word
<span id="L71" class="LineNr"> 71 </span> compare done?, <span class="Constant">0</span>
<span id="L72" class="LineNr"> 72 </span> <span class="PreProc">break-if-!=</span>
<span id="L73" class="LineNr"> 73 </span> <span class="muComment"># if word is an operator, perform it</span>
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">{</span>
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> is-add?/eax: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;+&quot;</span>
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> is-add?/eax: boolean <span class="Special">&lt;-</span> <a href='../123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;+&quot;</span>
<span id="L76" class="LineNr"> 76 </span> compare is-add?, <span class="Constant">0</span>
<span id="L77" class="LineNr"> 77 </span> <span class="PreProc">break-if-=</span>
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">var</span> _b/eax: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
@ -145,7 +145,7 @@ if ('onhashchange' in window) {
<span id="L83" class="LineNr"> 83 </span> <span class="PreProc">loop</span> $simplify:word-loop
<span id="L84" class="LineNr"> 84 </span> <span class="Delimiter">}</span>
<span id="L85" class="LineNr"> 85 </span> <span class="Delimiter">{</span>
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> is-sub?/eax: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;-&quot;</span>
<span id="L86" class="LineNr"> 86 </span> <span class="PreProc">var</span> is-sub?/eax: boolean <span class="Special">&lt;-</span> <a href='../123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;-&quot;</span>
<span id="L87" class="LineNr"> 87 </span> compare is-sub?, <span class="Constant">0</span>
<span id="L88" class="LineNr"> 88 </span> <span class="PreProc">break-if-=</span>
<span id="L89" class="LineNr"> 89 </span> <span class="PreProc">var</span> _b/eax: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
@ -156,7 +156,7 @@ if ('onhashchange' in window) {
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">loop</span> $simplify:word-loop
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">}</span>
<span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">{</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> is-mul?/eax: boolean <span class="Special">&lt;-</span> <a href='123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;*&quot;</span>
<span id="L97" class="LineNr"> 97 </span> <span class="PreProc">var</span> is-mul?/eax: boolean <span class="Special">&lt;-</span> <a href='../123slice.subx.html#L120'>slice-equal?</a> word, <span class="Constant">&quot;*&quot;</span>
<span id="L98" class="LineNr"> 98 </span> compare is-mul?, <span class="Constant">0</span>
<span id="L99" class="LineNr"> 99 </span> <span class="PreProc">break-if-=</span>
<span id="L100" class="LineNr">100 </span> <span class="PreProc">var</span> _b/eax: int <span class="Special">&lt;-</span> <a href='rpn.mu.html#L136'>pop-int-stack</a> stack
@ -167,7 +167,7 @@ if ('onhashchange' in window) {
<span id="L105" class="LineNr">105 </span> <span class="PreProc">loop</span> $simplify:word-loop
<span id="L106" class="LineNr">106 </span> <span class="Delimiter">}</span>
<span id="L107" class="LineNr">107 </span> <span class="muComment"># otherwise it's an int</span>
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> n/eax: int <span class="Special">&lt;-</span> <a href='311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> word
<span id="L108" class="LineNr">108 </span> <span class="PreProc">var</span> n/eax: int <span class="Special">&lt;-</span> <a href='../311decimal-int.subx.html#L4'>parse-decimal-int-from-slice</a> word
<span id="L109" class="LineNr">109 </span> <a href='rpn.mu.html#L124'>push-int-stack</a> stack, n
<span id="L110" class="LineNr">110 </span> <span class="PreProc">loop</span>
<span id="L111" class="LineNr">111 </span> <span class="Delimiter">}</span>
@ -187,7 +187,7 @@ if ('onhashchange' in window) {
<span id="L125" class="LineNr">125 </span> <span class="PreProc">var</span> self/<span class="muRegEsi">esi</span>: (addr <a href='rpn.mu.html#L57'>int-stack</a>) <span class="Special">&lt;-</span> copy _self
<span id="L126" class="LineNr">126 </span> <span class="PreProc">var</span> top-addr/<span class="muRegEcx">ecx</span>: (addr int) <span class="Special">&lt;-</span> get self, top
<span id="L127" class="LineNr">127 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdx">edx</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> data/eax: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> data/eax: (addr array int) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L129" class="LineNr">129 </span> <span class="PreProc">var</span> top/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> dest-addr/<span class="muRegEdx">edx</span>: (addr int) <span class="Special">&lt;-</span> index data, top
<span id="L131" class="LineNr">131 </span> <span class="PreProc">var</span> val/eax: int <span class="Special">&lt;-</span> copy _val
@ -205,7 +205,7 @@ if ('onhashchange' in window) {
<span id="L143" class="LineNr">143 </span> <span class="Delimiter">}</span>
<span id="L144" class="LineNr">144 </span> subtract-from *top-addr, <span class="Constant">1</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">var</span> data-ah/<span class="muRegEdx">edx</span>: (addr handle array int) <span class="Special">&lt;-</span> get self, data
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> data/eax: (addr array int) <span class="Special">&lt;-</span> <a href='120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L146" class="LineNr">146 </span> <span class="PreProc">var</span> data/eax: (addr array int) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *data-ah
<span id="L147" class="LineNr">147 </span> <span class="PreProc">var</span> top/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy *top-addr
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> result-addr/eax: (addr int) <span class="Special">&lt;-</span> index data, top
<span id="L149" class="LineNr">149 </span> <span class="PreProc">var</span> val/eax: int <span class="Special">&lt;-</span> copy *result-addr

1266
html/boot.subx.html generated

File diff suppressed because it is too large Load Diff

302
html/colors.mu.html generated
View File

@ -1,302 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - colors.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.muRegEbx { color: #5f00ff; }
.Constant { color: #008787; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.CommentedCode { color: #8a8a8a; }
.muComment { color: #005faf; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/colors.mu'>https://github.com/akkartik/mu/blob/main/colors.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Return colors 'near' a given r/g/b value (expressed in hex)</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment"># If we did this rigorously we'd need to implement cosines. So we won't.</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment">#</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># To build:</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># $ ./translate colors.mu</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment">#</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Example session:</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># $ qemu-system-i386 code.img</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment"># Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space&gt; aa 0 aa</span>
<span id="L10" class="LineNr"> 10 </span><span class="muComment"># 5</span>
<span id="L11" class="LineNr"> 11 </span><span class="muComment"># This means only color 5 in the default palette is similar to #aa00aa.</span>
<span id="L12" class="LineNr"> 12 </span>
<span id="L13" class="LineNr"> 13 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L13'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L14" class="LineNr"> 14 </span> <span class="PreProc">var</span> in-storage: (stream byte <span class="Constant">0x10</span>)
<span id="L15" class="LineNr"> 15 </span> <span class="PreProc">var</span> in/<span class="muRegEsi">esi</span>: (addr stream byte) <span class="Special">&lt;-</span> address in-storage
<span id="L16" class="LineNr"> 16 </span> <span class="Delimiter">{</span>
<span id="L17" class="LineNr"> 17 </span> <span class="muComment"># print prompt</span>
<span id="L18" class="LineNr"> 18 </span> <span class="PreProc">var</span> x/eax: int <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space&gt; &quot;</span>, <span class="Constant">0x10</span>/x, <span class="Constant">0x80</span>/xmax, <span class="Constant">0x28</span>/y, <span class="Constant">3</span>/fg/cyan, <span class="Constant">0</span>/bg
<span id="L19" class="LineNr"> 19 </span> <span class="muComment"># read line from keyboard</span>
<span id="L20" class="LineNr"> 20 </span> <a href='106stream.subx.html#L20'>clear-stream</a> in
<span id="L21" class="LineNr"> 21 </span> <span class="Delimiter">{</span>
<span id="L22" class="LineNr"> 22 </span> <a href='500fake-screen.mu.html#L237'>draw-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x20</span>/space
<span id="L23" class="LineNr"> 23 </span> <span class="PreProc">var</span> key/eax: byte <span class="Special">&lt;-</span> <a href='102keyboard.subx.html#L21'>read-key</a> keyboard
<span id="L24" class="LineNr"> 24 </span> compare key, <span class="Constant">0xa</span>/newline
<span id="L25" class="LineNr"> 25 </span> <span class="PreProc">break-if-=</span>
<span id="L26" class="LineNr"> 26 </span> compare key, <span class="Constant">0</span>
<span id="L27" class="LineNr"> 27 </span> <span class="PreProc">loop-if-=</span>
<span id="L28" class="LineNr"> 28 </span> <span class="PreProc">var</span> key2/eax: int <span class="Special">&lt;-</span> copy key
<span id="L29" class="LineNr"> 29 </span> <a href='115write-byte.subx.html#L12'>append-byte</a> in, key2
<span id="L30" class="LineNr"> 30 </span> <span class="PreProc">var</span> g/eax: grapheme <span class="Special">&lt;-</span> copy key2
<span id="L31" class="LineNr"> 31 </span> <a href='501draw-text.mu.html#L84'>draw-grapheme-at-cursor</a> <a href='500fake-screen.mu.html#L14'>screen</a>, g, <span class="Constant">0xf</span>/fg, <span class="Constant">0</span>/bg
<span id="L32" class="LineNr"> 32 </span> <a href='501draw-text.mu.html#L16'>move-cursor-right</a> <span class="Constant">0</span>
<span id="L33" class="LineNr"> 33 </span> <span class="PreProc">loop</span>
<span id="L34" class="LineNr"> 34 </span> <span class="Delimiter">}</span>
<span id="L35" class="LineNr"> 35 </span> <a href='500fake-screen.mu.html#L251'>clear-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>
<span id="L36" class="LineNr"> 36 </span> <span class="muComment"># parse</span>
<span id="L37" class="LineNr"> 37 </span> <span class="PreProc">var</span> a/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L38" class="LineNr"> 38 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L39" class="LineNr"> 39 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L40" class="LineNr"> 40 </span> <span class="muComment"># a, b, c = r, g, b</span>
<span id="L41" class="LineNr"> 41 </span> a, b, c <span class="Special">&lt;-</span> <a href='colors.mu.html#L58'>parse</a> in
<span id="L42" class="LineNr"> 42 </span><span class="CommentedCode">#? set-cursor-position screen, 0x10/x, 0x1a/y</span>
<span id="L43" class="LineNr"> 43 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, a, 7/fg, 0/bg</span>
<span id="L44" class="LineNr"> 44 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L45" class="LineNr"> 45 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, b, 7/fg, 0/bg</span>
<span id="L46" class="LineNr"> 46 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L47" class="LineNr"> 47 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, c, 7/fg, 0/bg</span>
<span id="L48" class="LineNr"> 48 </span> a, b, c <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> a, b, c
<span id="L49" class="LineNr"> 49 </span> <span class="muComment"># return all colors in the same quadrant in h, s and l</span>
<span id="L50" class="LineNr"> 50 </span> <a href='colors.mu.html#L182'>print-nearby-colors</a> <a href='500fake-screen.mu.html#L14'>screen</a>, a, b, c
<span id="L51" class="LineNr"> 51 </span> <span class="muComment">#</span>
<span id="L52" class="LineNr"> 52 </span> <span class="PreProc">loop</span>
<span id="L53" class="LineNr"> 53 </span> <span class="Delimiter">}</span>
<span id="L54" class="LineNr"> 54 </span><span class="Delimiter">}</span>
<span id="L55" class="LineNr"> 55 </span>
<span id="L56" class="LineNr"> 56 </span><span class="muComment"># read exactly 3 words in a single line</span>
<span id="L57" class="LineNr"> 57 </span><span class="muComment"># Each word consists of exactly 1 or 2 hex bytes. No hex prefix.</span>
<span id="L58" class="LineNr"> 58 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L58'>parse</a></span> in: (addr stream byte)<span class="PreProc"> -&gt; </span>_/<span class="muRegEcx">ecx</span>: int, _/<span class="muRegEdx">edx</span>: int, _/<span class="muRegEbx">ebx</span>: int <span class="Delimiter">{</span>
<span id="L59" class="LineNr"> 59 </span> <span class="muComment"># read first byte of r</span>
<span id="L60" class="LineNr"> 60 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L61" class="LineNr"> 61 </span> <span class="Delimiter">{</span>
<span id="L62" class="LineNr"> 62 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L63" class="LineNr"> 63 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L64" class="LineNr"> 64 </span> <span class="PreProc">break-if-!=</span>
<span id="L65" class="LineNr"> 65 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid byte 0 of r&quot;</span>
<span id="L66" class="LineNr"> 66 </span> <span class="Delimiter">}</span>
<span id="L67" class="LineNr"> 67 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L68" class="LineNr"> 68 </span> <span class="PreProc">var</span> r/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L69" class="LineNr"> 69 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x10/y</span>
<span id="L70" class="LineNr"> 70 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, r, 7/fg, 0/bg</span>
<span id="L71" class="LineNr"> 71 </span> <span class="muComment"># read second byte of r</span>
<span id="L72" class="LineNr"> 72 </span> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L73" class="LineNr"> 73 </span> <span class="Delimiter">{</span>
<span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">{</span>
<span id="L75" class="LineNr"> 75 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L76" class="LineNr"> 76 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L77" class="LineNr"> 77 </span> <span class="Delimiter">}</span>
<span id="L78" class="LineNr"> 78 </span> <span class="PreProc">break-if-=</span>
<span id="L79" class="LineNr"> 79 </span> r <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>
<span id="L80" class="LineNr"> 80 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L81" class="LineNr"> 81 </span><span class="CommentedCode">#? {</span>
<span id="L82" class="LineNr"> 82 </span><span class="CommentedCode">#? var foo/eax: int &lt;- copy tmp</span>
<span id="L83" class="LineNr"> 83 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x11/y</span>
<span id="L84" class="LineNr"> 84 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg, 0/bg</span>
<span id="L85" class="LineNr"> 85 </span><span class="CommentedCode">#? }</span>
<span id="L86" class="LineNr"> 86 </span> r <span class="Special">&lt;-</span> add tmp
<span id="L87" class="LineNr"> 87 </span><span class="CommentedCode">#? {</span>
<span id="L88" class="LineNr"> 88 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x12/y</span>
<span id="L89" class="LineNr"> 89 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, r, 7/fg, 0/bg</span>
<span id="L90" class="LineNr"> 90 </span><span class="CommentedCode">#? }</span>
<span id="L91" class="LineNr"> 91 </span> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in <span class="muComment"># skip space</span>
<span id="L92" class="LineNr"> 92 </span> <span class="Delimiter">}</span>
<span id="L93" class="LineNr"> 93 </span> <span class="muComment"># read first byte of g</span>
<span id="L94" class="LineNr"> 94 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L95" class="LineNr"> 95 </span> <span class="Delimiter">{</span>
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L97" class="LineNr"> 97 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L98" class="LineNr"> 98 </span> <span class="PreProc">break-if-!=</span>
<span id="L99" class="LineNr"> 99 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid byte 0 of g&quot;</span>
<span id="L100" class="LineNr">100 </span> <span class="Delimiter">}</span>
<span id="L101" class="LineNr">101 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L102" class="LineNr">102 </span> <span class="PreProc">var</span> g/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L103" class="LineNr">103 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x13/y</span>
<span id="L104" class="LineNr">104 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, g, 7/fg, 0/bg</span>
<span id="L105" class="LineNr">105 </span> <span class="muComment"># read second byte of g</span>
<span id="L106" class="LineNr">106 </span> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L107" class="LineNr">107 </span> <span class="Delimiter">{</span>
<span id="L108" class="LineNr">108 </span> <span class="Delimiter">{</span>
<span id="L109" class="LineNr">109 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L110" class="LineNr">110 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L111" class="LineNr">111 </span> <span class="Delimiter">}</span>
<span id="L112" class="LineNr">112 </span> <span class="PreProc">break-if-=</span>
<span id="L113" class="LineNr">113 </span> g <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>
<span id="L114" class="LineNr">114 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L115" class="LineNr">115 </span><span class="CommentedCode">#? {</span>
<span id="L116" class="LineNr">116 </span><span class="CommentedCode">#? var foo/eax: int &lt;- copy tmp</span>
<span id="L117" class="LineNr">117 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x14/y</span>
<span id="L118" class="LineNr">118 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg, 0/bg</span>
<span id="L119" class="LineNr">119 </span><span class="CommentedCode">#? }</span>
<span id="L120" class="LineNr">120 </span> g <span class="Special">&lt;-</span> add tmp
<span id="L121" class="LineNr">121 </span><span class="CommentedCode">#? {</span>
<span id="L122" class="LineNr">122 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x15/y</span>
<span id="L123" class="LineNr">123 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, g, 7/fg, 0/bg</span>
<span id="L124" class="LineNr">124 </span><span class="CommentedCode">#? }</span>
<span id="L125" class="LineNr">125 </span> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in <span class="muComment"># skip space</span>
<span id="L126" class="LineNr">126 </span> <span class="Delimiter">}</span>
<span id="L127" class="LineNr">127 </span> <span class="muComment"># read first byte of b</span>
<span id="L128" class="LineNr">128 </span> <span class="PreProc">var</span> tmp/eax: byte <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L129" class="LineNr">129 </span> <span class="Delimiter">{</span>
<span id="L130" class="LineNr">130 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L131" class="LineNr">131 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L132" class="LineNr">132 </span> <span class="PreProc">break-if-!=</span>
<span id="L133" class="LineNr">133 </span> <a href='317abort.subx.html#L5'>abort</a> <span class="Constant">&quot;invalid byte 0 of b&quot;</span>
<span id="L134" class="LineNr">134 </span> <span class="Delimiter">}</span>
<span id="L135" class="LineNr">135 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L136" class="LineNr">136 </span> <span class="PreProc">var</span> b/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy tmp
<span id="L137" class="LineNr">137 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x16/y</span>
<span id="L138" class="LineNr">138 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, b, 7/fg, 0/bg</span>
<span id="L139" class="LineNr">139 </span> <span class="muComment"># read second byte of b</span>
<span id="L140" class="LineNr">140 </span> <span class="Delimiter">{</span>
<span id="L141" class="LineNr">141 </span> <span class="Delimiter">{</span>
<span id="L142" class="LineNr">142 </span> <span class="PreProc">var</span> done?/eax: boolean <span class="Special">&lt;-</span> <a href='309stream.subx.html#L6'>stream-empty?</a> in
<span id="L143" class="LineNr">143 </span> compare done?, <span class="Constant">0</span>/false
<span id="L144" class="LineNr">144 </span> <span class="Delimiter">}</span>
<span id="L145" class="LineNr">145 </span> <span class="PreProc">break-if-!=</span>
<span id="L146" class="LineNr">146 </span> tmp <span class="Special">&lt;-</span> <a href='112read-byte.subx.html#L13'>read-byte</a> in
<span id="L147" class="LineNr">147 </span> <span class="Delimiter">{</span>
<span id="L148" class="LineNr">148 </span> <span class="PreProc">var</span> valid?/eax: boolean <span class="Special">&lt;-</span> <a href='118parse-hex-int.subx.html#L701'>hex-digit?</a> tmp
<span id="L149" class="LineNr">149 </span> compare valid?, <span class="Constant">0</span>/false
<span id="L150" class="LineNr">150 </span> <span class="Delimiter">}</span>
<span id="L151" class="LineNr">151 </span> <span class="PreProc">break-if-=</span>
<span id="L152" class="LineNr">152 </span> b <span class="Special">&lt;-</span> shift-left <span class="Constant">4</span>
<span id="L153" class="LineNr">153 </span> tmp <span class="Special">&lt;-</span> <a href='colors.mu.html#L169'>fast-hex-digit-value</a> tmp
<span id="L154" class="LineNr">154 </span><span class="CommentedCode">#? {</span>
<span id="L155" class="LineNr">155 </span><span class="CommentedCode">#? var foo/eax: int &lt;- copy tmp</span>
<span id="L156" class="LineNr">156 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x17/y</span>
<span id="L157" class="LineNr">157 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg, 0/bg</span>
<span id="L158" class="LineNr">158 </span><span class="CommentedCode">#? }</span>
<span id="L159" class="LineNr">159 </span> b <span class="Special">&lt;-</span> add tmp
<span id="L160" class="LineNr">160 </span><span class="CommentedCode">#? {</span>
<span id="L161" class="LineNr">161 </span><span class="CommentedCode">#? set-cursor-position 0/screen, 0x10/x, 0x18/y</span>
<span id="L162" class="LineNr">162 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, b, 7/fg, 0/bg</span>
<span id="L163" class="LineNr">163 </span><span class="CommentedCode">#? }</span>
<span id="L164" class="LineNr">164 </span> <span class="Delimiter">}</span>
<span id="L165" class="LineNr">165 </span> <span class="PreProc">return</span> r, g, b
<span id="L166" class="LineNr">166 </span><span class="Delimiter">}</span>
<span id="L167" class="LineNr">167 </span>
<span id="L168" class="LineNr">168 </span><span class="muComment"># no error checking</span>
<span id="L169" class="LineNr">169 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L169'>fast-hex-digit-value</a></span> in: byte<span class="PreProc"> -&gt; </span>_/eax: byte <span class="Delimiter">{</span>
<span id="L170" class="LineNr">170 </span> <span class="PreProc">var</span> result/eax: byte <span class="Special">&lt;-</span> copy in
<span id="L171" class="LineNr">171 </span> compare result, <span class="Constant">0x39</span>
<span id="L172" class="LineNr">172 </span> <span class="Delimiter">{</span>
<span id="L173" class="LineNr">173 </span> <span class="PreProc">break-if-&gt;</span>
<span id="L174" class="LineNr">174 </span> result <span class="Special">&lt;-</span> subtract <span class="Constant">0x30</span>/<span class="Constant">0</span>
<span id="L175" class="LineNr">175 </span> <span class="PreProc">return</span> result
<span id="L176" class="LineNr">176 </span> <span class="Delimiter">}</span>
<span id="L177" class="LineNr">177 </span> result <span class="Special">&lt;-</span> subtract <span class="Constant">0x61</span>/a
<span id="L178" class="LineNr">178 </span> result <span class="Special">&lt;-</span> add <span class="Constant">0xa</span>/<span class="Constant">10</span>
<span id="L179" class="LineNr">179 </span> <span class="PreProc">return</span> result
<span id="L180" class="LineNr">180 </span><span class="Delimiter">}</span>
<span id="L181" class="LineNr">181 </span>
<span id="L182" class="LineNr">182 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='colors.mu.html#L182'>print-nearby-colors</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), h: int, s: int, l: int <span class="Delimiter">{</span>
<span id="L183" class="LineNr">183 </span><span class="CommentedCode">#? set-cursor-position screen, 0x10/x, 0x1c/y</span>
<span id="L184" class="LineNr">184 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, h, 7/fg, 0/bg</span>
<span id="L185" class="LineNr">185 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L186" class="LineNr">186 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, s, 7/fg, 0/bg</span>
<span id="L187" class="LineNr">187 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L188" class="LineNr">188 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, l, 7/fg, 0/bg</span>
<span id="L189" class="LineNr">189 </span> <span class="muComment"># save just top 2 bits of each, so that we narrow down to 1/64th of the volume</span>
<span id="L190" class="LineNr">190 </span> shift-right h, <span class="Constant">6</span>
<span id="L191" class="LineNr">191 </span> shift-right s, <span class="Constant">6</span>
<span id="L192" class="LineNr">192 </span> shift-right l, <span class="Constant">6</span>
<span id="L193" class="LineNr">193 </span><span class="CommentedCode">#? set-cursor-position screen, 0x10/x, 0x1/y</span>
<span id="L194" class="LineNr">194 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, h, 7/fg, 0/bg</span>
<span id="L195" class="LineNr">195 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L196" class="LineNr">196 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, s, 7/fg, 0/bg</span>
<span id="L197" class="LineNr">197 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L198" class="LineNr">198 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, l, 7/fg, 0/bg</span>
<span id="L199" class="LineNr">199 </span> <span class="PreProc">var</span> a/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L200" class="LineNr">200 </span> <span class="PreProc">var</span> b/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L201" class="LineNr">201 </span> <span class="PreProc">var</span> c/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L202" class="LineNr">202 </span> <span class="PreProc">var</span> color/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
<span id="L203" class="LineNr">203 </span> <span class="PreProc">var</span> y/<span class="muRegEsi">esi</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">2</span>
<span id="L204" class="LineNr">204 </span> <span class="Delimiter">{</span>
<span id="L205" class="LineNr">205 </span> compare color, <span class="Constant">0x100</span>
<span id="L206" class="LineNr">206 </span> <span class="PreProc">break-if-&gt;=</span>
<span id="L207" class="LineNr">207 </span> a, b, c <span class="Special">&lt;-</span> <a href='316colors.subx.html#L7'>color-rgb</a> color
<span id="L208" class="LineNr">208 </span> a, b, c <span class="Special">&lt;-</span> <a href='505colors.mu.html#L5'>hsl</a> a, b, c
<span id="L209" class="LineNr">209 </span> a <span class="Special">&lt;-</span> shift-right <span class="Constant">6</span>
<span id="L210" class="LineNr">210 </span> b <span class="Special">&lt;-</span> shift-right <span class="Constant">6</span>
<span id="L211" class="LineNr">211 </span> c <span class="Special">&lt;-</span> shift-right <span class="Constant">6</span>
<span id="L212" class="LineNr">212 </span> <span class="Delimiter">{</span>
<span id="L213" class="LineNr">213 </span> compare a, h
<span id="L214" class="LineNr">214 </span> <span class="PreProc">break-if-!=</span>
<span id="L215" class="LineNr">215 </span> compare b, s
<span id="L216" class="LineNr">216 </span> <span class="PreProc">break-if-!=</span>
<span id="L217" class="LineNr">217 </span> compare c, l
<span id="L218" class="LineNr">218 </span> <span class="PreProc">break-if-!=</span>
<span id="L219" class="LineNr">219 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x10</span>/x, y
<span id="L220" class="LineNr">220 </span> <a href='501draw-text.mu.html#L387'>draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, color, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L221" class="LineNr">221 </span> <a href='500fake-screen.mu.html#L190'>set-cursor-position</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">0x14</span>/x, y
<span id="L222" class="LineNr">222 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">7</span>/fg, <span class="Constant">0</span>/bg
<span id="L223" class="LineNr">223 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot; &quot;</span>, <span class="Constant">0</span>/fg, color
<span id="L224" class="LineNr">224 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L225" class="LineNr">225 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, a, 7/fg, 0/bg</span>
<span id="L226" class="LineNr">226 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L227" class="LineNr">227 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, b, 7/fg, 0/bg</span>
<span id="L228" class="LineNr">228 </span><span class="CommentedCode">#? draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, &quot; &quot;, 7/fg, 0/bg</span>
<span id="L229" class="LineNr">229 </span><span class="CommentedCode">#? draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, c, 7/fg, 0/bg</span>
<span id="L230" class="LineNr">230 </span> y <span class="Special">&lt;-</span> increment
<span id="L231" class="LineNr">231 </span> <span class="Delimiter">}</span>
<span id="L232" class="LineNr">232 </span> color <span class="Special">&lt;-</span> increment
<span id="L233" class="LineNr">233 </span> <span class="PreProc">loop</span>
<span id="L234" class="LineNr">234 </span> <span class="Delimiter">}</span>
<span id="L235" class="LineNr">235 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

95
html/ex6.mu.html generated
View File

@ -1,95 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - ex6.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.Special { color: #ff6060; }
.LineNr { }
.Constant { color: #008787; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.muFunction { color: #af5f00; text-decoration: underline; }
.muComment { color: #005faf; }
-->
</style>
<script type='text/javascript'>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
var lineNum;
lineNum = window.location.hash;
lineNum = lineNum.substr(1); /* strip off '#' */
if (lineNum.indexOf('L') == -1) {
lineNum = 'L'+lineNum;
}
var lineElem = document.getElementById(lineNum);
/* Always jump to new location even if the line was hidden inside a fold, or
* we corrected the raw number to a line ID.
*/
if (lineElem) {
lineElem.scrollIntoView(true);
}
return true;
}
if ('onhashchange' in window) {
window.onhashchange = JumpToLine;
}
-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/main/ex6.mu'>https://github.com/akkartik/mu/blob/main/ex6.mu</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="muComment"># Drawing ASCII text incrementally.</span>
<span id="L2" class="LineNr"> 2 </span><span class="muComment">#</span>
<span id="L3" class="LineNr"> 3 </span><span class="muComment"># To build a disk image:</span>
<span id="L4" class="LineNr"> 4 </span><span class="muComment"># ./translate ex6.mu # emits code.img</span>
<span id="L5" class="LineNr"> 5 </span><span class="muComment"># To run:</span>
<span id="L6" class="LineNr"> 6 </span><span class="muComment"># qemu-system-i386 code.img</span>
<span id="L7" class="LineNr"> 7 </span><span class="muComment"># Or:</span>
<span id="L8" class="LineNr"> 8 </span><span class="muComment"># bochs -f bochsrc # bochsrc loads code.img</span>
<span id="L9" class="LineNr"> 9 </span><span class="muComment">#</span>
<span id="L10" class="LineNr">10 </span><span class="muComment"># Expected output: a box and text that doesn't overflow it</span>
<span id="L11" class="LineNr">11 </span>
<span id="L12" class="LineNr">12 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='ex6.mu.html#L12'>main</a></span> <a href='500fake-screen.mu.html#L14'>screen</a>: (addr <a href='500fake-screen.mu.html#L14'>screen</a>), keyboard: (addr keyboard), data-disk: (addr disk) <span class="Delimiter">{</span>
<span id="L13" class="LineNr">13 </span> <span class="muComment"># drawing text within a bounding box</span>
<span id="L14" class="LineNr">14 </span> <a href='503manhattan-line.mu.html#L1'>draw-box-on-real-screen</a> <span class="Constant">0xf</span>, <span class="Constant">0x1f</span>, <span class="Constant">0x79</span>, <span class="Constant">0x51</span>, <span class="Constant">0x4</span>
<span id="L15" class="LineNr">15 </span> <span class="PreProc">var</span> x/eax: int <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>
<span id="L16" class="LineNr">16 </span> <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0x20</span>
<span id="L17" class="LineNr">17 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;hello &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L18" class="LineNr">18 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;from &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L19" class="LineNr">19 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;baremetal &quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L20" class="LineNr">20 </span> x, y <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L174'>draw-text-wrapping-right-then-down</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;Mu!&quot;</span>, <span class="Constant">0x10</span>/xmin, <span class="Constant">0x20</span>/ymin, <span class="Constant">0x78</span>/xmax, <span class="Constant">0x50</span>/ymax, x, y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L21" class="LineNr">21 </span>
<span id="L22" class="LineNr">22 </span> <span class="muComment"># drawing at the cursor in multiple directions</span>
<span id="L23" class="LineNr">23 </span> <a href='501draw-text.mu.html#L493'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;abc&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L24" class="LineNr">24 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;def&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L25" class="LineNr">25 </span>
<span id="L26" class="LineNr">26 </span> <span class="muComment"># test drawing near the edge</span>
<span id="L27" class="LineNr">27 </span> x <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L100'>draw-text-rightward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;R&quot;</span>, <span class="Constant">0x7f</span>/x, <span class="Constant">0x80</span>/xmax=screen-width, <span class="Constant">0x18</span>/y, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L28" class="LineNr">28 </span> <a href='501draw-text.mu.html#L279'>draw-text-wrapping-right-then-down-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;wrapped from R&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L29" class="LineNr">29 </span>
<span id="L30" class="LineNr">30 </span> x <span class="Special">&lt;-</span> <a href='501draw-text.mu.html#L399'>draw-text-downward</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;D&quot;</span>, <span class="Constant">0x20</span>/x, <span class="Constant">0x2f</span>/y, <span class="Constant">0x30</span>/ymax=screen-height, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L31" class="LineNr">31 </span> <a href='501draw-text.mu.html#L493'>draw-text-wrapping-down-then-right-from-cursor-over-full-screen</a> <a href='500fake-screen.mu.html#L14'>screen</a>, <span class="Constant">&quot;wrapped from D&quot;</span>, <span class="Constant">0xa</span>/fg, <span class="Constant">0</span>/bg
<span id="L32" class="LineNr">32 </span><span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->

1097
html/hest-life.mu.html generated

File diff suppressed because it is too large Load Diff

24
html/life.mu.html generated
View File

@ -1,36 +1,36 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - life.mu</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.PreProc { color: #c000c0; }
.muRegEbx { color: #5f00ff; }
.muRegEcx { color: #870000; }
.muRegEdx { color: #af5f00; }
.Special { color: #ff6060; }
.LineNr { }
.muRegEsi { color: #005faf; }
.muRegEbx { color: #5f00ff; }
.Constant { color: #008787; }
.muRegEdi { color: #00af00; }
.muRegEcx { color: #870000; }
.Delimiter { color: #c000c0; }
.Constant { color: #008787; }
.muFunction { color: #af5f00; text-decoration: underline; }
.CommentedCode { color: #8a8a8a; }
.Delimiter { color: #c000c0; }
.muComment { color: #005faf; }
.Special { color: #ff6060; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/000init.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -20,7 +20,7 @@ a { color:inherit; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/101_write.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -20,12 +20,12 @@ a { color:inherit; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.subxMinorFunction { color: #875f5f; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxMinorFunction { color: #875f5f; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/102test.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,16 +16,16 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.LineNr { }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,34 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/103kernel-string-equal.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.subxMinorFunction { color: #875f5f; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.Constant { color: #008787; }
.subxS2Comment { color: #8a8a8a; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/104new-segment.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,17 +16,17 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.LineNr { }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.Constant { color: #008787; }
.subxMinorFunction { color: #875f5f; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,34 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/105string-equal.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.CommentedCode { color: #8a8a8a; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.Constant { color: #008787; }
.subxS2Comment { color: #8a8a8a; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
.subxTest { color: #5f8700; }
.CommentedCode { color: #8a8a8a; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/106stream.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,35 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/107trace.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Constant { color: #008787; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.CommentedCode { color: #8a8a8a; }
.SpecialChar { color: #d70000; }
.subxMinorFunction { color: #875f5f; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS2Comment { color: #8a8a8a; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
.LineNr { }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
.CommentedCode { color: #8a8a8a; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/108write.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,16 +17,16 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/109stream-equal.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/110stop.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,17 +17,17 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.CommentedCode { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
.CommentedCode { color: #8a8a8a; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/111read.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,17 +17,17 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxMinorFunction { color: #875f5f; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,34 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/112read-byte.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.subxMinorFunction { color: #875f5f; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS2Comment { color: #8a8a8a; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/113write-stream.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,17 +17,17 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.CommentedCode { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
.CommentedCode { color: #8a8a8a; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/114error.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,34 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/115write-byte.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.subxMinorFunction { color: #875f5f; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.SpecialChar { color: #d70000; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS2Comment { color: #8a8a8a; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/116write-buffered.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,18 +16,18 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.SpecialChar { color: #d70000; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/117write-int-hex.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,17 +17,17 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.Constant { color: #008787; }
.Folded { color: #080808; background-color: #949494; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -458,7 +458,7 @@ if ('onhashchange' in window) {
<span id="L397" class="LineNr">397 </span> e8/call <a href='115write-byte.subx.html#L81'>flush</a>/disp32
<span id="L398" class="LineNr">398 </span> <span class="subxS2Comment"># . . discard args</span>
<span id="L399" class="LineNr">399 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/imm32 <span class="subxComment"># add to esp</span>
<span id="L400" class="Folded">400 </span><span class="Folded">+-- 18 lines: #? # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L400" class="Folded">400 </span><span class="Folded">+-- 18 lines: #? # dump line -------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L418" class="LineNr">418 </span> <span class="subxComment"># check-stream-equal(_test-stream, &quot;0x008899aa&quot;, msg)</span>
<span id="L419" class="LineNr">419 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L420" class="LineNr">420 </span> 68/push <span class="Constant">&quot;F - test-write-int32-hex-buffered&quot;</span>/imm32

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/118parse-hex-int.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,17 +16,17 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.SpecialChar { color: #d70000; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/119error-byte.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,16 +17,16 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.SpecialChar { color: #d70000; }
.subxS1Comment { color: #0000af; }
.CommentedCode { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.CommentedCode { color: #8a8a8a; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/120allocate.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -16,18 +16,18 @@ a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.SpecialChar { color: #d70000; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.Constant { color: #008787; }
.subxMinorFunction { color: #875f5f; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/121new-stream.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/122read-line.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,16 +17,16 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/123slice.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,17 +17,17 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.Folded { color: #080808; background-color: #949494; }
.Constant { color: #008787; }
.subxTest { color: #5f8700; }
.subxH1Comment { color: #005faf; text-decoration: underline; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */
@ -1228,7 +1228,7 @@ if ('onhashchange' in window) {
<span id="L1167" class="LineNr">1167 </span> 8b/copy 1/mod/*+disp8 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax 4/disp8 <span class="Normal"> . </span> <span class="subxComment"># copy *(ebx+4) to eax</span>
<span id="L1168" class="LineNr">1168 </span> <span class="subxComment"># skip payload-&gt;allocid</span>
<span id="L1169" class="LineNr">1169 </span> 05/add-to-eax 4/imm32
<span id="L1170" class="Folded">1170 </span><span class="Folded">+-- 26 lines: #? # dump eax ---------------------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1170" class="Folded">1170 </span><span class="Folded">+-- 26 lines: #? # dump eax --------------------------------------------------------------------------------------------------------------------------------------------</span>
<span id="L1196" class="LineNr">1196 </span> <span class="subxComment"># eax = string-equal?(eax, &quot;Abc&quot;)</span>
<span id="L1197" class="LineNr">1197 </span> <span class="subxS2Comment"># . . push args</span>
<span id="L1198" class="LineNr">1198 </span> 68/push <span class="Constant">&quot;Abc&quot;</span>/imm32

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/124next-token.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

View File

@ -1,14 +1,14 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Mu - linux/125write-stream-data.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="Generator" content="Vim/8.2">
<meta name="plugin-version" content="vim8.1_v2">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<style>
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
@ -17,15 +17,15 @@ a { color:inherit; }
.subxComment { color: #005faf; }
.subxS2Comment { color: #8a8a8a; }
.LineNr { }
.subxTest { color: #5f8700; }
.subxS1Comment { color: #0000af; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxS1Comment { color: #0000af; }
.Constant { color: #008787; }
.Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; }
.subxTest { color: #5f8700; }
-->
</style>
<script type='text/javascript'>
<script>
<!--
/* function to open any folds containing a jumped-to line before jumping to it */

Some files were not shown because too many files have changed in this diff Show More