diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-01-27 00:39:46 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-01-27 00:39:46 -0800 |
commit | 2104d1a75b76dbffc0b15a96c98d94e7a16594e8 (patch) | |
tree | 2a839b86e76431a9bbe4bf155f7411171a26d7f8 /html/100array-equal.subx.html | |
parent | 71eb22a5bf94f5fa0a3c95212450e3c6a1a6a990 (diff) | |
download | mu-2104d1a75b76dbffc0b15a96c98d94e7a16594e8.tar.gz |
5925
Diffstat (limited to 'html/100array-equal.subx.html')
-rw-r--r-- | html/100array-equal.subx.html | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/html/100array-equal.subx.html b/html/100array-equal.subx.html index ab7a0357..356bc7d1 100644 --- a/html/100array-equal.subx.html +++ b/html/100array-equal.subx.html @@ -62,7 +62,7 @@ if ('onhashchange' in window) { <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">array-equal?</span>: <span class="subxComment"># a : (addr array int), b : (addr array int) -> eax : boolean</span> +<span id="L5" class="LineNr"> 5 </span><span class="subxFunction">array-equal?</span>: <span class="subxComment"># a: (addr array int), b: (addr array int) -> eax: boolean</span> <span id="L6" class="LineNr"> 6 </span> <span class="subxComment"># pseudocode:</span> <span id="L7" class="LineNr"> 7 </span> <span class="subxComment"># lena = a->length</span> <span id="L8" class="LineNr"> 8 </span> <span class="subxComment"># if (lena != b->length) return false</span> @@ -97,27 +97,27 @@ if ('onhashchange' in window) { <span id="L37" class="LineNr"> 37 </span> 8b/-> *(ebp+8) 6/r32/esi <span id="L38" class="LineNr"> 38 </span> <span class="subxComment"># edi = b</span> <span id="L39" class="LineNr"> 39 </span> 8b/-> *(ebp+0xc) 7/r32/edi -<span id="L40" class="LineNr"> 40 </span> <span class="subxComment"># var lena/edx : int = a->length</span> +<span id="L40" class="LineNr"> 40 </span> <span class="subxComment"># var lena/edx: int = a->length</span> <span id="L41" class="LineNr"> 41 </span> 8b/-> *esi 2/r32/edx <span id="L42" class="LineNr"> 42 </span><span class="Constant">$array-equal?:lengths</span>: <span id="L43" class="LineNr"> 43 </span> <span class="subxComment"># if (lena != b->length) return false</span> <span id="L44" class="LineNr"> 44 </span> 39/compare *edi 2/r32/edx <span id="L45" class="LineNr"> 45 </span> 75/jump-if-!= $array-equal?:false/disp8 -<span id="L46" class="LineNr"> 46 </span> <span class="subxComment"># var curra/esi : (addr byte) = a->data</span> +<span id="L46" class="LineNr"> 46 </span> <span class="subxComment"># var curra/esi: (addr byte) = a->data</span> <span id="L47" class="LineNr"> 47 </span> 81 0/subop/add %esi 4/imm32 -<span id="L48" class="LineNr"> 48 </span> <span class="subxComment"># var currb/edi : (addr byte) = b->data</span> +<span id="L48" class="LineNr"> 48 </span> <span class="subxComment"># var currb/edi: (addr byte) = b->data</span> <span id="L49" class="LineNr"> 49 </span> 81 0/subop/add %edi 4/imm32 -<span id="L50" class="LineNr"> 50 </span> <span class="subxComment"># var i/ecx : int = 0</span> +<span id="L50" class="LineNr"> 50 </span> <span class="subxComment"># var i/ecx: int = 0</span> <span id="L51" class="LineNr"> 51 </span> 31/xor %ecx 1/r32/ecx -<span id="L52" class="LineNr"> 52 </span> <span class="subxComment"># var vala/eax : int</span> -<span id="L53" class="LineNr"> 53 </span> <span class="subxComment"># var valb/ebx : int</span> +<span id="L52" class="LineNr"> 52 </span> <span class="subxComment"># var vala/eax: int</span> +<span id="L53" class="LineNr"> 53 </span> <span class="subxComment"># var valb/ebx: int</span> <span id="L54" class="LineNr"> 54 </span><span class="Constant">$array-equal?:loop</span>: <span id="L55" class="LineNr"> 55 </span> <span class="subxComment"># if (i >= lena) return true</span> <span id="L56" class="LineNr"> 56 </span> 39/compare %ecx 2/r32/edx <span id="L57" class="LineNr"> 57 </span> 7d/jump-if->= $array-equal?:true/disp8 -<span id="L58" class="LineNr"> 58 </span> <span class="subxComment"># var vala/eax : int = *curra</span> +<span id="L58" class="LineNr"> 58 </span> <span class="subxComment"># var vala/eax: int = *curra</span> <span id="L59" class="LineNr"> 59 </span> 8b/-> *esi 0/r32/eax -<span id="L60" class="LineNr"> 60 </span> <span class="subxComment"># var valb/ebx : int = *currb</span> +<span id="L60" class="LineNr"> 60 </span> <span class="subxComment"># var valb/ebx: int = *currb</span> <span id="L61" class="LineNr"> 61 </span> 8b/-> *edi 3/r32/ebx <span id="L62" class="LineNr"> 62 </span> <span class="subxComment"># if (vala != valb) return false</span> <span id="L63" class="LineNr"> 63 </span> 39/compare %eax 3/r32/ebx @@ -150,10 +150,10 @@ if ('onhashchange' in window) { <span id="L90" class="LineNr"> 90 </span> <span class="subxS1Comment"># . prologue</span> <span id="L91" class="LineNr"> 91 </span> 55/push-ebp <span id="L92" class="LineNr"> 92 </span> 89/<- %ebp 4/r32/esp -<span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># var ecx : (array _) = []</span> +<span id="L93" class="LineNr"> 93 </span> <span class="subxComment"># var ecx: (array _) = []</span> <span id="L94" class="LineNr"> 94 </span> 68/push 0/imm32/size <span id="L95" class="LineNr"> 95 </span> 89/<- %ecx 4/r32/esp -<span id="L96" class="LineNr"> 96 </span> <span class="subxComment"># var edx : (array _) = []</span> +<span id="L96" class="LineNr"> 96 </span> <span class="subxComment"># var edx: (array _) = []</span> <span id="L97" class="LineNr"> 97 </span> 68/push 0/imm32/size <span id="L98" class="LineNr"> 98 </span> 89/<- %edx 4/r32/esp <span id="L99" class="LineNr"> 99 </span> <span class="subxComment"># eax = array-equal?(ecx, edx)</span> @@ -182,11 +182,11 @@ if ('onhashchange' in window) { <span id="L122" class="LineNr">122 </span> <span class="subxS1Comment"># . prologue</span> <span id="L123" class="LineNr">123 </span> 55/push-ebp <span id="L124" class="LineNr">124 </span> 89/<- %ebp 4/r32/esp -<span id="L125" class="LineNr">125 </span> <span class="subxComment"># var ecx : (array int) = [1]</span> +<span id="L125" class="LineNr">125 </span> <span class="subxComment"># var ecx: (array int) = [1]</span> <span id="L126" class="LineNr">126 </span> 68/push 1/imm32 <span id="L127" class="LineNr">127 </span> 68/push 4/imm32/size <span id="L128" class="LineNr">128 </span> 89/<- %ecx 4/r32/esp -<span id="L129" class="LineNr">129 </span> <span class="subxComment"># var edx : (array int) = []</span> +<span id="L129" class="LineNr">129 </span> <span class="subxComment"># var edx: (array int) = []</span> <span id="L130" class="LineNr">130 </span> 68/push 0/imm32/size <span id="L131" class="LineNr">131 </span> 89/<- %edx 4/r32/esp <span id="L132" class="LineNr">132 </span> <span class="subxComment"># eax = array-equal?(ecx, edx)</span> @@ -215,13 +215,13 @@ if ('onhashchange' in window) { <span id="L155" class="LineNr">155 </span> <span class="subxS1Comment"># . prologue</span> <span id="L156" class="LineNr">156 </span> 55/push-ebp <span id="L157" class="LineNr">157 </span> 89/<- %ebp 4/r32/esp -<span id="L158" class="LineNr">158 </span> <span class="subxComment"># var ecx : (array int) = [1, 2, 3]</span> +<span id="L158" class="LineNr">158 </span> <span class="subxComment"># var ecx: (array int) = [1, 2, 3]</span> <span id="L159" class="LineNr">159 </span> 68/push 3/imm32 <span id="L160" class="LineNr">160 </span> 68/push 2/imm32 <span id="L161" class="LineNr">161 </span> 68/push 1/imm32 <span id="L162" class="LineNr">162 </span> 68/push 0xc/imm32/size <span id="L163" class="LineNr">163 </span> 89/<- %ecx 4/r32/esp -<span id="L164" class="LineNr">164 </span> <span class="subxComment"># var edx : (array int) = [1, 2, 3]</span> +<span id="L164" class="LineNr">164 </span> <span class="subxComment"># var edx: (array int) = [1, 2, 3]</span> <span id="L165" class="LineNr">165 </span> 68/push 3/imm32 <span id="L166" class="LineNr">166 </span> 68/push 2/imm32 <span id="L167" class="LineNr">167 </span> 68/push 1/imm32 @@ -253,13 +253,13 @@ if ('onhashchange' in window) { <span id="L193" class="LineNr">193 </span> <span class="subxS1Comment"># . prologue</span> <span id="L194" class="LineNr">194 </span> 55/push-ebp <span id="L195" class="LineNr">195 </span> 89/<- %ebp 4/r32/esp -<span id="L196" class="LineNr">196 </span> <span class="subxComment"># var ecx : (array int) = [1, 4, 3]</span> +<span id="L196" class="LineNr">196 </span> <span class="subxComment"># var ecx: (array int) = [1, 4, 3]</span> <span id="L197" class="LineNr">197 </span> 68/push 3/imm32 <span id="L198" class="LineNr">198 </span> 68/push 4/imm32 <span id="L199" class="LineNr">199 </span> 68/push 1/imm32 <span id="L200" class="LineNr">200 </span> 68/push 0xc/imm32/size <span id="L201" class="LineNr">201 </span> 89/<- %ecx 4/r32/esp -<span id="L202" class="LineNr">202 </span> <span class="subxComment"># var edx : (array int) = [1, 2, 3]</span> +<span id="L202" class="LineNr">202 </span> <span class="subxComment"># var edx: (array int) = [1, 2, 3]</span> <span id="L203" class="LineNr">203 </span> 68/push 3/imm32 <span id="L204" class="LineNr">204 </span> 68/push 2/imm32 <span id="L205" class="LineNr">205 </span> 68/push 1/imm32 @@ -287,7 +287,7 @@ if ('onhashchange' in window) { <span id="L227" class="LineNr">227 </span> 5d/pop-to-ebp <span id="L228" class="LineNr">228 </span> c3/return <span id="L229" class="LineNr">229 </span> -<span id="L230" class="LineNr">230 </span><span class="subxFunction">parse-array-of-ints</span>: <span class="subxComment"># ad : (addr allocation-descriptor), s : (addr string) -> result/eax : (handle array int)</span> +<span id="L230" class="LineNr">230 </span><span class="subxFunction">parse-array-of-ints</span>: <span class="subxComment"># ad: (addr allocation-descriptor), s: (addr string) -> result/eax: (handle array int)</span> <span id="L231" class="LineNr">231 </span> <span class="subxComment"># pseudocode</span> <span id="L232" class="LineNr">232 </span> <span class="subxComment"># end = &s->data[s->length]</span> <span id="L233" class="LineNr">233 </span> <span class="subxComment"># curr = s->data</span> @@ -300,7 +300,7 @@ if ('onhashchange' in window) { <span id="L240" class="LineNr">240 </span> <span class="subxComment"># ++size</span> <span id="L241" class="LineNr">241 </span> <span class="subxComment"># result = allocate(ad, (size+1)*4)</span> <span id="L242" class="LineNr">242 </span> <span class="subxComment"># result->size = (size+1)*4</span> -<span id="L243" class="LineNr">243 </span> <span class="subxComment"># var slice : slice = {s->data, 0}</span> +<span id="L243" class="LineNr">243 </span> <span class="subxComment"># var slice: slice = {s->data, 0}</span> <span id="L244" class="LineNr">244 </span> <span class="subxComment"># out = result->data</span> <span id="L245" class="LineNr">245 </span> <span class="subxComment"># while true</span> <span id="L246" class="LineNr">246 </span> <span class="subxComment"># if (slice->start >= end) break</span> @@ -323,14 +323,14 @@ if ('onhashchange' in window) { <span id="L263" class="LineNr">263 </span> 57/push-edi <span id="L264" class="LineNr">264 </span> <span class="subxComment"># esi = s</span> <span id="L265" class="LineNr">265 </span> 8b/-> *(ebp+0xc) 6/r32/esi -<span id="L266" class="LineNr">266 </span> <span class="subxComment"># var curr/ecx : (addr byte) = s->data</span> +<span id="L266" class="LineNr">266 </span> <span class="subxComment"># var curr/ecx: (addr byte) = s->data</span> <span id="L267" class="LineNr">267 </span> 8d/copy-address *(esi+4) 1/r32/ecx -<span id="L268" class="LineNr">268 </span> <span class="subxComment"># var end/edx : (addr byte) = &s->data[s->length]</span> +<span id="L268" class="LineNr">268 </span> <span class="subxComment"># var end/edx: (addr byte) = &s->data[s->length]</span> <span id="L269" class="LineNr">269 </span> <span class="subxS1Comment"># . edx = s->length</span> <span id="L270" class="LineNr">270 </span> 8b/-> *esi 2/r32/edx <span id="L271" class="LineNr">271 </span> <span class="subxS1Comment"># . edx += curr</span> <span id="L272" class="LineNr">272 </span> 01/add %edx 1/r32/ecx -<span id="L273" class="LineNr">273 </span> <span class="subxComment"># var size/ebx : int = 0</span> +<span id="L273" class="LineNr">273 </span> <span class="subxComment"># var size/ebx: int = 0</span> <span id="L274" class="LineNr">274 </span> 31/xor %ebx 3/r32/ebx <span id="L275" class="LineNr">275 </span><span class="Constant">$parse-array-of-ints:loop1</span>: <span id="L276" class="LineNr">276 </span> <span class="subxComment"># if (curr >= end) break</span> @@ -367,7 +367,7 @@ if ('onhashchange' in window) { <span id="L307" class="LineNr">307 </span> 81 0/subop/add %ebx 4/imm32 <span id="L308" class="LineNr">308 </span> eb/jump $parse-array-of-ints:loop1/disp8 <span id="L309" class="LineNr">309 </span><span class="Constant">$parse-array-of-ints:break1</span>: -<span id="L310" class="LineNr">310 </span> <span class="subxComment"># var result/edi : (handle array int) = allocate(ad, size+4)</span> +<span id="L310" class="LineNr">310 </span> <span class="subxComment"># var result/edi: (handle array int) = allocate(ad, size+4)</span> <span id="L311" class="LineNr">311 </span> <span class="subxS1Comment"># . eax = allocate(ad, size+4)</span> <span id="L312" class="LineNr">312 </span> <span class="subxS2Comment"># . . push args</span> <span id="L313" class="LineNr">313 </span> 89/<- %eax 3/r32/ebx @@ -383,12 +383,12 @@ if ('onhashchange' in window) { <span id="L323" class="LineNr">323 </span> <span class="subxComment"># result->size = size</span> <span id="L324" class="LineNr">324 </span> 89/<- *eax 3/r32/ebx <span id="L325" class="LineNr">325 </span><span class="Constant">$parse-array-of-ints:pass2</span>: -<span id="L326" class="LineNr">326 </span> <span class="subxComment"># var slice/ecx : slice = {s->data, 0}</span> +<span id="L326" class="LineNr">326 </span> <span class="subxComment"># var slice/ecx: slice = {s->data, 0}</span> <span id="L327" class="LineNr">327 </span> 68/push 0/imm32/end <span id="L328" class="LineNr">328 </span> 8d/copy-address *(esi+4) 1/r32/ecx <span id="L329" class="LineNr">329 </span> 51/push-ecx <span id="L330" class="LineNr">330 </span> 89/<- %ecx 4/r32/esp -<span id="L331" class="LineNr">331 </span> <span class="subxComment"># var out/ebx : (addr byte) = result->data</span> +<span id="L331" class="LineNr">331 </span> <span class="subxComment"># var out/ebx: (addr byte) = result->data</span> <span id="L332" class="LineNr">332 </span> 8d/copy-address *(eax+4) 3/r32/ebx <span id="L333" class="LineNr">333 </span><span class="Constant">$parse-array-of-ints:loop2</span>: <span id="L334" class="LineNr">334 </span> <span class="subxComment"># if (slice->start >= end) break</span> @@ -458,7 +458,7 @@ if ('onhashchange' in window) { <span id="L398" class="LineNr">398 </span> <span class="subxS1Comment"># . prologue</span> <span id="L399" class="LineNr">399 </span> 55/push-ebp <span id="L400" class="LineNr">400 </span> 89/<- %ebp 4/r32/esp -<span id="L401" class="LineNr">401 </span> <span class="subxComment"># var ecx : (array int) = [1, 2, 3]</span> +<span id="L401" class="LineNr">401 </span> <span class="subxComment"># var ecx: (array int) = [1, 2, 3]</span> <span id="L402" class="LineNr">402 </span> 68/push 3/imm32 <span id="L403" class="LineNr">403 </span> 68/push 2/imm32 <span id="L404" class="LineNr">404 </span> 68/push 1/imm32 @@ -552,7 +552,7 @@ if ('onhashchange' in window) { <span id="L492" class="LineNr">492 </span> <span class="subxS1Comment"># . prologue</span> <span id="L493" class="LineNr">493 </span> 55/push-ebp <span id="L494" class="LineNr">494 </span> 89/<- %ebp 4/r32/esp -<span id="L495" class="LineNr">495 </span> <span class="subxComment"># var ecx : (array int) = [1, 2, 3]</span> +<span id="L495" class="LineNr">495 </span> <span class="subxComment"># var ecx: (array int) = [1, 2, 3]</span> <span id="L496" class="LineNr">496 </span> 68/push 3/imm32 <span id="L497" class="LineNr">497 </span> 68/push 2/imm32 <span id="L498" class="LineNr">498 </span> 68/push 1/imm32 @@ -590,13 +590,13 @@ if ('onhashchange' in window) { <span id="L530" class="LineNr">530 </span> <span id="L531" class="LineNr">531 </span><span class="subxComment"># helper for later tests</span> <span id="L532" class="LineNr">532 </span><span class="subxComment"># compare an array with a string representation of an array literal</span> -<span id="L533" class="LineNr">533 </span><span class="subxFunction">check-array-equal</span>: <span class="subxComment"># a : (addr array int), expected : (addr string), msg : (addr string)</span> +<span id="L533" class="LineNr">533 </span><span class="subxFunction">check-array-equal</span>: <span class="subxComment"># a: (addr array int), expected: (addr string), msg: (addr string)</span> <span id="L534" class="LineNr">534 </span> <span class="subxS1Comment"># . prologue</span> <span id="L535" class="LineNr">535 </span> 55/push-ebp <span id="L536" class="LineNr">536 </span> 89/<- %ebp 4/r32/esp <span id="L537" class="LineNr">537 </span> <span class="subxS1Comment"># . save registers</span> <span id="L538" class="LineNr">538 </span> 50/push-eax -<span id="L539" class="LineNr">539 </span> <span class="subxComment"># var b/ecx : (handle array int) = parse-array-of-ints(Heap, expected)</span> +<span id="L539" class="LineNr">539 </span> <span class="subxComment"># var b/ecx: (handle array int) = parse-array-of-ints(Heap, expected)</span> <span id="L540" class="LineNr">540 </span> <span class="subxS1Comment"># . eax = parse-array-of-ints(Heap, expected)</span> <span id="L541" class="LineNr">541 </span> <span class="subxS2Comment"># . . push args</span> <span id="L542" class="LineNr">542 </span> ff 6/subop/push *(ebp+0xc) @@ -636,7 +636,7 @@ if ('onhashchange' in window) { <span id="L576" class="LineNr">576 </span> <span class="subxS1Comment"># . prologue</span> <span id="L577" class="LineNr">577 </span> 55/push-ebp <span id="L578" class="LineNr">578 </span> 89/<- %ebp 4/r32/esp -<span id="L579" class="LineNr">579 </span> <span class="subxComment"># var ecx : (array int) = [1, 2, 3]</span> +<span id="L579" class="LineNr">579 </span> <span class="subxComment"># var ecx: (array int) = [1, 2, 3]</span> <span id="L580" class="LineNr">580 </span> 68/push 3/imm32 <span id="L581" class="LineNr">581 </span> 68/push 2/imm32 <span id="L582" class="LineNr">582 </span> 68/push 1/imm32 |