diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-01-07 13:36:15 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-01-07 13:36:15 -0800 |
commit | 96a6bac52d6f4a67932e54d25166bf7961718e9d (patch) | |
tree | ca35d65154852542b7b5717fd45e02532ce97ea4 /html/subx/054string-equal.subx.html | |
parent | 74a46597aad859875327809e885be09e983d24ea (diff) | |
download | mu-96a6bac52d6f4a67932e54d25166bf7961718e9d.tar.gz |
4914
Diffstat (limited to 'html/subx/054string-equal.subx.html')
-rw-r--r-- | html/subx/054string-equal.subx.html | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/html/subx/054string-equal.subx.html b/html/subx/054string-equal.subx.html index 83507aed..2544aca2 100644 --- a/html/subx/054string-equal.subx.html +++ b/html/subx/054string-equal.subx.html @@ -2,7 +2,7 @@ <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> -<title>Mu - subx/054string_equal.subx</title> +<title>Mu - subx/054string-equal.subx</title> <meta name="Generator" content="Vim/8.0"> <meta name="plugin-version" content="vim7.4_v2"> <meta name="syntax" content="none"> @@ -57,7 +57,7 @@ if ('onhashchange' in window) { </script> </head> <body onload='JumpToLine();'> -<a href='https://github.com/akkartik/mu/blob/master/subx/054string_equal.subx'>https://github.com/akkartik/mu/blob/master/subx/054string_equal.subx</a> +<a href='https://github.com/akkartik/mu/blob/master/subx/054string-equal.subx'>https://github.com/akkartik/mu/blob/master/subx/054string-equal.subx</a> <pre id='vimCodeElement'> <span id="L1" class="LineNr"> 1 </span><span class="subxComment"># Comparing 'regular' length-prefixed strings.</span> <span id="L2" class="LineNr"> 2 </span> @@ -75,26 +75,26 @@ if ('onhashchange' in window) { <span id="L14" class="LineNr"> 14 </span> cd/syscall 0x80/imm8 <span id="L15" class="LineNr"> 15 </span> <span id="L16" class="LineNr"> 16 </span><span class="subxFunction">string-equal</span>: <span class="subxComment"># s : string, benchmark : string -> EAX : boolean</span> -<span id="L17" class="LineNr"> 17 </span> <span class="subxS1Comment"># . prolog</span> -<span id="L18" class="LineNr"> 18 </span> 55/push-EBP -<span id="L19" class="LineNr"> 19 </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="L20" class="LineNr"> 20 </span> <span class="subxS1Comment"># . save registers</span> -<span id="L21" class="LineNr"> 21 </span> 51/push-ECX -<span id="L22" class="LineNr"> 22 </span> 52/push-EDX -<span id="L23" class="LineNr"> 23 </span> 53/push-EBX -<span id="L24" class="LineNr"> 24 </span> 56/push-ESI -<span id="L25" class="LineNr"> 25 </span> <span class="subxComment"># pseudocode:</span> -<span id="L26" class="LineNr"> 26 </span> <span class="subxComment"># if s->length != b->length return false</span> -<span id="L27" class="LineNr"> 27 </span> <span class="subxComment"># for i = 0; i < s->length; ++i</span> -<span id="L28" class="LineNr"> 28 </span> <span class="subxComment"># if s[i] != b[i] return false</span> -<span id="L29" class="LineNr"> 29 </span> <span class="subxComment"># return true</span> -<span id="L30" class="LineNr"> 30 </span> <span class="subxComment"># registers:</span> -<span id="L31" class="LineNr"> 31 </span> <span class="subxComment"># i: ECX</span> -<span id="L32" class="LineNr"> 32 </span> <span class="subxComment"># s->length: EDX</span> -<span id="L33" class="LineNr"> 33 </span> <span class="subxComment"># b->length: EBX</span> -<span id="L34" class="LineNr"> 34 </span> <span class="subxComment"># b[i]: EBX</span> -<span id="L35" class="LineNr"> 35 </span> <span class="subxComment"># s[i]: EAX</span> -<span id="L36" class="LineNr"> 36 </span> <span class="subxComment">#</span> +<span id="L17" class="LineNr"> 17 </span> <span class="subxComment"># pseudocode:</span> +<span id="L18" class="LineNr"> 18 </span> <span class="subxComment"># if s->length != b->length return false</span> +<span id="L19" class="LineNr"> 19 </span> <span class="subxComment"># for i = 0; i < s->length; ++i</span> +<span id="L20" class="LineNr"> 20 </span> <span class="subxComment"># if s[i] != b[i] return false</span> +<span id="L21" class="LineNr"> 21 </span> <span class="subxComment"># return true</span> +<span id="L22" class="LineNr"> 22 </span> <span class="subxComment"># registers:</span> +<span id="L23" class="LineNr"> 23 </span> <span class="subxComment"># i: ECX</span> +<span id="L24" class="LineNr"> 24 </span> <span class="subxComment"># s->length: EDX</span> +<span id="L25" class="LineNr"> 25 </span> <span class="subxComment"># b->length: EBX</span> +<span id="L26" class="LineNr"> 26 </span> <span class="subxComment"># b[i]: EBX</span> +<span id="L27" class="LineNr"> 27 </span> <span class="subxComment"># s[i]: EAX</span> +<span id="L28" class="LineNr"> 28 </span> <span class="subxComment">#</span> +<span id="L29" class="LineNr"> 29 </span> <span class="subxS1Comment"># . prolog</span> +<span id="L30" class="LineNr"> 30 </span> 55/push-EBP +<span id="L31" class="LineNr"> 31 </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="L32" class="LineNr"> 32 </span> <span class="subxS1Comment"># . save registers</span> +<span id="L33" class="LineNr"> 33 </span> 51/push-ECX +<span id="L34" class="LineNr"> 34 </span> 52/push-EDX +<span id="L35" class="LineNr"> 35 </span> 53/push-EBX +<span id="L36" class="LineNr"> 36 </span> 56/push-ESI <span id="L37" class="LineNr"> 37 </span> <span class="subxComment"># var s/EAX : (address array byte)</span> <span id="L38" class="LineNr"> 38 </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="L39" class="LineNr"> 39 </span> <span class="subxComment"># var benchmark/EBX : (address array byte)</span> @@ -154,7 +154,7 @@ if ('onhashchange' in window) { <span id="L93" class="LineNr"> 93 </span> 68/push <span class="Constant">""</span>/imm32 <span id="L94" class="LineNr"> 94 </span> 68/push <span class="Constant">""</span>/imm32 <span id="L95" class="LineNr"> 95 </span> <span class="subxS2Comment"># . . call</span> -<span id="L96" class="LineNr"> 96 </span> e8/call <a href='054string_equal.subx.html#L16'>string-equal</a>/disp32 +<span id="L96" class="LineNr"> 96 </span> e8/call <a href='054string-equal.subx.html#L16'>string-equal</a>/disp32 <span id="L97" class="LineNr"> 97 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L98" class="LineNr"> 98 </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="L99" class="LineNr"> 99 </span> <span class="subxComment"># check-ints-equal(EAX, 1, msg)</span> @@ -174,7 +174,7 @@ if ('onhashchange' in window) { <span id="L113" class="LineNr">113 </span> 68/push <span class="Constant">"Abc"</span>/imm32 <span id="L114" class="LineNr">114 </span> 68/push <span class="Constant">""</span>/imm32 <span id="L115" class="LineNr">115 </span> <span class="subxS2Comment"># . . call</span> -<span id="L116" class="LineNr">116 </span> e8/call <a href='054string_equal.subx.html#L16'>string-equal</a>/disp32 +<span id="L116" class="LineNr">116 </span> e8/call <a href='054string-equal.subx.html#L16'>string-equal</a>/disp32 <span id="L117" class="LineNr">117 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L118" class="LineNr">118 </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="L119" class="LineNr">119 </span> <span class="subxComment"># check-ints-equal(EAX, 0, msg)</span> @@ -194,7 +194,7 @@ if ('onhashchange' in window) { <span id="L133" class="LineNr">133 </span> 68/push <span class="Constant">"Abc"</span>/imm32 <span id="L134" class="LineNr">134 </span> 68/push <span class="Constant">"Abc"</span>/imm32 <span id="L135" class="LineNr">135 </span> <span class="subxS2Comment"># . . call</span> -<span id="L136" class="LineNr">136 </span> e8/call <a href='054string_equal.subx.html#L16'>string-equal</a>/disp32 +<span id="L136" class="LineNr">136 </span> e8/call <a href='054string-equal.subx.html#L16'>string-equal</a>/disp32 <span id="L137" class="LineNr">137 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L138" class="LineNr">138 </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="L139" class="LineNr">139 </span> <span class="subxComment"># check-ints-equal(EAX, 1, msg)</span> @@ -214,7 +214,7 @@ if ('onhashchange' in window) { <span id="L153" class="LineNr">153 </span> 68/push <span class="Constant">"Adc"</span>/imm32 <span id="L154" class="LineNr">154 </span> 68/push <span class="Constant">"Abc"</span>/imm32 <span id="L155" class="LineNr">155 </span> <span class="subxS2Comment"># . . call</span> -<span id="L156" class="LineNr">156 </span> e8/call <a href='054string_equal.subx.html#L16'>string-equal</a>/disp32 +<span id="L156" class="LineNr">156 </span> e8/call <a href='054string-equal.subx.html#L16'>string-equal</a>/disp32 <span id="L157" class="LineNr">157 </span> <span class="subxS2Comment"># . . discard args</span> <span id="L158" class="LineNr">158 </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="L159" class="LineNr">159 </span> <span class="subxComment"># check-ints-equal(EAX, 0, msg)</span> |