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/061read-byte.subx.html | 62 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'html/subx/061read-byte.subx.html') diff --git a/html/subx/061read-byte.subx.html b/html/subx/061read-byte.subx.html index fa9a841d..c12ec991 100644 --- a/html/subx/061read-byte.subx.html +++ b/html/subx/061read-byte.subx.html @@ -61,7 +61,7 @@ if ('onhashchange' in window) { https://github.com/akkartik/mu/blob/master/subx/061read-byte.subx
-  1 # read-byte: one higher-level abstraction atop 'read'.
+  1 # read-byte-buffered: one higher-level abstraction atop 'read'.
   2 #
   3 # There are many situations where 'read' is a lot to manage, and we need
   4 # to abstract some details away. One of them is when we want to read a file
@@ -95,8 +95,8 @@ if ('onhashchange' in window) {
  32 # . 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
  33 
  34 #? Entry:  # run a single test, while debugging
- 35 #?     e8/call test-read-byte-multiple/disp32
- 36 #?     e8/call test-read-byte-refills-buffer/disp32
+ 35 #?     e8/call test-read-byte-buffered-multiple/disp32
+ 36 #?     e8/call test-read-byte-buffered-refills-buffer/disp32
  37 #?     # syscall(exit, Num-test-failures)
  38 #?     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           3/r32/EBX   Num-test-failures/disp32          # copy *Num-test-failures to EBX
  39 #?     b8/copy-to-EAX  1/imm32/exit
@@ -104,7 +104,7 @@ if ('onhashchange' in window) {
  41 
  42 # return next byte value in EAX, with top 3 bytes cleared.
  43 # On reaching end of file, return 0xffffffff (Eof).
- 44 read-byte:  # f : (address buffered-file) -> byte-or-Eof/EAX
+ 44 read-byte-buffered:  # f : (address buffered-file) -> byte-or-Eof/EAX
  45     # . prolog
  46     55/push-EBP
  47     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
@@ -117,7 +117,7 @@ if ('onhashchange' in window) {
  54     8b/copy                         1/mod/*+disp8   6/rm32/ESI    .           .             .           1/r32/ECX   8/disp8         .                 # copy *(ESI+8) to ECX
  55     # if (f->read >= f->write) populate stream from file
  56     3b/compare                      1/mod/*+disp8   6/rm32/ESI    .           .             .           1/r32/ECX   4/disp8         .                 # compare ECX with *(ESI+4)
- 57     7c/jump-if-lesser  $read-byte:from-stream/disp8
+ 57     7c/jump-if-lesser  $read-byte-buffered:from-stream/disp8
  58     # . clear-stream(stream = f+4)
  59     # . . push args
  60     8d/copy-address                 1/mod/*+disp8   6/rm32/ESI    .           .             .           0/r32/EAX   4/disp8         .                 # copy ESI+4 to EAX
@@ -138,17 +138,17 @@ if ('onhashchange' in window) {
  75     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
  76     # if (EAX == 0) return 0xffffffff
  77     3d/compare-EAX-and  0/imm32
- 78     75/jump-if-not-equal  $read-byte:from-stream/disp8
+ 78     75/jump-if-not-equal  $read-byte-buffered:from-stream/disp8
  79     b8/copy-to-EAX  0xffffffff/imm32/Eof
- 80     eb/jump  $read-byte:end/disp8
- 81 $read-byte:from-stream:
+ 80     eb/jump  $read-byte-buffered:end/disp8
+ 81 $read-byte-buffered:from-stream:
  82     # read byte from stream
  83     # AL = f->data[f->read]
  84     31/xor                          3/mod/direct    0/rm32/EAX    .           .             .           0/r32/EAX   .               .                 # clear EAX
  85     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
  86     # ++f->read
  87     ff          0/subop/increment   1/mod/*+disp8   6/rm32/ESI    .           .             .           .           8/disp8         .                 # increment *(ESI+8)
- 88 $read-byte:end:
+ 88 $read-byte-buffered:end:
  89     # . restore registers
  90     5e/pop-to-ESI
  91     59/pop-to-ECX
@@ -159,8 +159,8 @@ if ('onhashchange' in window) {
  96 
  97 # - tests
  98 
- 99 test-read-byte-single:
-100     # - check that read-byte returns first byte of 'file'
+ 99 test-read-byte-buffered-single:
+100     # - check that read-byte-buffered returns first byte of 'file'
 101     # setup
 102     # . clear-stream(_test-stream)
 103     # . . push args
@@ -186,16 +186,16 @@ if ('onhashchange' in window) {
 123     e8/call  write/disp32
 124     # . . discard args
 125     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-126     # read-byte(_test-buffered-file)
+126     # read-byte-buffered(_test-buffered-file)
 127     # . . push args
 128     68/push  _test-buffered-file/imm32
 129     # . . call
-130     e8/call  read-byte/disp32
+130     e8/call  read-byte-buffered/disp32
 131     # . . discard args
 132     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
 133     # check-ints-equal(EAX, 'A', msg)
 134     # . . push args
-135     68/push  "F - test-read-byte-single"/imm32
+135     68/push  "F - test-read-byte-buffered-single"/imm32
 136     68/push  0x41/imm32
 137     50/push-EAX
 138     # . . call
@@ -205,8 +205,8 @@ if ('onhashchange' in window) {
 142     # . end
 143     c3/return
 144 
-145 test-read-byte-multiple:
-146     # - call read-byte twice, check that second call returns second byte
+145 test-read-byte-buffered-multiple:
+146     # - call read-byte-buffered twice, check that second call returns second byte
 147     # setup
 148     # . clear-stream(_test-stream)
 149     # . . push args
@@ -232,23 +232,23 @@ if ('onhashchange' in window) {
 169     e8/call  write/disp32
 170     # . . discard args
 171     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-172     # read-byte(_test-buffered-file)
+172     # read-byte-buffered(_test-buffered-file)
 173     # . . push args
 174     68/push  _test-buffered-file/imm32
 175     # . . call
-176     e8/call  read-byte/disp32
+176     e8/call  read-byte-buffered/disp32
 177     # . . discard args
 178     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
-179     # read-byte(_test-buffered-file)
+179     # read-byte-buffered(_test-buffered-file)
 180     # . . push args
 181     68/push  _test-buffered-file/imm32
 182     # . . call
-183     e8/call  read-byte/disp32
+183     e8/call  read-byte-buffered/disp32
 184     # . . discard args
 185     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
 186     # check-ints-equal(EAX, 'b', msg)
 187     # . . push args
-188     68/push  "F - test-read-byte-multiple"/imm32
+188     68/push  "F - test-read-byte-buffered-multiple"/imm32
 189     68/push  0x62/imm32
 190     50/push-EAX
 191     # . . call
@@ -258,8 +258,8 @@ if ('onhashchange' in window) {
 195     # . end
 196     c3/return
 197 
-198 test-read-byte-end-of-file:
-199     # - call read-byte on an empty 'file', check that it returns Eof
+198 test-read-byte-buffered-end-of-file:
+199     # - call read-byte-buffered on an empty 'file', check that it returns Eof
 200     # setup
 201     # . clear-stream(_test-stream)
 202     # . . push args
@@ -277,16 +277,16 @@ if ('onhashchange' in window) {
 214     e8/call  clear-stream/disp32
 215     # . . discard args
 216     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
-217     # read-byte(_test-buffered-file)
+217     # read-byte-buffered(_test-buffered-file)
 218     # . . push args
 219     68/push  _test-buffered-file/imm32
 220     # . . call
-221     e8/call  read-byte/disp32
+221     e8/call  read-byte-buffered/disp32
 222     # . . discard args
 223     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
 224     # check-ints-equal(EAX, 0xffffffff, msg)
 225     # . . push args
-226     68/push  "F - test-read-byte-end-of-file"/imm32
+226     68/push  "F - test-read-byte-buffered-end-of-file"/imm32
 227     68/push  0xffffffff/imm32/Eof
 228     50/push-EAX
 229     # . . call
@@ -296,8 +296,8 @@ if ('onhashchange' in window) {
 233     # . end
 234     c3/return
 235 
-236 test-read-byte-refills-buffer:
-237     # - consume buffered-file's buffer, check that next read-byte still works
+236 test-read-byte-buffered-refills-buffer:
+237     # - consume buffered-file's buffer, check that next read-byte-buffered still works
 238     # setup
 239     # . clear-stream(_test-stream)
 240     # . . push args
@@ -327,16 +327,16 @@ if ('onhashchange' in window) {
 264     # . _test-buffered-file->read = 6  # >= _test-buffered-file->length
 265     b8/copy-to-EAX  _test-buffered-file/imm32
 266     c7          0/subop/copy        1/mod/*+disp8   0/rm32/EAX    .           .             .           .           8/disp8         6/imm32           # copy to *(EAX+8)
-267     # read-byte(_test-buffered-file)
+267     # read-byte-buffered(_test-buffered-file)
 268     # . . push args
 269     68/push  _test-buffered-file/imm32
 270     # . . call
-271     e8/call  read-byte/disp32
+271     e8/call  read-byte-buffered/disp32
 272     # . . discard args
 273     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
 274     # check-ints-equal(EAX, 'A', msg)
 275     # . . push args
-276     68/push  "F - test-read-byte-refills-buffer"/imm32
+276     68/push  "F - test-read-byte-buffered-refills-buffer"/imm32
 277     68/push  0x41/imm32
 278     50/push-EAX
 279     # . . call
-- 
cgit 1.4.1-2-gfad0