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/advent2020/2b.mu.html | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'html/linux/advent2020/2b.mu.html') diff --git a/html/linux/advent2020/2b.mu.html b/html/linux/advent2020/2b.mu.html index 67198402..ff0a806f 100644 --- a/html/linux/advent2020/2b.mu.html +++ b/html/linux/advent2020/2b.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; } +.muRegEsi { color: #005faf; } +.muRegEbx { color: #5f00ff; } .Constant { color: #008787; } -.Special { color: #ff6060; } -.PreProc { color: #c000c0; } +.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; } --> @@ -84,19 +83,19 @@ if ('onhashchange' in window) { 19 clear-stream line 20 read-line-from-real-keyboard line 21 # if line is empty (not even a newline), quit - 22 var done?/eax: boolean <- stream-empty? line + 22 var done?/eax: boolean <- stream-empty? line 23 compare done?, 0/false 24 break-if-!= 25 print-stream-to-real-screen line 26 # slice = next-token(line, '-') 27 next-token line, 0x2d, slice 28 # pos1 = parse-int(slice) - 29 var _pos1/eax: int <- parse-decimal-int-from-slice slice + 29 var _pos1/eax: int <- parse-decimal-int-from-slice slice 30 var pos1/ebx: int <- copy _pos1 - 31 var dash/eax: byte <- read-byte line # skip '-' + 31 var dash/eax: byte <- read-byte line # skip '-' 32 # slice = next-token(line, ' ') 33 next-token line, 0x20, slice - 34 var _pos2/eax: int <- parse-decimal-int-from-slice slice + 34 var _pos2/eax: int <- parse-decimal-int-from-slice slice 35 var pos2/esi: int <- copy _pos2 36 print-int32-decimal 0, pos1 37 print-string 0, " " @@ -110,14 +109,14 @@ if ('onhashchange' in window) { 45 } 46 # letter = next non-space 47 skip-chars-matching-whitespace line - 48 var letter/eax: byte <- read-byte line + 48 var letter/eax: byte <- read-byte line 49 # skip some stuff 50 { - 51 var colon/eax: byte <- read-byte line # skip ':' + 51 var colon/eax: byte <- read-byte line # skip ':' 52 } 53 skip-chars-matching-whitespace line 54 # now check the rest of the line - 55 var valid?/eax: boolean <- valid? pos1, pos2, letter, line + 55 var valid?/eax: boolean <- valid? pos1, pos2, letter, line 56 compare valid?, 0/false 57 { 58 break-if-= @@ -134,7 +133,7 @@ if ('onhashchange' in window) { 69 # ideally password would be a random-access array 70 # we'll just track an index 71 # one benefit: we can easily start at 1 - 72 fn valid? pos1: int, pos2: int, letter: byte, password: (addr stream byte) -> _/eax: boolean { + 72 fn valid? pos1: int, pos2: int, letter: byte, password: (addr stream byte) -> _/eax: boolean { 73 var i/esi: int <- copy 1 74 var letter-count/edi: int <- copy 0 75 # while password stream isn't empty @@ -149,10 +148,10 @@ if ('onhashchange' in window) { 84 #? print-string 0, " " 85 #? print-int32-decimal 0, i 86 #? print-string 0, "\n" - 87 var done?/eax: boolean <- stream-empty? password + 87 var done?/eax: boolean <- stream-empty? password 88 compare done?, 0/false 89 break-if-!= - 90 var c/eax: byte <- read-byte password + 90 var c/eax: byte <- read-byte password 91 #? { 92 #? var c2/eax: int <- copy c 93 #? print-int32-decimal 0, c2 -- cgit 1.4.1-2-gfad0