about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-10-17 08:19:03 -0700
committerKartik Agaram <vc@akkartik.com>2018-10-17 08:19:03 -0700
commit4cc517e0de7c7759196528bbf1b89f6b9624fe71 (patch)
treefd52f1454021426776716effa31f2a8f9fc21bcd
parent104e521c04d1a0cad9c68fb11e250e12ad8917ef (diff)
downloadmu-4cc517e0de7c7759196528bbf1b89f6b9624fe71.tar.gz
4710
Start using write() instead of _write().. and we promptly find a typo when
dealing with real file descriptors.
-rw-r--r--subx/056write.subx2
-rwxr-xr-xsubx/apps/crenshaw2-1bin2979 -> 2979 bytes
-rw-r--r--subx/apps/crenshaw2-1.subx16
-rwxr-xr-xsubx/apps/factorialbin3006 -> 3006 bytes
4 files changed, 9 insertions, 9 deletions
diff --git a/subx/056write.subx b/subx/056write.subx
index aaf04b9d..f8e32fb2 100644
--- a/subx/056write.subx
+++ b/subx/056write.subx
@@ -54,8 +54,8 @@ write:  # f : fd or (address stream), s : (address array byte) -> <void>
   81          7/subop/compare     1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           8/disp8         0x08000000/imm32  # compare *(EBP+8)
   7f/jump-if-greater  $write:else/disp8
     # push args
-  ff          6/subop/push        1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           8/disp8         .                 # push *(EBP+8)
   ff          6/subop/push        1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           0xc/disp8       .                 # push *(EBP+12)
+  ff          6/subop/push        1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           8/disp8         .                 # push *(EBP+8)
     # call
   e8/call  _write/disp32
     # discard args
diff --git a/subx/apps/crenshaw2-1 b/subx/apps/crenshaw2-1
index 52814a1d..840b93b4 100755
--- a/subx/apps/crenshaw2-1
+++ b/subx/apps/crenshaw2-1
Binary files differdiff --git a/subx/apps/crenshaw2-1.subx b/subx/apps/crenshaw2-1.subx
index 2d7921ce..6678f599 100644
--- a/subx/apps/crenshaw2-1.subx
+++ b/subx/apps/crenshaw2-1.subx
@@ -50,36 +50,36 @@ abort:  # s : (address array byte) -> <void>
 
 # print out "Error: #{s} expected\n" to stderr
 error:  # s : (address array byte) -> <void>
-  # _write(2/stderr, "Error: ")
+  # write(2/stderr, "Error: ")
     # push args
   68/push  "Error: "/imm32
   68/push  2/imm32/stderr
     # call
-  e8/call  _write/disp32
+  e8/call  write/disp32
     # discard arg
   81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-  # _write(2/stderr, s)
+  # write(2/stderr, s)
     # push args
   ff          6/subop/push        1/mod/*+disp8   4/rm32/sib    4/base/ESP  4/index/none  .           .           4/disp8         .                 # push *(ESP+4)
   68/push  2/imm32/stderr
     # call
-  e8/call  _write/disp32
+  e8/call  write/disp32
     # discard arg
   81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-  # _write(2/stderr, " expected")
+  # write(2/stderr, " expected")
     # push args
   68/push  " expected"/imm32
   68/push  2/imm32/stderr
     # call
-  e8/call  _write/disp32
+  e8/call  write/disp32
     # discard arg
   81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-  # _write(2/stderr, "\n")
+  # write(2/stderr, "\n")
     # push args
   68/push  Newline/imm32
   68/push  2/imm32/stderr
     # call
-  e8/call  _write/disp32
+  e8/call  write/disp32
     # discard arg
   81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
   # end
diff --git a/subx/apps/factorial b/subx/apps/factorial
index a1fa3905..26729183 100755
--- a/subx/apps/factorial
+++ b/subx/apps/factorial
Binary files differ