about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xsubx/apps/surveybin41174 -> 41196 bytes
-rw-r--r--subx/apps/survey.subx10
-rw-r--r--subx/examples/ex6.subx1
3 files changed, 10 insertions, 1 deletions
diff --git a/subx/apps/survey b/subx/apps/survey
index 61e2f974..92da0e6b 100755
--- a/subx/apps/survey
+++ b/subx/apps/survey
Binary files differdiff --git a/subx/apps/survey.subx b/subx/apps/survey.subx
index d868132a..0f5428bb 100644
--- a/subx/apps/survey.subx
+++ b/subx/apps/survey.subx
@@ -79,7 +79,7 @@ Entry:
     eb/jump  $main:end/disp8
 $run-main:
     # - otherwise convert stdin
-    # return convert(Stdin, Stdout)
+    # convert(Stdin, Stdout)
     # . . push args
     68/push  Stdout/imm32
     68/push  Stdin/imm32
@@ -87,6 +87,14 @@ $run-main:
     e8/call  convert/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+    # . write-stream(2/stderr, Trace-stream)
+    # . . push args
+    ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Trace-stream/disp32               # push *Trace-stream
+    68/push  2/imm32/stderr
+    # . . call
+    e8/call  write-stream/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
     # . syscall(exit, 0)
     bb/copy-to-EBX  0/imm32
 $main:end:
diff --git a/subx/examples/ex6.subx b/subx/examples/ex6.subx
index a90f11df..d690d378 100644
--- a/subx/examples/ex6.subx
+++ b/subx/examples/ex6.subx
@@ -17,6 +17,7 @@ Entry:
     # . initialize X (location to write result to)
     b9/copy-to-ECX  X/imm32
     # . initialize Size
+# HERE
     8b/copy                         0/mod/indirect  5/rm32/.disp32            .             .           2/r32/EDX   Size/disp32     .                 # copy *Size to EDX
     # . syscall
     b8/copy-to-EAX  4/imm32/write