From 52daf0722f7f4ad9d3f29e3cbbbaddde066f49f3 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 20 May 2019 01:44:06 -0700 Subject: 5211 Update syntax-highlighted renderings after a _long_ time. --- html/subx/071read-line.subx.html | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'html/subx/071read-line.subx.html') diff --git a/html/subx/071read-line.subx.html b/html/subx/071read-line.subx.html index 37050313..f2dd35b4 100644 --- a/html/subx/071read-line.subx.html +++ b/html/subx/071read-line.subx.html @@ -65,7 +65,7 @@ if ('onhashchange' in window) { 4 # . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes 5 6 #? Entry: # run a single test, while debugging - 7 #? e8/call test-read-line/disp32 + 7 #? e8/call test-read-line-buffered/disp32 8 #? # syscall(exit, Num-test-failures) 9 #? 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32 # copy *Num-test-failures to EBX 10 #? b8/copy-to-EAX 1/imm32/exit @@ -74,7 +74,7 @@ if ('onhashchange' in window) { 13 # read bytes from 'f' until (and including) a newline and store them into 's' 14 # 's' fails to grow if and only if no data found 15 # just abort if 's' is too small - 16 read-line: # f : (address buffered-file), s : (address stream byte) -> <void> + 16 read-line-buffered: # f : (address buffered-file), s : (address stream byte) -> <void> 17 # pseudocode: 18 # while true 19 # if (s->write >= s->length) abort @@ -102,13 +102,13 @@ if ('onhashchange' in window) { 41 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 . # copy *(EBP+12) to EDI 42 # EDX = s->write 43 8b/copy 0/mod/indirect 7/rm32/EDI . . . 2/r32/EDX . . # copy *EDI to EDX - 44 $read-line:loop: + 44 $read-line-buffered:loop: 45 # if (s->write >= s->length) abort 46 3b/compare 1/mod/*+disp8 7/rm32/EDI . . . 2/r32/EDX 8/disp8 . # compare EDX with *(EDI+8) - 47 7d/jump-if-greater-or-equal $read-line:abort/disp8 + 47 7d/jump-if-greater-or-equal $read-line-buffered:abort/disp8 48 # if (f->read >= f->write) populate stream from file 49 3b/compare 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 . # compare ECX with *(ESI+4) - 50 7c/jump-if-lesser $read-line:from-stream/disp8 + 50 7c/jump-if-lesser $read-line-buffered:from-stream/disp8 51 # . clear-stream(stream = f+4) 52 # . . push args 53 8d/copy-address 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 . # copy ESI+4 to EAX @@ -131,8 +131,8 @@ if ('onhashchange' in window) { 70 # since f->read was initially 0, EAX is the same as f->write 71 # . if (EAX == 0) return true 72 3d/compare-EAX-and 0/imm32 - 73 74/jump-if-equal $read-line:end/disp8 - 74 $read-line:from-stream: + 73 74/jump-if-equal $read-line-buffered:end/disp8 + 74 $read-line-buffered:from-stream: 75 # AL = f->data[f->read] 76 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX 77 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0x10/disp8 . # copy byte at *(ESI+ECX+16) to AL @@ -144,8 +144,8 @@ if ('onhashchange' in window) { 83 42/increment-EDX 84 # if (AL == '\n') return 85 3d/compare-EAX-and 0xa/imm32 - 86 75/jump-if-not-equal $read-line:loop/disp8 - 87 $read-line:end: + 86 75/jump-if-not-equal $read-line-buffered:loop/disp8 + 87 $read-line-buffered:end: 88 # save f->read 89 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 8/disp8 . # copy ECX to *(ESI+8) 90 # save s->write @@ -161,10 +161,10 @@ if ('onhashchange' in window) { 100 5d/pop-to-EBP 101 c3/return 102 -103 $read-line:abort: +103 $read-line-buffered:abort: 104 # . _write(2/stderr, error) 105 # . . push args -106 68/push "read-line: line too long\n"/imm32 +106 68/push "read-line-buffered: line too long\n"/imm32 107 68/push 2/imm32/stderr 108 # . . call 109 e8/call _write/disp32 @@ -176,8 +176,8 @@ if ('onhashchange' in window) { 115 cd/syscall 0x80/imm8 116 # never gets here 117 -118 test-read-line: -119 # - check that read-line stops at a newline +118 test-read-line-buffered: +119 # - check that read-line-buffered stops at a newline 120 # setup 121 # . clear-stream(_test-stream) 122 # . . push args @@ -211,27 +211,27 @@ if ('onhashchange' in window) { 150 # . . discard args 151 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 152 # read a line from _test-stream (buffered by _test-buffered-file) into _test-tmp-stream -153 # . EAX = read-line(_test-buffered-file, _test-tmp-stream) +153 # . EAX = read-line-buffered(_test-buffered-file, _test-tmp-stream) 154 # . . push args 155 68/push _test-tmp-stream/imm32 156 68/push _test-buffered-file/imm32 157 # . . call -158 e8/call read-line/disp32 +158 e8/call read-line-buffered/disp32 159 # . . discard args 160 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 161 # check-next-stream-line-equal(_test-tmp-stream, "ab", msg) 162 # . . push args -163 68/push "F - test-read-line"/imm32 +163 68/push "F - test-read-line-buffered"/imm32 164 68/push "ab"/imm32 165 68/push _test-tmp-stream/imm32 166 # . . call -167 e8/call check-next-stream-line-equal/disp32 +167 e8/call check-next-stream-line-equal/disp32 168 # . . discard args 169 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 170 # end 171 c3/return 172 -173 test-read-line-reads-final-line-until-Eof: +173 test-read-line-buffered-reads-final-line-until-Eof: 174 # setup 175 # . clear-stream(_test-stream) 176 # . . push args @@ -265,21 +265,21 @@ if ('onhashchange' in window) { 204 # . . discard args 205 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 206 # read a line from _test-stream (buffered by _test-buffered-file) into _test-tmp-stream -207 # . EAX = read-line(_test-buffered-file, _test-tmp-stream) +207 # . EAX = read-line-buffered(_test-buffered-file, _test-tmp-stream) 208 # . . push args 209 68/push _test-tmp-stream/imm32 210 68/push _test-buffered-file/imm32 211 # . . call -212 e8/call read-line/disp32 +212 e8/call read-line-buffered/disp32 213 # . . discard args 214 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 215 # check-stream-equal(_test-tmp-stream, "cd", msg) 216 # . . push args -217 68/push "F - test-read-line-reads-final-line-until-Eof"/imm32 +217 68/push "F - test-read-line-buffered-reads-final-line-until-Eof"/imm32 218 68/push "cd"/imm32 219 68/push _test-tmp-stream/imm32 220 # . . call -221 e8/call check-stream-equal/disp32 +221 e8/call check-stream-equal/disp32 222 # . . discard args 223 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 224 # end -- cgit 1.4.1-2-gfad0