From d1c9392a5461e0d33e226375a8f7986a97d2d66b Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 26 Nov 2018 01:19:47 -0800 Subject: 4782 --- html/subx/examples/ex7.subx.html | 64 +++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 31 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 3ffc6a49..c41eccbf 100644 --- a/html/subx/examples/ex7.subx.html +++ b/html/subx/examples/ex7.subx.html @@ -17,6 +17,7 @@ a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } .LineNr { color: #444444; } .Delimiter { color: #800080; } +.Special { color: #c00000; } .Comment { color: #9090ff; } .Comment a { color:#0000ee; text-decoration:underline; } .SalientComment { color: #00ffff; } @@ -71,92 +72,93 @@ if ('onhashchange' in window) { 15 # op subop mod rm32 base index scale r32 16 # 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 17 - 18 # syscall(creat, filename) - 19 bb/copy-to-EBX filename/imm32 + 18 # syscall(creat, Filename) + 19 bb/copy-to-EBX Filename/imm32 20 b9/copy-to-ECX 0x180/imm32/fixed-perms 21 b8/copy-to-EAX 8/imm32/creat 22 cd/syscall 0x80/imm8 23 - 24 # stream = syscall(open, filename, O_WRONLY, 0) # we can't use 'fd' because it looks like a hex byte - 25 bb/copy-to-EBX filename/imm32 + 24 # stream = syscall(open, Filename, O_WRONLY, 0) # we can't use 'fd' because it looks like a hex byte + 25 bb/copy-to-EBX Filename/imm32 26 b9/copy-to-ECX 1/imm32/wronly 27 ba/copy-to-EDX 0x180/imm32/fixed-perms 28 b8/copy-to-EAX 5/imm32/open 29 cd/syscall 0x80/imm8 30 # save stream - 31 bb/copy-to-EBX stream/imm32 + 31 bb/copy-to-EBX Stream/imm32 32 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX 33 - 34 # syscall(write, stream, "a", 1) + 34 # syscall(write, Stream, "a", 1) 35 # load stream - 36 bb/copy-to-EBX stream/imm32 + 36 bb/copy-to-EBX Stream/imm32 37 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 38 # - 39 b9/copy-to-ECX a/imm32 + 39 b9/copy-to-ECX A/imm32 40 ba/copy-to-EDX 1/imm32/size 41 b8/copy-to-EAX 4/imm32/write 42 cd/syscall 0x80/imm8 43 - 44 # syscall(close, stream) + 44 # syscall(close, Stream) 45 # load stream - 46 bb/copy-to-EBX stream/imm32 + 46 bb/copy-to-EBX Stream/imm32 47 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 48 # 49 b8/copy-to-EAX 6/imm32/close 50 cd/syscall 0x80/imm8 51 - 52 # stream = syscall(open, filename, O_RDONLY, 0) - 53 bb/copy-to-EBX filename/imm32 + 52 # stream = syscall(open, Filename, O_RDONLY, 0) + 53 bb/copy-to-EBX Filename/imm32 54 b9/copy-to-ECX 0/imm32/rdonly 55 ba/copy-to-EDX 0x180/imm32/fixed-perms 56 b8/copy-to-EAX 5/imm32/open 57 cd/syscall 0x80/imm8 - 58 # save stream - 59 bb/copy-to-EBX stream/imm32 + 58 # save Stream + 59 bb/copy-to-EBX Stream/imm32 60 89/copy 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to *EBX 61 - 62 # syscall(read, stream, b, 1) + 62 # syscall(read, Stream, B, 1) 63 # load stream - 64 bb/copy-to-EBX stream/imm32 + 64 bb/copy-to-EBX Stream/imm32 65 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 66 # - 67 b9/copy-to-ECX b/imm32 + 67 b9/copy-to-ECX B/imm32 68 ba/copy-to-EDX 1/imm32/size 69 b8/copy-to-EAX 3/imm32/read 70 cd/syscall 0x80/imm8 71 - 72 # syscall(close, stream) + 72 # syscall(close, Stream) 73 # load stream - 74 bb/copy-to-EBX stream/imm32 + 74 bb/copy-to-EBX Stream/imm32 75 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 76 # 77 b8/copy-to-EAX 6/imm32/close 78 cd/syscall 0x80/imm8 79 80 # syscall(unlink, filename) - 81 bb/copy-to-EBX filename/imm32 + 81 bb/copy-to-EBX Filename/imm32 82 b8/copy-to-EAX 0xa/imm32/unlink 83 cd/syscall 0x80/imm8 84 85 # syscall(exit, b) 86 # load b - 87 bb/copy-to-EBX b/imm32 + 87 bb/copy-to-EBX B/imm32 88 8b/copy 0/mod/indirect 3/rm32/EBX . . . 3/r32/EBX . . # copy *EBX to EBX 89 # 90 b8/copy-to-EAX 1/imm32/exit 91 cd/syscall 0x80/imm8 92 93 == data - 94 stream: - 95 00 00 00 00 - 96 a: - 97 61 00 00 00 - 98 b: - 99 00 00 00 00 -100 filename: -101 2e 66 6f 6f 00 00 00 00 -102 -103 # vim:nowrap:textwidth=0 + 94 + 95 Stream: + 96 00 00 00 00 + 97 A: + 98 61 00 00 00 + 99 B: +100 00 00 00 00 +101 Filename: +102 2e 66 6f 6f 00 00 00 00 +103 +104 # vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0