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/2a.mu.html | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'html/linux/advent2020/2a.mu.html') diff --git a/html/linux/advent2020/2a.mu.html b/html/linux/advent2020/2a.mu.html index 825d7e12..e24a06ef 100644 --- a/html/linux/advent2020/2a.mu.html +++ b/html/linux/advent2020/2a.mu.html @@ -14,19 +14,18 @@ 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; } -.muRegEdx { color: #878700; } -.muRegEsi { color: #87d787; } -.muComment { color: #005faf; } -.LineNr { } -.muRegEax { color: #875f00; } -.muRegEcx { color: #af875f; } +.PreProc { color: #c000c0; } +.muRegEdx { color: #af5f00; } .Special { color: #ff6060; } -.muRegEdi { color: #87ffd7; } +.LineNr { } +.muRegEsi { color: #005faf; } +.muRegEbx { color: #5f00ff; } +.Constant { color: #008787; } +.muRegEdi { color: #00af00; } +.muRegEcx { color: #870000; } .Delimiter { color: #c000c0; } .muFunction { color: #af5f00; text-decoration: underline; } -.muRegEbx { color: #8787af; } -.Constant { color: #008787; } -.PreProc { color: #c000c0; } +.muComment { color: #005faf; } --> @@ -83,19 +82,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 # start = parse-int(slice) -29 var _start/eax: int <- parse-decimal-int-from-slice slice +29 var _start/eax: int <- parse-decimal-int-from-slice slice 30 var start/ebx: int <- copy _start -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 _end/eax: int <- parse-decimal-int-from-slice slice +34 var _end/eax: int <- parse-decimal-int-from-slice slice 35 var end/esi: int <- copy _end 36 print-int32-decimal 0, start 37 print-string 0, " " @@ -103,14 +102,14 @@ if ('onhashchange' in window) { 39 print-string 0, "\n" 40 # letter = next non-space 41 skip-chars-matching-whitespace line -42 var letter/eax: byte <- read-byte line +42 var letter/eax: byte <- read-byte line 43 # skip some stuff 44 { -45 var colon/eax: byte <- read-byte line # skip ':' +45 var colon/eax: byte <- read-byte line # skip ':' 46 } 47 skip-chars-matching-whitespace line 48 # now check the rest of the line -49 var valid?/eax: boolean <- valid? start, end, letter, line +49 var valid?/eax: boolean <- valid? start, end, letter, line 50 compare valid?, 0/false 51 { 52 break-if-= @@ -124,16 +123,16 @@ if ('onhashchange' in window) { 60 return 0 61 } 62 -63 fn valid? start: int, end: int, letter: byte, password: (addr stream byte) -> _/eax: boolean { +63 fn valid? start: int, end: int, letter: byte, password: (addr stream byte) -> _/eax: boolean { 64 var letter-count/edi: int <- copy 0 65 # for every c in password 66 # if (c == letter) 67 # ++letter-count 68 { -69 var done?/eax: boolean <- stream-empty? password +69 var done?/eax: boolean <- stream-empty? password 70 compare done?, 0/false 71 break-if-!= -72 var c/eax: byte <- read-byte password +72 var c/eax: byte <- read-byte password 73 compare c, letter 74 { 75 break-if-!= -- cgit 1.4.1-2-gfad0