From ec32c11d3bde6772ddd250d3b217e0541409e0ce Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 24 Jun 2021 21:44:18 -0700 Subject: . Switch html rendering to a white background. --- html/linux/advent2020/5a.mu.html | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'html/linux/advent2020/5a.mu.html') diff --git a/html/linux/advent2020/5a.mu.html b/html/linux/advent2020/5a.mu.html index ddc8532d..16df9866 100644 --- a/html/linux/advent2020/5a.mu.html +++ b/html/linux/advent2020/5a.mu.html @@ -7,20 +7,25 @@ - + @@ -67,21 +72,21 @@ if ('onhashchange' in window) { 8 # 9 # You'll need to register to download the 'input' file for yourself. 10 -11 fn main -> _/ebx: int { +11 fn main -> _/ebx: int { 12 var line-storage: (stream byte 0x10) # 16 bytes is enough -13 var line/edx: (addr stream byte) <- address line-storage -14 var max-seat-id/edi: int <- copy 0 +13 var line/edx: (addr stream byte) <- address line-storage +14 var max-seat-id/edi: int <- copy 0 15 { 16 # read line from stdin 17 clear-stream line 18 read-line-from-real-keyboard line 19 print-stream-to-real-screen line 20 # if line is empty (not even a newline), quit -21 var done?/eax: boolean <- stream-empty? line +21 var done?/eax: boolean <- stream-empty? line 22 compare done?, 0/false 23 break-if-!= 24 # process line -25 var seat-id/eax: int <- convert-from-binary line +25 var seat-id/eax: int <- convert-from-binary line 26 compare seat-id, max-seat-id 27 { 28 break-if-<= @@ -94,20 +99,20 @@ if ('onhashchange' in window) { 35 return 0 36 } 37 -38 fn convert-from-binary in: (addr stream byte) -> _/eax: int { -39 var result/edi: int <- copy 0 -40 var i/ecx: int <- copy 9 # loop counter and also exponent +38 fn convert-from-binary in: (addr stream byte) -> _/eax: int { +39 var result/edi: int <- copy 0 +40 var i/ecx: int <- copy 9 # loop counter and also exponent 41 { 42 compare i, 0 43 break-if-< -44 var c/eax: byte <- read-byte in +44 var c/eax: byte <- read-byte in 45 #? print-string 0, "char: " 46 #? { 47 #? var c2/eax: int <- copy c 48 #? print-int32-hex 0, c2 49 #? } 50 #? print-string 0, "\n" -51 var bit/edx: int <- copy 0 +51 var bit/edx: int <- copy 0 52 { 53 compare c, 0x42/B 54 break-if-!= @@ -121,7 +126,7 @@ if ('onhashchange' in window) { 62 #? print-string 0, "bit: " 63 #? print-int32-decimal 0, bit 64 #? print-string 0, "\n" -65 var bit-value/eax: int <- repeated-shift-left bit, i +65 var bit-value/eax: int <- repeated-shift-left bit, i 66 #? print-string 0, "bit value: " 67 #? print-int32-decimal 0, bit-value 68 #? print-string 0, "\n" -- cgit 1.4.1-2-gfad0