From c6f522007de6f96e79d52ae9db2e23333c318c8f Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 30 Nov 2018 20:01:41 -0800 Subject: 4811 --- html/subx/examples/ex7.subx.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'html/subx/examples/ex7.subx.html') diff --git a/html/subx/examples/ex7.subx.html b/html/subx/examples/ex7.subx.html index 2a835bbb..e20ebc88 100644 --- a/html/subx/examples/ex7.subx.html +++ b/html/subx/examples/ex7.subx.html @@ -77,75 +77,75 @@ if ('onhashchange' in window) { 17 # . 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 18 19 # syscall(creat, Filename) - 20 bb/copy-to-EBX Filename/imm32 + 20 bb/copy-to-EBX Filename/imm32 21 b9/copy-to-ECX 0x180/imm32/fixed-perms 22 b8/copy-to-EAX 8/imm32/creat 23 cd/syscall 0x80/imm8 24 25 # stream = syscall(open, Filename, O_WRONLY, 0) # we can't use 'fd' because it looks like a hex byte - 26 bb/copy-to-EBX Filename/imm32 + 26 bb/copy-to-EBX Filename/imm32 27 b9/copy-to-ECX 1/imm32/wronly 28 ba/copy-to-EDX 0x180/imm32/fixed-perms 29 b8/copy-to-EAX 5/imm32/open 30 cd/syscall 0x80/imm8 31 # save stream - 32 bb/copy-to-EBX Stream/imm32 + 32 bb/copy-to-EBX Stream/imm32 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 + 37 bb/copy-to-EBX Stream/imm32 38 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 39 # . - 40 b9/copy-to-ECX A/imm32 + 40 b9/copy-to-ECX A/imm32 41 ba/copy-to-EDX 1/imm32/size 42 b8/copy-to-EAX 4/imm32/write 43 cd/syscall 0x80/imm8 44 45 # syscall(close, Stream) 46 # . load stream - 47 bb/copy-to-EBX Stream/imm32 + 47 bb/copy-to-EBX Stream/imm32 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 52 53 # stream = syscall(open, Filename, O_RDONLY, 0) - 54 bb/copy-to-EBX Filename/imm32 + 54 bb/copy-to-EBX Filename/imm32 55 b9/copy-to-ECX 0/imm32/rdonly 56 ba/copy-to-EDX 0x180/imm32/fixed-perms 57 b8/copy-to-EAX 5/imm32/open 58 cd/syscall 0x80/imm8 59 # . save Stream - 60 bb/copy-to-EBX Stream/imm32 + 60 bb/copy-to-EBX Stream/imm32 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 + 65 bb/copy-to-EBX Stream/imm32 66 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 67 # . - 68 b9/copy-to-ECX B/imm32 + 68 b9/copy-to-ECX B/imm32 69 ba/copy-to-EDX 1/imm32/size 70 b8/copy-to-EAX 3/imm32/read 71 cd/syscall 0x80/imm8 72 73 # syscall(close, Stream) 74 # . load stream - 75 bb/copy-to-EBX Stream/imm32 + 75 bb/copy-to-EBX Stream/imm32 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 80 81 # syscall(unlink, filename) - 82 bb/copy-to-EBX Filename/imm32 + 82 bb/copy-to-EBX Filename/imm32 83 b8/copy-to-EAX 0xa/imm32/unlink 84 cd/syscall 0x80/imm8 85 86 # syscall(exit, b) 87 # . load b - 88 bb/copy-to-EBX B/imm32 + 88 bb/copy-to-EBX B/imm32 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 -- cgit 1.4.1-2-gfad0