From dd60a1d73c8017fd3d80ccf91e4549fc47a90760 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 16 Nov 2020 20:44:02 -0800 Subject: 7252 --- html/apps/tile/value-stack.mu.html | 80 +++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'html/apps/tile/value-stack.mu.html') diff --git a/html/apps/tile/value-stack.mu.html b/html/apps/tile/value-stack.mu.html index 532df190..e8c15026 100644 --- a/html/apps/tile/value-stack.mu.html +++ b/html/apps/tile/value-stack.mu.html @@ -60,13 +60,13 @@ if ('onhashchange' in window) { 1 # support for non-int values is untested 2 3 type value-stack { - 4 data: (handle array value) + 4 data: (handle array value) 5 top: int 6 } 7 8 fn initialize-value-stack _self: (addr value-stack), n: int { 9 var self/esi: (addr value-stack) <- copy _self - 10 var d/edi: (addr handle array value) <- get self, data + 10 var d/edi: (addr handle array value) <- get self, data 11 populate d, n 12 var top/eax: (addr int) <- get self, top 13 copy-to *top, 0 @@ -81,11 +81,11 @@ if ('onhashchange' in window) { 22 fn push-int-to-value-stack _self: (addr value-stack), _val: int { 23 var self/esi: (addr value-stack) <- copy _self 24 var top-addr/ecx: (addr int) <- get self, top - 25 var data-ah/edx: (addr handle array value) <- get self, data - 26 var data/eax: (addr array value) <- lookup *data-ah + 25 var data-ah/edx: (addr handle array value) <- get self, data + 26 var data/eax: (addr array value) <- lookup *data-ah 27 var top/edx: int <- copy *top-addr - 28 var dest-offset/edx: (offset value) <- compute-offset data, top - 29 var dest-addr/edx: (addr value) <- index data, dest-offset + 28 var dest-offset/edx: (offset value) <- compute-offset data, top + 29 var dest-addr/edx: (addr value) <- index data, dest-offset 30 var dest-addr2/eax: (addr int) <- get dest-addr, int-data 31 var val/esi: int <- copy _val 32 #? print-int32-hex-to-real-screen val @@ -98,11 +98,11 @@ if ('onhashchange' in window) { 39 fn push-string-to-value-stack _self: (addr value-stack), val: (handle array byte) { 40 var self/esi: (addr value-stack) <- copy _self 41 var top-addr/ecx: (addr int) <- get self, top - 42 var data-ah/edx: (addr handle array value) <- get self, data - 43 var data/eax: (addr array value) <- lookup *data-ah + 42 var data-ah/edx: (addr handle array value) <- get self, data + 43 var data/eax: (addr array value) <- lookup *data-ah 44 var top/edx: int <- copy *top-addr - 45 var dest-offset/edx: (offset value) <- compute-offset data, top - 46 var dest-addr/edx: (addr value) <- index data, dest-offset + 45 var dest-offset/edx: (offset value) <- compute-offset data, top + 46 var dest-addr/edx: (addr value) <- index data, dest-offset 47 var dest-addr2/eax: (addr handle array byte) <- get dest-addr, text-data 48 copy-handle val, dest-addr2 49 var dest-addr3/eax: (addr int) <- get dest-addr, type @@ -116,15 +116,15 @@ if ('onhashchange' in window) { 57 increment *top-addr 58 } 59 - 60 fn push-array-to-value-stack _self: (addr value-stack), val: (handle array value) { + 60 fn push-array-to-value-stack _self: (addr value-stack), val: (handle array value) { 61 var self/esi: (addr value-stack) <- copy _self 62 var top-addr/ecx: (addr int) <- get self, top - 63 var data-ah/edx: (addr handle array value) <- get self, data - 64 var data/eax: (addr array value) <- lookup *data-ah + 63 var data-ah/edx: (addr handle array value) <- get self, data + 64 var data/eax: (addr array value) <- lookup *data-ah 65 var top/edx: int <- copy *top-addr - 66 var dest-offset/edx: (offset value) <- compute-offset data, top - 67 var dest-addr/edx: (addr value) <- index data, dest-offset - 68 var dest-addr2/eax: (addr handle array value) <- get dest-addr, array-data + 66 var dest-offset/edx: (offset value) <- compute-offset data, top + 67 var dest-addr/edx: (addr value) <- index data, dest-offset + 68 var dest-addr2/eax: (addr handle array value) <- get dest-addr, array-data 69 copy-handle val, dest-addr2 70 # update type 71 var dest-addr3/eax: (addr int) <- get dest-addr, type @@ -132,14 +132,14 @@ if ('onhashchange' in window) { 73 increment *top-addr 74 } 75 - 76 fn push-value-stack _self: (addr value-stack), val: (addr value) { + 76 fn push-value-stack _self: (addr value-stack), val: (addr value) { 77 var self/esi: (addr value-stack) <- copy _self 78 var top-addr/ecx: (addr int) <- get self, top - 79 var data-ah/edx: (addr handle array value) <- get self, data - 80 var data/eax: (addr array value) <- lookup *data-ah + 79 var data-ah/edx: (addr handle array value) <- get self, data + 80 var data/eax: (addr array value) <- lookup *data-ah 81 var top/edx: int <- copy *top-addr - 82 var dest-offset/edx: (offset value) <- compute-offset data, top - 83 var dest-addr/edx: (addr value) <- index data, dest-offset + 82 var dest-offset/edx: (offset value) <- compute-offset data, top + 83 var dest-addr/edx: (addr value) <- index data, dest-offset 84 copy-object val, dest-addr 85 increment *top-addr 86 } @@ -153,11 +153,11 @@ if ('onhashchange' in window) { 94 return -1 95 } 96 decrement *top-addr - 97 var data-ah/edx: (addr handle array value) <- get self, data - 98 var data/eax: (addr array value) <- lookup *data-ah + 97 var data-ah/edx: (addr handle array value) <- get self, data + 98 var data/eax: (addr array value) <- lookup *data-ah 99 var top/edx: int <- copy *top-addr -100 var dest-offset/edx: (offset value) <- compute-offset data, top -101 var result-addr/eax: (addr value) <- index data, dest-offset +100 var dest-offset/edx: (offset value) <- compute-offset data, top +101 var result-addr/eax: (addr value) <- index data, dest-offset 102 var result-addr2/eax: (addr int) <- get result-addr, int-data 103 return *result-addr2 104 } @@ -181,37 +181,37 @@ if ('onhashchange' in window) { 122 123 fn value-stack-max-width _self: (addr value-stack) -> _/eax: int { 124 var self/esi: (addr value-stack) <- copy _self -125 var data-ah/edi: (addr handle array value) <- get self, data -126 var _data/eax: (addr array value) <- lookup *data-ah -127 var data/edi: (addr array value) <- copy _data +125 var data-ah/edi: (addr handle array value) <- get self, data +126 var _data/eax: (addr array value) <- lookup *data-ah +127 var data/edi: (addr array value) <- copy _data 128 var top-addr/ecx: (addr int) <- get self, top 129 var i/ebx: int <- copy 0 -130 var result: int +130 var result: int 131 { 132 compare i, *top-addr 133 break-if->= -134 var o/edx: (offset value) <- compute-offset data, i -135 var v/edx: (addr value) <- index data, o -136 var w/eax: int <- value-width v, 1 # top-level=true +134 var o/edx: (offset value) <- compute-offset data, i +135 var v/edx: (addr value) <- index data, o +136 var w/eax: int <- value-width v, 1 # top-level=true 137 # if (w > result) w = result 138 { -139 compare w, result +139 compare w, result 140 break-if-<= -141 copy-to result, w +141 copy-to result, w 142 } 143 i <- increment 144 loop 145 } -146 return result +146 return result 147 } 148 -149 fn save-lines in-h: (handle array (handle array byte)), _out-ah: (addr handle array value) { +149 fn save-lines in-h: (handle array (handle array byte)), _out-ah: (addr handle array value) { 150 var _in/eax: (addr array (handle array byte)) <- lookup in-h 151 var in/esi: (addr array (handle array byte)) <- copy _in 152 var len/ecx: int <- length in -153 var out-ah/edi: (addr handle array value) <- copy _out-ah +153 var out-ah/edi: (addr handle array value) <- copy _out-ah 154 populate out-ah, len -155 var out/eax: (addr array value) <- lookup *out-ah +155 var out/eax: (addr array value) <- lookup *out-ah 156 # copy in into out 157 var i/ebx: int <- copy 0 158 { @@ -220,8 +220,8 @@ if ('onhashchange' in window) { 161 #? print-int32-hex 0, i 162 #? print-string 0, "\n" 163 var src/ecx: (addr handle array byte) <- index in, i -164 var dest-offset/edx: (offset value) <- compute-offset out, i -165 var dest-val/edx: (addr value) <- index out, dest-offset +164 var dest-offset/edx: (offset value) <- compute-offset out, i +165 var dest-val/edx: (addr value) <- index out, dest-offset 166 var dest/eax: (addr handle array byte) <- get dest-val, text-data 167 copy-object src, dest 168 var type/edx: (addr int) <- get dest-val, type -- cgit 1.4.1-2-gfad0