From 4cc517e0de7c7759196528bbf1b89f6b9624fe71 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 17 Oct 2018 08:19:03 -0700 Subject: 4710 Start using write() instead of _write().. and we promptly find a typo when dealing with real file descriptors. --- subx/056write.subx | 2 +- subx/apps/crenshaw2-1 | Bin 2979 -> 2979 bytes subx/apps/crenshaw2-1.subx | 16 ++++++++-------- subx/apps/factorial | Bin 3006 -> 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) -> 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 Binary files a/subx/apps/crenshaw2-1 and b/subx/apps/crenshaw2-1 differ diff --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) -> # print out "Error: #{s} expected\n" to stderr error: # s : (address array byte) -> - # _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 Binary files a/subx/apps/factorial and b/subx/apps/factorial differ -- cgit 1.4.1-2-gfad0