From 020a39e12e57c0acce011d69fd02a27393292950 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 11 Sep 2018 22:28:51 -0700 Subject: 4541 --- subx/examples/ex6 | Bin 166 -> 165 bytes subx/examples/ex6.subx | 5 ++--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/subx/examples/ex6 b/subx/examples/ex6 index b897bc05..10e38936 100755 Binary files a/subx/examples/ex6 and b/subx/examples/ex6 differ diff --git a/subx/examples/ex6.subx b/subx/examples/ex6.subx index 48dbb7a3..567c2e24 100644 --- a/subx/examples/ex6.subx +++ b/subx/examples/ex6.subx @@ -10,14 +10,13 @@ # op subop mod rm32 base index scale r32 # 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 - ## write(stdout, x, 1) + ## write(stdout, x, size) # fd = 1 (stdout) bb/copy 1/imm32 # copy 1 to EBX # initialize x (location to write result to) b9/copy x/imm32 # copy to ECX # initialize size - ba/copy size/imm32 # copy to EDX - 8b/copy 0/mod/indirect 2/rm32/EDX 2/r32/EDX # copy *EDX to EDX + 8b/copy 0/mod/indirect 5/rm32/.disp32 2/r32/EDX size/disp32 # copy *size to EDX # write(fd, x, size) b8/copy 4/imm32 # copy 4 to EAX cd/syscall 0x80/imm8 # int 80h -- cgit 1.4.1-2-gfad0