From 86351aafe218a7386f6578be3c4da3edcdcb0c98 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 12 Jun 2020 07:57:27 -0700 Subject: 6513 --- html/070new-stream.subx.html | 135 +++++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 68 deletions(-) (limited to 'html/070new-stream.subx.html') diff --git a/html/070new-stream.subx.html b/html/070new-stream.subx.html index 2eb35066..efe0c943 100644 --- a/html/070new-stream.subx.html +++ b/html/070new-stream.subx.html @@ -90,7 +90,7 @@ if ('onhashchange' in window) { 31 50/push-eax 32 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 33 # . . call - 34 e8/call allocate/disp32 + 34 e8/call allocate/disp32 35 # . . discard args 36 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 37 # eax = out->payload @@ -122,78 +122,77 @@ if ('onhashchange' in window) { 63 68/push "new-stream: size too large\n"/imm32 64 68/push 2/imm32/stderr 65 # . . call - 66 e8/call _write/disp32 + 66 e8/call _write/disp32 67 # . . discard args 68 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 69 # . syscall(exit, 1) 70 bb/copy-to-ebx 1/imm32 - 71 b8/copy-to-eax 1/imm32/exit - 72 cd/syscall 0x80/imm8 - 73 # never gets here - 74 - 75 test-new-stream: - 76 # . prologue - 77 55/push-ebp - 78 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp - 79 # var heap/ecx: allocation-descriptor - 80 68/push 0/imm32/limit - 81 68/push 0/imm32/curr - 82 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - 83 # heap = new-segment(512) - 84 # . . push args - 85 51/push-ecx - 86 68/push 0x200/imm32 - 87 # . . call - 88 e8/call new-segment/disp32 - 89 # . . discard args - 90 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - 91 # var start/edx = ad->curr - 92 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . . # copy *ecx to edx - 93 # var h/ebx: (handle stream byte) + 71 e8/call syscall_exit/disp32 + 72 # never gets here + 73 + 74 test-new-stream: + 75 # . prologue + 76 55/push-ebp + 77 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp + 78 # var heap/ecx: allocation-descriptor + 79 68/push 0/imm32/limit + 80 68/push 0/imm32/curr + 81 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx + 82 # heap = new-segment(512) + 83 # . . push args + 84 51/push-ecx + 85 68/push 0x200/imm32 + 86 # . . call + 87 e8/call new-segment/disp32 + 88 # . . discard args + 89 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp + 90 # var start/edx = ad->curr + 91 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . . # copy *ecx to edx + 92 # var h/ebx: (handle stream byte) + 93 68/push 0/imm32 94 68/push 0/imm32 - 95 68/push 0/imm32 - 96 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . . # copy esp to ebx - 97 # new-stream(heap, 3, 2, h) - 98 # . . push args - 99 53/push-ebx -100 68/push 2/imm32 -101 68/push 3/imm32 -102 51/push-ecx -103 # . . call -104 e8/call new-stream/disp32 -105 # . . discard args -106 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp -107 # eax = out->payload -108 8b/copy 1/mod/*+disp8 3/rm32/ebx . . . 0/r32/eax 4/disp8 . # copy *(ebx+4) to eax -109 # check-ints-equal(eax, edx, msg) -110 # . . push args -111 68/push "F - test-new-stream: returns current pointer of allocation descriptor"/imm32 -112 52/push-edx -113 50/push-eax -114 # . . call -115 e8/call check-ints-equal/disp32 -116 # . . discard args -117 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp -118 # skip payload->allocid -119 05/add-to-eax 4/imm32 -120 # check-ints-equal(eax->size, 6, msg) -121 # . . push args -122 68/push "F - test-new-stream: sets size correctly"/imm32 -123 68/push 6/imm32 -124 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . . 8/disp8 # push *(eax+8) -125 # . . call -126 e8/call check-ints-equal/disp32 -127 # . . discard args -128 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp -129 # the rest is delegated to clear-stream() so we won't bother checking it -130 # . reclaim locals -131 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp -132 # . epilogue -133 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp -134 5d/pop-to-ebp -135 c3/return -136 -137 # . . vim:nowrap:textwidth=0 + 95 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . . # copy esp to ebx + 96 # new-stream(heap, 3, 2, h) + 97 # . . push args + 98 53/push-ebx + 99 68/push 2/imm32 +100 68/push 3/imm32 +101 51/push-ecx +102 # . . call +103 e8/call new-stream/disp32 +104 # . . discard args +105 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp +106 # eax = out->payload +107 8b/copy 1/mod/*+disp8 3/rm32/ebx . . . 0/r32/eax 4/disp8 . # copy *(ebx+4) to eax +108 # check-ints-equal(eax, edx, msg) +109 # . . push args +110 68/push "F - test-new-stream: returns current pointer of allocation descriptor"/imm32 +111 52/push-edx +112 50/push-eax +113 # . . call +114 e8/call check-ints-equal/disp32 +115 # . . discard args +116 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp +117 # skip payload->allocid +118 05/add-to-eax 4/imm32 +119 # check-ints-equal(eax->size, 6, msg) +120 # . . push args +121 68/push "F - test-new-stream: sets size correctly"/imm32 +122 68/push 6/imm32 +123 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . . 8/disp8 # push *(eax+8) +124 # . . call +125 e8/call check-ints-equal/disp32 +126 # . . discard args +127 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp +128 # the rest is delegated to clear-stream() so we won't bother checking it +129 # . reclaim locals +130 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp +131 # . epilogue +132 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp +133 5d/pop-to-ebp +134 c3/return +135 +136 # . . vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0