about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-09-11 22:28:51 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-11 22:28:51 -0700
commit020a39e12e57c0acce011d69fd02a27393292950 (patch)
tree1d88e2ec62dcf642e97b54737f90d6a8ccebf2ef
parent2903607ab458137fb0775184d818920f3c07e331 (diff)
downloadmu-020a39e12e57c0acce011d69fd02a27393292950.tar.gz
4541
-rwxr-xr-xsubx/examples/ex6bin166 -> 165 bytes
-rw-r--r--subx/examples/ex6.subx5
2 files changed, 2 insertions, 3 deletions
diff --git a/subx/examples/ex6 b/subx/examples/ex6
index b897bc05..10e38936 100755
--- a/subx/examples/ex6
+++ b/subx/examples/ex6
Binary files differdiff --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