diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-11-26 01:19:47 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-11-26 01:19:47 -0800 |
commit | d1c9392a5461e0d33e226375a8f7986a97d2d66b (patch) | |
tree | 494c19edbe1d1522344b56ced6aa7c040ad37406 /html/subx/apps/factorial.subx.html | |
parent | 7e00968c99f97e13be8f5269feaf7fd1d33ecd33 (diff) | |
download | mu-d1c9392a5461e0d33e226375a8f7986a97d2d66b.tar.gz |
4782
Diffstat (limited to 'html/subx/apps/factorial.subx.html')
-rw-r--r-- | html/subx/apps/factorial.subx.html | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/html/subx/apps/factorial.subx.html b/html/subx/apps/factorial.subx.html index a30495cb..ea499438 100644 --- a/html/subx/apps/factorial.subx.html +++ b/html/subx/apps/factorial.subx.html @@ -16,7 +16,9 @@ a { color:#eeeeee; text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } .LineNr { color: #444444; } +.Constant { color: #00a0a0; } .Delimiter { color: #800080; } +.Special { color: #c00000; } .Comment { color: #9090ff; } .Comment a { color:#0000ee; text-decoration:underline; } .SalientComment { color: #00ffff; } @@ -83,7 +85,7 @@ if ('onhashchange' in window) { <span id="L27" class="LineNr"> 27 </span> 7e/jump-if-lesser-or-equal $run-main/disp8 <span id="L28" class="LineNr"> 28 </span> <span class="Comment"># and if (argv[1] == "test")</span> <span id="L29" class="LineNr"> 29 </span> <span class="Comment"># push args</span> -<span id="L30" class="LineNr"> 30 </span> 68/push "test"/imm32 +<span id="L30" class="LineNr"> 30 </span> 68/push <span class="Constant">"test"</span>/imm32 <span id="L31" class="LineNr"> 31 </span> ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none <span class="Delimiter"> . </span> <span class="Delimiter"> . </span> 0x8/disp8 <span class="Delimiter"> . </span> <span class="Comment"># push *(EBP+8)</span> <span id="L32" class="LineNr"> 32 </span> <span class="Comment"># call</span> <span id="L33" class="LineNr"> 33 </span> e8/call kernel-string-equal/disp32 @@ -94,7 +96,7 @@ if ('onhashchange' in window) { <span id="L38" class="LineNr"> 38 </span> 75/jump-if-not-equal $run-main/disp8 <span id="L39" class="LineNr"> 39 </span> <span class="Comment"># then return run-tests()</span> <span id="L40" class="LineNr"> 40 </span> e8/call run-tests/disp32 -<span id="L41" class="LineNr"> 41 </span> 8b/copy 0/mod/indirect 5/rm32/.disp32 <span class="Delimiter"> . </span> <span class="Delimiter"> . </span> 0/r32/EAX Num-test-failures/disp32 <span class="Comment"># copy *Num-test-failures to EAX</span> +<span id="L41" class="LineNr"> 41 </span> 8b/copy 0/mod/indirect 5/rm32/.disp32 <span class="Delimiter"> . </span> <span class="Delimiter"> . </span> 0/r32/EAX <span class="Special">Num-test-failures</span>/disp32 <span class="Comment"># copy *Num-test-failures to EAX</span> <span id="L42" class="LineNr"> 42 </span> eb/jump $main:end/disp8 <span class="Comment"># where EAX will get copied to EBX</span> <span id="L43" class="LineNr"> 43 </span> <span class="Comment"># else EAX = factorial(5)</span> <span id="L44" class="LineNr"> 44 </span>$run-main: @@ -151,7 +153,7 @@ if ('onhashchange' in window) { <span id="L95" class="LineNr"> 95 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="Delimiter"> . </span> <span class="Delimiter"> . </span> <span class="Delimiter"> . </span> <span class="Delimiter"> . </span> <span class="Delimiter"> . </span> 4/imm32 <span class="Comment"># add to ESP</span> <span id="L96" class="LineNr"> 96 </span> <span class="Comment"># check-ints-equal(EAX, 120, failure message)</span> <span id="L97" class="LineNr"> 97 </span> <span class="Comment"># push args</span> -<span id="L98" class="LineNr"> 98 </span> 68/push "F - test-factorial"/imm32 +<span id="L98" class="LineNr"> 98 </span> 68/push <span class="Constant">"F - test-factorial"</span>/imm32 <span id="L99" class="LineNr"> 99 </span> 68/push 0x78/imm32/expected-120 <span id="L100" class="LineNr">100 </span> 50/push-EAX <span id="L101" class="LineNr">101 </span> <span class="Comment"># call</span> |