From 8aeb85f04ee68b960a6d326aca1a17dec2f6d019 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 9 Dec 2019 01:26:58 -0800 Subject: 5806 --- html/070new-stream.subx.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'html/070new-stream.subx.html') diff --git a/html/070new-stream.subx.html b/html/070new-stream.subx.html index 086f4a81..b9ff3660 100644 --- a/html/070new-stream.subx.html +++ b/html/070new-stream.subx.html @@ -64,13 +64,13 @@ if ('onhashchange' in window) { 5 # . op subop mod rm32 base index scale r32 6 # . 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 7 - 8 new-stream: # ad : (address allocation-descriptor), length : int, elemsize : int -> address/eax + 8 new-stream: # ad : (address allocation-descriptor), length : int, elemsize : int -> address/eax : (handle stream _) 9 # . prologue 10 55/push-ebp 11 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 12 # . save registers 13 52/push-edx - 14 # n = elemsize * length + 12 (for read, write and length) + 14 # var n/eax : int = elemsize * length + 12 (for read, write and length) 15 # . eax = elemsize 16 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 0x10/disp8 . # copy *(ebp+16) to eax 17 # . eax *= length @@ -83,12 +83,12 @@ if ('onhashchange' in window) { 24 89/copy 3/mod/direct 2/rm32/edx . . . 0/r32/eax . . # copy eax to edx 25 # . eax += 12 26 05/add-to-eax 0xc/imm32 - 27 # allocate(ad, n) + 27 # var eax : (handle stream _) = allocate(ad, n) 28 # . . push args 29 50/push-eax 30 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 31 # . . call - 32 e8/call allocate/disp32 + 32 e8/call allocate/disp32 33 # . . discard args 34 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 35 # eax->length = elemsize*length @@ -114,7 +114,7 @@ if ('onhashchange' in window) { 55 68/push "new-stream: size too large\n"/imm32 56 68/push 2/imm32/stderr 57 # . . call - 58 e8/call _write/disp32 + 58 e8/call _write/disp32 59 # . . discard args 60 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 61 # . syscall(exit, 1) @@ -127,7 +127,7 @@ if ('onhashchange' in window) { 68 # . prologue 69 55/push-ebp 70 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp - 71 # var heap/ecx : (address allocation-descriptor) = {0, 0} + 71 # var heap/ecx : (ref allocation-descriptor) 72 68/push 0/imm32/limit 73 68/push 0/imm32/curr 74 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx @@ -141,7 +141,7 @@ if ('onhashchange' in window) { 82 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 83 # var start/edx = ad->curr 84 8b/copy 0/mod/indirect 1/rm32/ecx . . . 2/r32/edx . . # copy *ecx to edx - 85 # eax = new-stream(heap, 3, 2) + 85 # var eax : (handle stream byte) = new-stream(heap, 3, 2) 86 # . . push args 87 68/push 2/imm32 88 68/push 3/imm32 -- cgit 1.4.1-2-gfad0