From ac07e589b3e912c704c2011d543f18b16712ff15 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 29 Dec 2018 15:27:18 -0800 Subject: 4890 - new html renderings a) Switch to a light background. b) Linkify calls in .subx files. c) Keep all colorization in the Vim colorscheme, get rid of hacky special-cases in update_html. --- html/subx/060write-stream.subx.html | 180 ++++++++++++++++++------------------ 1 file changed, 88 insertions(+), 92 deletions(-) (limited to 'html/subx/060write-stream.subx.html') diff --git a/html/subx/060write-stream.subx.html b/html/subx/060write-stream.subx.html index d8fd2059..1a3da3d8 100644 --- a/html/subx/060write-stream.subx.html +++ b/html/subx/060write-stream.subx.html @@ -7,26 +7,22 @@ - + @@ -80,24 +76,24 @@ if ('onhashchange' in window) { 15 #? e8/call test-write-stream-appends/disp32 16 e8/call run-tests/disp32 # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'. 17 # syscall(exit, Num-test-failures) - 18 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32 # copy *Num-test-failures to EBX - 19 b8/copy-to-EAX 1/imm32 + 18 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32 # copy *Num-test-failures to EBX + 19 b8/copy-to-EAX 1/imm32/exit 20 cd/syscall 0x80/imm8 21 - 22 write-stream: # f : fd or (address stream), s : (address stream) -> <void> + 22 write-stream: # f : fd or (address stream), s : (address stream) -> <void> 23 # . prolog 24 55/push-EBP - 25 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP + 25 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP 26 # if (f < 0x08000000) _write-stream(f, s), return # f can't be a user-mode address, so treat it as a kernel file descriptor - 27 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x08000000/imm32 # compare *(EBP+8) + 27 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 0x08000000/imm32 # compare *(EBP+8) 28 7d/jump-if-greater-or-equal $write-stream:fake/disp8 29 # . . push args - 30 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) - 31 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) + 30 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) + 31 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 . # push *(EBP+8) 32 # . . call - 33 e8/call _write-stream/disp32 + 33 e8/call _write-stream/disp32 34 # . . discard args - 35 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP + 35 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 36 eb/jump $write-stream:end/disp8 37 $write-stream:fake: 38 # otherwise, treat 'f' as a stream to append to @@ -106,48 +102,48 @@ if ('onhashchange' in window) { 41 56/push-ESI 42 57/push-EDI 43 # EDI = f - 44 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 7/r32/EDI 8/disp8 . # copy *(EBP+8) to EDI + 44 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 7/r32/EDI 8/disp8 . # copy *(EBP+8) to EDI 45 # ESI = s - 46 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 6/r32/ESI 0xc/disp8 . # copy *(EBP+12) to ESI + 46 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 6/r32/ESI 0xc/disp8 . # copy *(EBP+12) to ESI 47 # EAX = _append-4(&f->data[f->write], &f->data[f->length], &s->data[s->read], &s->data[s->write]) 48 # . . push &s->data[s->write] - 49 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . . # copy *ESI to EAX - 50 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 . # copy ESI+EAX+12 to EAX + 49 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . . # copy *ESI to EAX + 50 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 . # copy ESI+EAX+12 to EAX 51 50/push-EAX 52 # . . push &s->data[s->read] - 53 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 . # copy *(ESI+4) to EAX - 54 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 . # copy ESI+EAX+12 to EAX + 53 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 . # copy *(ESI+4) to EAX + 54 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 . # copy ESI+EAX+12 to EAX 55 50/push-EAX 56 # . . push &f->data[f->length] - 57 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 8/disp8 . # copy *(EDI+8) to EAX - 58 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/EDI 0/index/EAX . 0/r32/EAX 0xc/disp8 . # copy EDI+EAX+12 to EAX + 57 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 8/disp8 . # copy *(EDI+8) to EAX + 58 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/EDI 0/index/EAX . 0/r32/EAX 0xc/disp8 . # copy EDI+EAX+12 to EAX 59 50/push-EAX 60 # . . push &f->data[f->write] - 61 8b/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy *EDI to EAX - 62 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/EDI 0/index/EAX . 0/r32/EAX 0xc/disp8 . # copy EDI+EAX+12 to EAX + 61 8b/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # copy *EDI to EAX + 62 8d/copy-address 1/mod/*+disp8 4/rm32/sib 7/base/EDI 0/index/EAX . 0/r32/EAX 0xc/disp8 . # copy EDI+EAX+12 to EAX 63 50/push-EAX 64 # . . call - 65 e8/call _append-4/disp32 + 65 e8/call _append-4/disp32 66 # . . discard args - 67 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32 # add to ESP + 67 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32 # add to ESP 68 # f->write += EAX - 69 01/add 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # add EAX to *EDI + 69 01/add 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . . # add EAX to *EDI 70 # s->read += EAX - 71 01/add 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 . # add EAX to *(ESI+4) + 71 01/add 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 . # add EAX to *(ESI+4) 72 # . restore registers 73 5f/pop-to-EDI 74 5e/pop-to-ESI 75 58/pop-to-EAX 76 $write-stream:end: 77 # . epilog - 78 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP + 78 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 79 5d/pop-to-EBP 80 c3/return 81 - 82 _write-stream: # fd : int, s : (address stream) -> <void> + 82 _write-stream: # fd : int, s : (address stream) -> <void> 83 # . prolog 84 55/push-EBP - 85 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP + 85 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP 86 # . save registers 87 50/push-EAX 88 51/push-ECX @@ -156,18 +152,18 @@ if ('onhashchange' in window) { 91 56/push-ESI 92 57/push-EDI 93 # ESI = s - 94 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 6/r32/ESI 0xc/disp8 . # copy *(EBP+12) to ESI + 94 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 . # copy *(EBP+12) to ESI 95 # EDI = s->read - 96 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 7/r32/EDI 4/disp8 . # copy *(ESI+4) to EDI + 96 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 7/r32/EDI 4/disp8 . # copy *(ESI+4) to EDI 97 # EDX = s->write - 98 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . . # copy *ESI to EDX + 98 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . . # copy *ESI to EDX 99 # syscall(write, fd, &s->data[s->read], s->write-s->read) 100 # . . fd : EBX -101 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 3/r32/EBX 8/disp8 . # copy *(EBP+8) to EBX +101 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 3/r32/EBX 8/disp8 . # copy *(EBP+8) to EBX 102 # . . data : ECX = &s->data[s->read] -103 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 7/index/EDI . 1/r32/ECX 0xc/disp8 . # copy ESI+EDI+12 to ECX +103 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 7/index/EDI . 1/r32/ECX 0xc/disp8 . # copy ESI+EDI+12 to ECX 104 # . . size : EDX = s->write - s->read -105 29/subtract 3/mod/direct 2/rm32/EDX . . . 7/r32/EDI . . # subtract EDI from EDX +105 29/subtract 3/mod/direct 2/rm32/EDX . . . 7/r32/EDI . . # subtract EDI from EDX 106 # . . syscall 107 b8/copy-to-EAX 4/imm32/write 108 cd/syscall 0x80/imm8 @@ -179,123 +175,123 @@ if ('onhashchange' in window) { 114 59/pop-to-ECX 115 58/pop-to-EAX 116 # . epilog -117 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +117 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 118 5d/pop-to-EBP 119 c3/return 120 -121 test-write-stream-single: +121 test-write-stream-single: 122 # setup 123 # . clear-stream(_test-stream) 124 # . . push args -125 68/push _test-stream/imm32 +125 68/push _test-stream/imm32 126 # . . call -127 e8/call clear-stream/disp32 +127 e8/call clear-stream/disp32 128 # . . discard args -129 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +129 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP 130 # . clear-stream(_test-stream2) 131 # . . push args -132 68/push _test-stream2/imm32 +132 68/push _test-stream2/imm32 133 # . . call -134 e8/call clear-stream/disp32 +134 e8/call clear-stream/disp32 135 # . . discard args -136 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +136 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP 137 # . write(_test-stream2, "Ab") 138 # . . push args 139 68/push "Ab"/imm32 -140 68/push _test-stream2/imm32 +140 68/push _test-stream2/imm32 141 # . . call -142 e8/call write/disp32 +142 e8/call write/disp32 143 # . . discard args -144 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +144 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 145 # write-stream(_test-stream, _test-stream2) 146 # . . push args -147 68/push _test-stream2/imm32 -148 68/push _test-stream/imm32 +147 68/push _test-stream2/imm32 +148 68/push _test-stream/imm32 149 # . . call -150 e8/call write-stream/disp32 +150 e8/call write-stream/disp32 151 # . . discard args -152 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +152 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 153 # check-ints-equal(*_test-stream->data, 41/A 62/b 00 00, msg) 154 # . . push args 155 68/push "F - test-write-stream-single"/imm32 156 68/push 0x006241/imm32/Ab 157 # . . push *_test-stream->data -158 b8/copy-to-EAX _test-stream/imm32 -159 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 . # push *(EAX+12) +158 b8/copy-to-EAX _test-stream/imm32 +159 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 . # push *(EAX+12) 160 # . . call -161 e8/call check-ints-equal/disp32 +161 e8/call check-ints-equal/disp32 162 # . . discard args -163 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +163 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 164 # . end 165 c3/return 166 -167 test-write-stream-appends: +167 test-write-stream-appends: 168 # setup 169 # . clear-stream(_test-stream) 170 # . . push args -171 68/push _test-stream/imm32 +171 68/push _test-stream/imm32 172 # . . call -173 e8/call clear-stream/disp32 +173 e8/call clear-stream/disp32 174 # . . discard args -175 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +175 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP 176 # . clear-stream(_test-stream2) 177 # . . push args -178 68/push _test-stream2/imm32 +178 68/push _test-stream2/imm32 179 # . . call -180 e8/call clear-stream/disp32 +180 e8/call clear-stream/disp32 181 # . . discard args -182 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +182 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP 183 # . write(_test-stream2, "C") 184 # . . push args 185 68/push "C"/imm32 -186 68/push _test-stream2/imm32 +186 68/push _test-stream2/imm32 187 # . . call -188 e8/call write/disp32 +188 e8/call write/disp32 189 # . . discard args -190 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +190 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 191 # first write 192 # . write-stream(_test-stream, _test-stream2) 193 # . . push args -194 68/push _test-stream2/imm32 -195 68/push _test-stream/imm32 +194 68/push _test-stream2/imm32 +195 68/push _test-stream/imm32 196 # . . call -197 e8/call write-stream/disp32 +197 e8/call write-stream/disp32 198 # . . discard args -199 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +199 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 200 # second write 201 # . write(_test-stream2, "D") 202 # . . push args 203 68/push "D"/imm32 -204 68/push _test-stream2/imm32 +204 68/push _test-stream2/imm32 205 # . . call -206 e8/call write/disp32 +206 e8/call write/disp32 207 # . . discard args -208 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +208 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 209 # . write-stream(_test-stream, _test-stream2) 210 # . . push args -211 68/push _test-stream2/imm32 -212 68/push _test-stream/imm32 +211 68/push _test-stream2/imm32 +212 68/push _test-stream/imm32 213 # . . call -214 e8/call write-stream/disp32 +214 e8/call write-stream/disp32 215 # . . discard args -216 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +216 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 217 # check-ints-equal(*_test-stream->data, 43/C 44/D 00 00, msg) 218 # . . push args 219 68/push "F - test-write-stream-appends"/imm32 220 68/push 0x00004443/imm32/C-D 221 # . . push *_test-stream->data -222 b8/copy-to-EAX _test-stream/imm32 -223 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 . # push *(EAX+12) +222 b8/copy-to-EAX _test-stream/imm32 +223 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 . # push *(EAX+12) 224 # . . call -225 e8/call check-ints-equal/disp32 +225 e8/call check-ints-equal/disp32 226 # . . discard args -227 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +227 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP 228 # . end 229 c3/return 230 231 == data 232 -233 _test-stream2: +233 _test-stream2: 234 # current write index 235 04 00 00 00 236 # current read index -- cgit 1.4.1-2-gfad0