From 372367f59a897162912d0646158bdea1e07d6e66 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 26 Jun 2021 20:55:36 -0700 Subject: html: better highlighting for int registers --- html/linux/arith.mu.html | 63 ++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 32 deletions(-) (limited to 'html/linux/arith.mu.html') diff --git a/html/linux/arith.mu.html b/html/linux/arith.mu.html index 72fdf847..7cd2e5c9 100644 --- a/html/linux/arith.mu.html +++ b/html/linux/arith.mu.html @@ -14,20 +14,19 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background- 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 { } -.Delimiter { color: #c000c0; } -.CommentedCode { color: #8a8a8a; } -.muRegEsi { color: #87d787; } -.muRegEdi { color: #87ffd7; } .Constant { color: #008787; } -.Special { color: #ff6060; } -.PreProc { color: #c000c0; } +.muRegEbx { color: #5f00ff; } +.muRegEsi { color: #005faf; } +.muRegEdi { color: #00af00; } +.muRegEcx { color: #870000; } +.Delimiter { color: #c000c0; } .muFunction { color: #af5f00; text-decoration: underline; } +.CommentedCode { color: #8a8a8a; } .muComment { color: #005faf; } -.muRegEax { color: #875f00; } -.muRegEcx { color: #af875f; } -.muRegEdx { color: #878700; } -.muRegEbx { color: #8787af; } --> @@ -99,7 +98,7 @@ if ('onhashchange' in window) { 34 fn main -> _/ebx: int { 35 enable-keyboard-immediate-mode 36 var look/esi: grapheme <- copy 0 # lookahead - 37 var n/eax: int <- copy 0 # result of each expression + 37 var n/eax: int <- copy 0 # result of each expression 38 print-string 0/screen, "press ctrl-c or ctrl-d to exit\n" 39 # read-eval-print loop 40 { @@ -120,25 +119,25 @@ if ('onhashchange' in window) { 55 return 0 56 } 57 - 58 fn simplify -> _/eax: int, _/esi: grapheme { + 58 fn simplify -> _/eax: int, _/esi: grapheme { 59 # prime the pump 60 var look/esi: grapheme <- get-char 61 # do it - 62 var result/eax: int <- copy 0 + 62 var result/eax: int <- copy 0 63 result, look <- expression look 64 return result, look 65 } 66 - 67 fn expression _look: grapheme -> _/eax: int, _/esi: grapheme { + 67 fn expression _look: grapheme -> _/eax: int, _/esi: grapheme { 68 var look/esi: grapheme <- copy _look 69 # read arg - 70 var result/eax: int <- copy 0 + 70 var result/eax: int <- copy 0 71 result, look <- term look 72 $expression:loop: { 73 # while next non-space char in ['+', '-'] 74 look <- skip-spaces look 75 { - 76 var continue?/eax: boolean <- add-or-sub? look + 76 var continue?/eax: boolean <- add-or-sub? look 77 compare continue?, 0/false 78 break-if-= $expression:loop 79 } @@ -149,7 +148,7 @@ if ('onhashchange' in window) { 84 var second/edx: int <- copy 0 85 look <- skip-spaces look 86 { - 87 var tmp/eax: int <- copy 0 + 87 var tmp/eax: int <- copy 0 88 tmp, look <- term look 89 second <- copy tmp 90 } @@ -174,17 +173,17 @@ if ('onhashchange' in window) { 109 return result, look 110 } 111 -112 fn term _look: grapheme -> _/eax: int, _/esi: grapheme { +112 fn term _look: grapheme -> _/eax: int, _/esi: grapheme { 113 var look/esi: grapheme <- copy _look 114 # read arg 115 look <- skip-spaces look -116 var result/eax: int <- copy 0 +116 var result/eax: int <- copy 0 117 result, look <- factor look 118 $term:loop: { 119 # while next non-space char in ['*', '/'] 120 look <- skip-spaces look 121 { -122 var continue?/eax: boolean <- mul-or-div? look +122 var continue?/eax: boolean <- mul-or-div? look 123 compare continue?, 0/false 124 break-if-= $term:loop 125 } @@ -195,7 +194,7 @@ if ('onhashchange' in window) { 130 var second/edx: int <- copy 0 131 look <- skip-spaces look 132 { -133 var tmp/eax: int <- copy 0 +133 var tmp/eax: int <- copy 0 134 tmp, look <- factor look 135 second <- copy tmp 136 } @@ -219,27 +218,27 @@ if ('onhashchange' in window) { 154 return result, look 155 } 156 -157 fn factor _look: grapheme -> _/eax: int, _/esi: grapheme { +157 fn factor _look: grapheme -> _/eax: int, _/esi: grapheme { 158 var look/esi: grapheme <- copy _look # should be a no-op 159 look <- skip-spaces look 160 # if next char is not '(', parse a number 161 compare look, 0x28/open-paren 162 { 163 break-if-= -164 var result/eax: int <- copy 0 +164 var result/eax: int <- copy 0 165 result, look <- num look 166 return result, look 167 } 168 # otherwise recurse 169 look <- get-char # '(' -170 var result/eax: int <- copy 0 +170 var result/eax: int <- copy 0 171 result, look <- expression look 172 look <- skip-spaces look 173 look <- get-char # ')' 174 return result, look 175 } 176 -177 fn mul-or-div? c: grapheme -> _/eax: boolean { +177 fn mul-or-div? c: grapheme -> _/eax: boolean { 178 compare c, 0x2a/* 179 { 180 break-if-!= @@ -253,7 +252,7 @@ if ('onhashchange' in window) { 188 return 0/false 189 } 190 -191 fn add-or-sub? c: grapheme -> _/eax: boolean { +191 fn add-or-sub? c: grapheme -> _/eax: boolean { 192 compare c, 0x2b/+ 193 { 194 break-if-!= @@ -273,26 +272,26 @@ if ('onhashchange' in window) { 208 return op, look 209 } 210 -211 fn num _look: grapheme -> _/eax: int, _/esi: grapheme { +211 fn num _look: grapheme -> _/eax: int, _/esi: grapheme { 212 var look/esi: grapheme <- copy _look 213 var result/edi: int <- copy 0 214 { -215 var first-digit/eax: int <- to-decimal-digit look +215 var first-digit/eax: int <- to-decimal-digit look 216 result <- copy first-digit 217 } 218 { 219 look <- get-char 220 # done? -221 var digit?/eax: boolean <- decimal-digit? look +221 var digit?/eax: boolean <- decimal-digit? look 222 compare digit?, 0/false 223 break-if-= 224 # result *= 10 225 { -226 var ten/eax: int <- copy 0xa +226 var ten/eax: int <- copy 0xa 227 result <- multiply ten 228 } 229 # result += digit(look) -230 var digit/eax: int <- to-decimal-digit look +230 var digit/eax: int <- to-decimal-digit look 231 result <- add digit 232 loop 233 } @@ -311,7 +310,7 @@ if ('onhashchange' in window) { 246 } 247 248 fn get-char -> _/esi: grapheme { -249 var look/eax: grapheme <- read-key-from-real-keyboard +249 var look/eax: grapheme <- read-key-from-real-keyboard 250 print-grapheme-to-real-screen look 251 compare look, 4 252 { -- cgit 1.4.1-2-gfad0