about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-07-15 17:03:39 -0700
committerKartik Agaram <vc@akkartik.com>2019-07-15 17:03:39 -0700
commit70a999aaebbd05873be56b0460e0d4182397cfea (patch)
tree5339322b177f23a606b6343c6551676a21e70e6c /subx
parent549099384589fcbca3f7bc2f9b60473708f22e82 (diff)
downloadmu-70a999aaebbd05873be56b0460e0d4182397cfea.tar.gz
5407
Bugfix nine: flush(out) after translation is done.

Still one remaining bug from comparing ELF binaries: emit-segments
prints nothing for some reason.
Diffstat (limited to 'subx')
-rwxr-xr-xsubx/apps/surveybin40460 -> 40474 bytes
-rw-r--r--subx/apps/survey.subx7
2 files changed, 7 insertions, 0 deletions
diff --git a/subx/apps/survey b/subx/apps/survey
index 93e7afc1..c413a9f4 100755
--- a/subx/apps/survey
+++ b/subx/apps/survey
Binary files differdiff --git a/subx/apps/survey.subx b/subx/apps/survey.subx
index 58de2b66..b7ce08dd 100644
--- a/subx/apps/survey.subx
+++ b/subx/apps/survey.subx
@@ -268,6 +268,13 @@ convert:  # in : (address buffered-file), out : (address buffered-file) -> <void
     e8/call  emit-output/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x10/imm32        # add to ESP
+    # flush(out)
+    # . . push args
+    ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0xc/disp8       .                 # push *(EBP+12)
+    # . . call
+    e8/call  flush/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add to ESP
 $convert:end:
     # . reclaim locals
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x214/imm32       # add to ESP