about summary refs log tree commit diff stats
path: root/subx/apps
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-12-02 14:41:21 -0800
committerKartik Agaram <vc@akkartik.com>2018-12-02 14:41:21 -0800
commitc98d4b1c6ae2d103acc7b4f15e4dc6336f30de17 (patch)
tree46da18e339b2d87fc14b9f064cf1addf04a5ae64 /subx/apps
parentf75f333f52d42908ebf427f04fa6033f285ea5e5 (diff)
downloadmu-c98d4b1c6ae2d103acc7b4f15e4dc6336f30de17.tar.gz
4818
Diffstat (limited to 'subx/apps')
-rw-r--r--subx/apps/crenshaw2-1.subx13
-rw-r--r--subx/apps/crenshaw2-1b.subx12
2 files changed, 13 insertions, 12 deletions
diff --git a/subx/apps/crenshaw2-1.subx b/subx/apps/crenshaw2-1.subx
index c523634a..3688ef34 100644
--- a/subx/apps/crenshaw2-1.subx
+++ b/subx/apps/crenshaw2-1.subx
@@ -88,6 +88,7 @@ compile:  # in : (address buffered-file), out : fd or (address stream), err : fd
     # . save registers
     50/push-EAX
     51/push-ECX
+    # prime the pump
     # . Look = get-char(in)
     # . . push args
     ff          6/subop/push        1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           .           8/disp8      .                    # push *(EBP+8)
@@ -198,11 +199,11 @@ compile:  # in : (address buffered-file), out : fd or (address stream), err : fd
 get-num:  # in : (address buffered-file), out : (address stream), err : fd or (address stream), ed : (address exit-descriptor) -> <void>
     # pseudocode:
     #   if !is-digit?(Look) expected(ed, err, "integer")
-    #   if out.write >= out.length
+    #   if out->write >= out->length
     #     write(err, "Error: too many digits in number\n")
     #     stop(ed, 1)
-    #   out.data[out.write] = LSB(Look)
-    #   ++out.write
+    #   out->data[out->write] = LSB(Look)
+    #   ++out->write
     #   Look = get-char(in)
     #
     # registers:
@@ -303,7 +304,7 @@ test-get-num-reads-single-digit:
     # This test uses exit-descriptors. Use EBP for setting up local variables.
     55/push-EBP
     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-    # setup
+    # clear all streams
     # . clear-stream(_test-stream)
     # . . push args
     68/push  _test-stream/imm32
@@ -374,7 +375,7 @@ test-get-num-reads-single-digit:
     # registers except ESP may be clobbered at this point
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x10/imm32        # add to ESP
-    # check-ints-equal(*_test-output-stream.data, '3')
+    # check-ints-equal(*_test-output-stream->data, '3')
     # . . push args
     68/push  "F - test-get-num-reads-single-digit"/imm32
     68/push  0x33/imm32
@@ -394,7 +395,7 @@ test-get-num-aborts-on-non-digit-in-Look:
     # This test uses exit-descriptors. Use EBP for setting up local variables.
     55/push-EBP
     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-    # setup
+    # clear all streams
     # . clear-stream(_test-stream)
     # . . push args
     68/push  _test-stream/imm32
diff --git a/subx/apps/crenshaw2-1b.subx b/subx/apps/crenshaw2-1b.subx
index 1baf90c3..d6fc6dee 100644
--- a/subx/apps/crenshaw2-1b.subx
+++ b/subx/apps/crenshaw2-1b.subx
@@ -201,11 +201,11 @@ get-num:  # in : (address buffered-file), out : (address stream), err : fd or (a
     # pseudocode:
     #   if !is-digit?(Look) expected(ed, err, "integer")
     #   do
-    #     if out.write >= out.length
+    #     if out->write >= out->length
     #       write(err, "Error: too many digits in number\n")
     #       stop(ed, 1)
-    #     out.data[out.write] = LSB(Look)
-    #     ++out.write
+    #     out->data[out->write] = LSB(Look)
+    #     ++out->write
     #     Look = get-char(in)
     #   while is-digit?(Look)
     # This is complicated because I don't want to hard-code the error strategy in
@@ -392,7 +392,7 @@ test-get-num-reads-single-digit:
     # registers except ESP may be clobbered at this point
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x10/imm32        # add to ESP
-    # check-ints-equal(*_test-output-stream.data, '3')
+    # check-ints-equal(*_test-output-stream->data, '3')
     # . . push args
     68/push  "F - test-get-num-reads-single-digit"/imm32
     68/push  0x33/imm32
@@ -568,7 +568,7 @@ test-get-num-reads-multiple-digits:
     # registers except ESP may be clobbered at this point
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x10/imm32        # add to ESP
-    # check-ints-equal(*_test-output-stream.data, '3456')
+    # check-ints-equal(*_test-output-stream->data, '3456')
     # . . push args
     68/push  "F - test-get-num-reads-multiple-digits"/imm32
     68/push  0x36353433/imm32
@@ -659,7 +659,7 @@ test-get-num-reads-multiple-digits-followed-by-nondigit:
     # registers except ESP may be clobbered at this point
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x10/imm32        # add to ESP
-    # check-ints-equal(*_test-output-stream.data, '3456')
+    # check-ints-equal(*_test-output-stream->data, '3456')
     # . . push args
     68/push  "F - test-get-num-reads-multiple-digits-followed-by-nondigit"/imm32
     68/push  0x36353433/imm32