From 91dab3e1a499cac50abd146ce849d3dab94229ab Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 3 Dec 2018 12:03:23 -0800 Subject: 4824 --- html/subx/053new_segment.subx.html | 14 +- html/subx/059read-byte.subx.html | 311 ++++++++++++++++++------------------- html/subx/examples/ex12.subx.html | 4 +- html/subx/examples/ex7.subx.html | 14 +- subx/053new_segment.subx | 14 +- subx/examples/ex12.subx | 4 +- subx/examples/ex7.subx | 14 +- 7 files changed, 186 insertions(+), 189 deletions(-) diff --git a/html/subx/053new_segment.subx.html b/html/subx/053new_segment.subx.html index 8ae47381..92a3f0e5 100644 --- a/html/subx/053new_segment.subx.html +++ b/html/subx/053new_segment.subx.html @@ -75,33 +75,33 @@ if ('onhashchange' in window) { 12 # . . call 13 e8/call new-segment/disp32 14 # . . discard args -15 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +15 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP 16 17 # write to *EAX to check that we have access to the newly-allocated segment -18 c7/copy 0/mod/direct 0/rm32/EAX . . . . . 0x34/imm32 # copy to *EAX +18 c7/copy 0/mod/direct 0/rm32/EAX . . . . . 0x34/imm32 # copy to *EAX 19 20 # syscall(exit, EAX) -21 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX +21 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX 22 b8/copy-to-EAX 1/imm32/exit 23 cd/syscall 0x80/imm8 24 25 new-segment: # len : int -> address 26 # . prolog 27 55/push-EBP -28 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +28 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP 29 53/push-EBX 30 # copy len to _mmap-new-segment->len 31 # TODO: compute _mmap-new-segment+4 before runtime -32 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX +32 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX 33 bb/copy-to-EBX _mmap-new-segment/imm32 -34 89/copy 1/mod/*+disp8 3/rm32/EBX . . . 0/r32/EAX 4/disp8 . # copy EAX to *(EBX+4) +34 89/copy 1/mod/*+disp8 3/rm32/EBX . . . 0/r32/EAX 4/disp8 . # copy EAX to *(EBX+4) 35 # mmap(_mmap-new-segment) 36 bb/copy-to-EBX _mmap-new-segment/imm32 37 b8/copy-to-EAX 0x5a/imm32/mmap 38 cd/syscall 0x80/imm8 39 # . epilog 40 5b/pop-to-EBX -41 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +41 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 42 5d/pop-to-EBP 43 c3/return 44 diff --git a/html/subx/059read-byte.subx.html b/html/subx/059read-byte.subx.html index ad958670..e23ec5a7 100644 --- a/html/subx/059read-byte.subx.html +++ b/html/subx/059read-byte.subx.html @@ -160,163 +160,160 @@ if ('onhashchange' in window) { 94 5d/pop-to-EBP 95 c3/return 96 - 97 # todo: how should write-byte look? What should it do when the output has no - 98 # space remaining? Maybe return an error code. - 99 -100 # - tests -101 -102 test-read-byte-single: -103 # - check that read-byte returns first byte of 'file' -104 # setup -105 # . clear-stream(_test-stream) -106 # . . push args -107 68/push _test-stream/imm32 -108 # . . call -109 e8/call clear-stream/disp32 -110 # . . discard args -111 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -112 # . clear-stream(_test-buffered-file+4) -113 # . . push args -114 b8/copy-to-EAX _test-buffered-file/imm32 -115 05/add-to-EAX 4/imm32 -116 50/push-EAX -117 # . . call -118 e8/call clear-stream/disp32 -119 # . . discard args -120 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -121 # . write(_test-stream, "Ab") -122 # . . push args -123 68/push "Ab"/imm32 -124 68/push _test-stream/imm32 -125 # . . call -126 e8/call write/disp32 -127 # . . discard args -128 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -129 # read-byte(_test-buffered-file) -130 # . . push args -131 68/push _test-buffered-file/imm32 -132 # . . call -133 e8/call read-byte/disp32 -134 # . . discard args -135 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -136 # check-ints-equal(EAX, 'A', msg) -137 # . . push args -138 68/push "F - test-read-byte-single"/imm32 -139 68/push 0x41/imm32 -140 50/push-EAX -141 # . . call -142 e8/call check-ints-equal/disp32 -143 # . . discard args -144 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -145 # . end -146 c3/return -147 -148 test-read-byte-multiple: -149 # - call read-byte twice, check that second call returns second byte -150 # setup -151 # . clear-stream(_test-stream) -152 # . . push args -153 68/push _test-stream/imm32 -154 # . . call -155 e8/call clear-stream/disp32 -156 # . . discard args -157 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -158 # . clear-stream(_test-buffered-file+4) -159 # . . push args -160 b8/copy-to-EAX _test-buffered-file/imm32 -161 05/add-to-EAX 4/imm32 -162 50/push-EAX -163 # . . call -164 e8/call clear-stream/disp32 -165 # . . discard args -166 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -167 # . write(_test-stream, "Ab") -168 # . . push args -169 68/push "Ab"/imm32 -170 68/push _test-stream/imm32 -171 # . . call -172 e8/call write/disp32 -173 # . . discard args -174 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -175 # read-byte(_test-buffered-file) -176 # . . push args -177 68/push _test-buffered-file/imm32 -178 # . . call -179 e8/call read-byte/disp32 -180 # . . discard args -181 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -182 # read-byte(_test-buffered-file) -183 # . . push args -184 68/push _test-buffered-file/imm32 -185 # . . call -186 e8/call read-byte/disp32 -187 # . . discard args -188 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -189 # check-ints-equal(EAX, 'b', msg) -190 # . . push args -191 68/push "F - test-read-byte-multiple"/imm32 -192 68/push 0x62/imm32 -193 50/push-EAX -194 # . . call -195 e8/call check-ints-equal/disp32 -196 # . . discard args -197 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -198 # . end -199 c3/return -200 -201 test-read-byte-end-of-file: -202 # - call read-byte on an empty 'file', check that it returns -1 -203 # setup -204 # . clear-stream(_test-stream) -205 # . . push args -206 68/push _test-stream/imm32 -207 # . . call -208 e8/call clear-stream/disp32 -209 # . . discard args -210 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -211 # . clear-stream(_test-buffered-file+4) -212 # . . push args -213 b8/copy-to-EAX _test-buffered-file/imm32 -214 05/add-to-EAX 4/imm32 -215 50/push-EAX -216 # . . call -217 e8/call clear-stream/disp32 -218 # . . discard args -219 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -220 # read-byte(_test-buffered-file) -221 # . . push args -222 68/push _test-buffered-file/imm32 -223 # . . call -224 e8/call read-byte/disp32 -225 # . . discard args -226 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP -227 # check-ints-equal(EAX, -1, msg) -228 # . . push args -229 68/push "F - test-read-byte-end-of-file"/imm32 -230 68/push -1/imm32 -231 50/push-EAX -232 # . . call -233 e8/call check-ints-equal/disp32 -234 # . . discard args -235 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP -236 # . end -237 c3/return -238 -239 == data -240 -241 _test-buffered-file: -242 # file descriptor or (address stream) -243 _test-stream/imm32 -244 # current write index -245 00 00 00 00 -246 # current read index -247 00 00 00 00 -248 # length (8) -249 08 00 00 00 -250 # data -251 00 00 00 00 00 00 00 00 # 8 bytes -252 -253 # . . vim:nowrap:textwidth=0 + 97 # - tests + 98 + 99 test-read-byte-single: +100 # - check that read-byte returns first byte of 'file' +101 # setup +102 # . clear-stream(_test-stream) +103 # . . push args +104 68/push _test-stream/imm32 +105 # . . call +106 e8/call clear-stream/disp32 +107 # . . discard args +108 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +109 # . clear-stream(_test-buffered-file+4) +110 # . . push args +111 b8/copy-to-EAX _test-buffered-file/imm32 +112 05/add-to-EAX 4/imm32 +113 50/push-EAX +114 # . . call +115 e8/call clear-stream/disp32 +116 # . . discard args +117 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +118 # . write(_test-stream, "Ab") +119 # . . push args +120 68/push "Ab"/imm32 +121 68/push _test-stream/imm32 +122 # . . call +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) +127 # . . push args +128 68/push _test-buffered-file/imm32 +129 # . . call +130 e8/call read-byte/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 +136 68/push 0x41/imm32 +137 50/push-EAX +138 # . . call +139 e8/call check-ints-equal/disp32 +140 # . . discard args +141 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +142 # . end +143 c3/return +144 +145 test-read-byte-multiple: +146 # - call read-byte twice, check that second call returns second byte +147 # setup +148 # . clear-stream(_test-stream) +149 # . . push args +150 68/push _test-stream/imm32 +151 # . . call +152 e8/call clear-stream/disp32 +153 # . . discard args +154 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +155 # . clear-stream(_test-buffered-file+4) +156 # . . push args +157 b8/copy-to-EAX _test-buffered-file/imm32 +158 05/add-to-EAX 4/imm32 +159 50/push-EAX +160 # . . call +161 e8/call clear-stream/disp32 +162 # . . discard args +163 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +164 # . write(_test-stream, "Ab") +165 # . . push args +166 68/push "Ab"/imm32 +167 68/push _test-stream/imm32 +168 # . . call +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) +173 # . . push args +174 68/push _test-buffered-file/imm32 +175 # . . call +176 e8/call read-byte/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) +180 # . . push args +181 68/push _test-buffered-file/imm32 +182 # . . call +183 e8/call read-byte/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 +189 68/push 0x62/imm32 +190 50/push-EAX +191 # . . call +192 e8/call check-ints-equal/disp32 +193 # . . discard args +194 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +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 -1 +200 # setup +201 # . clear-stream(_test-stream) +202 # . . push args +203 68/push _test-stream/imm32 +204 # . . call +205 e8/call clear-stream/disp32 +206 # . . discard args +207 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP +208 # . clear-stream(_test-buffered-file+4) +209 # . . push args +210 b8/copy-to-EAX _test-buffered-file/imm32 +211 05/add-to-EAX 4/imm32 +212 50/push-EAX +213 # . . call +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) +218 # . . push args +219 68/push _test-buffered-file/imm32 +220 # . . call +221 e8/call read-byte/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, -1, msg) +225 # . . push args +226 68/push "F - test-read-byte-end-of-file"/imm32 +227 68/push -1/imm32 +228 50/push-EAX +229 # . . call +230 e8/call check-ints-equal/disp32 +231 # . . discard args +232 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +233 # . end +234 c3/return +235 +236 == data +237 +238 _test-buffered-file: +239 # file descriptor or (address stream) +240 _test-stream/imm32 +241 # current write index +242 00 00 00 00 +243 # current read index +244 00 00 00 00 +245 # length (8) +246 08 00 00 00 +247 # data +248 00 00 00 00 00 00 00 00 # 8 bytes +249 +250 # . . vim:nowrap:textwidth=0 diff --git a/html/subx/examples/ex12.subx.html b/html/subx/examples/ex12.subx.html index e2dfc4e0..39e13baa 100644 --- a/html/subx/examples/ex12.subx.html +++ b/html/subx/examples/ex12.subx.html @@ -79,10 +79,10 @@ if ('onhashchange' in window) { 17 cd/syscall 0x80/imm8 18 19 # write to *EAX to check that we have access to the newly-allocated segment -20 c7/copy 0/mod/direct 0/rm32/EAX . . . . . 0x34/imm32 # copy to *EAX +20 c7/copy 0/mod/direct 0/rm32/EAX . . . . . 0x34/imm32 # copy to *EAX 21 22 # syscall(exit, EAX) -23 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX +23 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX 24 b8/copy-to-EAX 1/imm32/exit 25 cd/syscall 0x80/imm8 26 diff --git a/html/subx/examples/ex7.subx.html b/html/subx/examples/ex7.subx.html index f22f852f..ad52cf1c 100644 --- a/html/subx/examples/ex7.subx.html +++ b/html/subx/examples/ex7.subx.html @@ -91,12 +91,12 @@ if ('onhashchange' in window) { 30 cd/syscall 0x80/imm8 31 # save stream 32 bb/copy-to-EBX Stream/imm32 - 33 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX + 33 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX 34 35 # syscall(write, Stream, "a", 1) 36 # . load stream 37 bb/copy-to-EBX Stream/imm32 - 38 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 38 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 39 # . 40 b9/copy-to-ECX A/imm32 41 ba/copy-to-EDX 1/imm32/size @@ -106,7 +106,7 @@ if ('onhashchange' in window) { 45 # syscall(close, Stream) 46 # . load stream 47 bb/copy-to-EBX Stream/imm32 - 48 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 48 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 49 # . 50 b8/copy-to-EAX 6/imm32/close 51 cd/syscall 0x80/imm8 @@ -119,12 +119,12 @@ if ('onhashchange' in window) { 58 cd/syscall 0x80/imm8 59 # . save Stream 60 bb/copy-to-EBX Stream/imm32 - 61 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX + 61 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX 62 63 # syscall(read, Stream, B, 1) 64 # . load stream 65 bb/copy-to-EBX Stream/imm32 - 66 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 66 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 67 # . 68 b9/copy-to-ECX B/imm32 69 ba/copy-to-EDX 1/imm32/size @@ -134,7 +134,7 @@ if ('onhashchange' in window) { 73 # syscall(close, Stream) 74 # . load stream 75 bb/copy-to-EBX Stream/imm32 - 76 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 76 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 77 # 78 b8/copy-to-EAX 6/imm32/close 79 cd/syscall 0x80/imm8 @@ -147,7 +147,7 @@ if ('onhashchange' in window) { 86 # syscall(exit, b) 87 # . load b 88 bb/copy-to-EBX B/imm32 - 89 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 89 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 90 # 91 b8/copy-to-EAX 1/imm32/exit 92 cd/syscall 0x80/imm8 diff --git a/subx/053new_segment.subx b/subx/053new_segment.subx index efbfc1a3..27fd8ea1 100644 --- a/subx/053new_segment.subx +++ b/subx/053new_segment.subx @@ -12,33 +12,33 @@ # . . call e8/call new-segment/disp32 # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # write to *EAX to check that we have access to the newly-allocated segment - c7/copy 0/mod/direct 0/rm32/EAX . . . . . 0x34/imm32 # copy to *EAX + c7/copy 0/mod/direct 0/rm32/EAX . . . . . 0x34/imm32 # copy to *EAX # syscall(exit, EAX) - 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX + 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX b8/copy-to-EAX 1/imm32/exit cd/syscall 0x80/imm8 new-segment: # len : int -> address # . prolog 55/push-EBP - 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP + 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP 53/push-EBX # copy len to _mmap-new-segment->len # TODO: compute _mmap-new-segment+4 before runtime - 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX + 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX bb/copy-to-EBX _mmap-new-segment/imm32 - 89/copy 1/mod/*+disp8 3/rm32/EBX . . . 0/r32/EAX 4/disp8 . # copy EAX to *(EBX+4) + 89/copy 1/mod/*+disp8 3/rm32/EBX . . . 0/r32/EAX 4/disp8 . # copy EAX to *(EBX+4) # mmap(_mmap-new-segment) bb/copy-to-EBX _mmap-new-segment/imm32 b8/copy-to-EAX 0x5a/imm32/mmap cd/syscall 0x80/imm8 # . epilog 5b/pop-to-EBX - 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP + 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 5d/pop-to-EBP c3/return diff --git a/subx/examples/ex12.subx b/subx/examples/ex12.subx index 3b101379..6d17a39f 100644 --- a/subx/examples/ex12.subx +++ b/subx/examples/ex12.subx @@ -17,10 +17,10 @@ cd/syscall 0x80/imm8 # write to *EAX to check that we have access to the newly-allocated segment - c7/copy 0/mod/direct 0/rm32/EAX . . . . . 0x34/imm32 # copy to *EAX + c7/copy 0/mod/direct 0/rm32/EAX . . . . . 0x34/imm32 # copy to *EAX # syscall(exit, EAX) - 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX + 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX b8/copy-to-EAX 1/imm32/exit cd/syscall 0x80/imm8 diff --git a/subx/examples/ex7.subx b/subx/examples/ex7.subx index e28ff89b..4355910a 100644 --- a/subx/examples/ex7.subx +++ b/subx/examples/ex7.subx @@ -30,12 +30,12 @@ cd/syscall 0x80/imm8 # save stream bb/copy-to-EBX Stream/imm32 - 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX + 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX # syscall(write, Stream, "a", 1) # . load stream bb/copy-to-EBX Stream/imm32 - 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX # . b9/copy-to-ECX A/imm32 ba/copy-to-EDX 1/imm32/size @@ -45,7 +45,7 @@ # syscall(close, Stream) # . load stream bb/copy-to-EBX Stream/imm32 - 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX # . b8/copy-to-EAX 6/imm32/close cd/syscall 0x80/imm8 @@ -58,12 +58,12 @@ cd/syscall 0x80/imm8 # . save Stream bb/copy-to-EBX Stream/imm32 - 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX + 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX # syscall(read, Stream, B, 1) # . load stream bb/copy-to-EBX Stream/imm32 - 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX # . b9/copy-to-ECX B/imm32 ba/copy-to-EDX 1/imm32/size @@ -73,7 +73,7 @@ # syscall(close, Stream) # . load stream bb/copy-to-EBX Stream/imm32 - 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX # b8/copy-to-EAX 6/imm32/close cd/syscall 0x80/imm8 @@ -86,7 +86,7 @@ # syscall(exit, b) # . load b bb/copy-to-EBX B/imm32 - 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX + 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX # b8/copy-to-EAX 1/imm32/exit cd/syscall 0x80/imm8 -- cgit 1.4.1-2-gfad0