about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--127next-word.subx49
-rwxr-xr-xapps/assortbin44508 -> 44674 bytes
-rwxr-xr-xapps/bracesbin46371 -> 46537 bytes
-rwxr-xr-xapps/callsbin51018 -> 51184 bytes
-rwxr-xr-xapps/crenshaw2-1bin43849 -> 44015 bytes
-rwxr-xr-xapps/crenshaw2-1bbin44396 -> 44562 bytes
-rwxr-xr-xapps/dquotesbin48130 -> 48296 bytes
-rwxr-xr-xapps/factorialbin42952 -> 43118 bytes
-rwxr-xr-xapps/hexbin46688 -> 46854 bytes
-rwxr-xr-xapps/mubin390379 -> 390545 bytes
-rwxr-xr-xapps/packbin57087 -> 57253 bytes
-rwxr-xr-xapps/sigilsbin58740 -> 58906 bytes
-rwxr-xr-xapps/surveybin54440 -> 54606 bytes
-rwxr-xr-xapps/testsbin43299 -> 43465 bytes
14 files changed, 49 insertions, 0 deletions
diff --git a/127next-word.subx b/127next-word.subx
index 6a186656..6705437f 100644
--- a/127next-word.subx
+++ b/127next-word.subx
@@ -249,3 +249,52 @@ test-next-word-returns-empty-string-on-eof:
     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
     5d/pop-to-ebp
     c3/return
+
+test-next-word-returns-empty-string-on-newline:
+    # . prologue
+    55/push-ebp
+    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
+    # setup
+    # . clear-stream(_test-stream)
+    # . . push args
+    68/push  _test-stream/imm32
+    # . . call
+    e8/call  clear-stream/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
+    # var slice/ecx: slice
+    68/push  0/imm32/end
+    68/push  0/imm32/start
+    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
+    # write some whitespace and a newline
+    # . . push args
+    68/push  "  \n"/imm32
+    68/push  _test-stream/imm32
+    # . . call
+    e8/call  write/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+    # next-word(_test-stream, slice)
+    # . . push args
+    51/push-ecx
+    68/push  _test-stream/imm32
+    # . . call
+    e8/call  next-word/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+    # check-ints-equal(slice->end - slice->start, 0, msg)
+    # . . push args
+    68/push  "F - test-next-word-returns-empty-string-on-newline"/imm32
+    68/push  0/imm32
+    # . . push slice->end - slice->start
+    8b/copy                         1/mod/*+disp8   1/rm32/ecx    .           .             .           0/r32/eax   4/disp8         .                 # copy *(ecx+4) to eax
+    2b/subtract                     0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # subtract *ecx from eax
+    50/push-eax
+    # . . call
+    e8/call  check-ints-equal/disp32
+    # . . discard args
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
+    # . epilogue
+    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
+    5d/pop-to-ebp
+    c3/return
diff --git a/apps/assort b/apps/assort
index 91acd903..eaf99cc4 100755
--- a/apps/assort
+++ b/apps/assort
Binary files differdiff --git a/apps/braces b/apps/braces
index 04c119a4..47d5695b 100755
--- a/apps/braces
+++ b/apps/braces
Binary files differdiff --git a/apps/calls b/apps/calls
index fcf9fa3e..131b31fe 100755
--- a/apps/calls
+++ b/apps/calls
Binary files differdiff --git a/apps/crenshaw2-1 b/apps/crenshaw2-1
index b47821fc..80927e73 100755
--- a/apps/crenshaw2-1
+++ b/apps/crenshaw2-1
Binary files differdiff --git a/apps/crenshaw2-1b b/apps/crenshaw2-1b
index 59603ae2..17c7945f 100755
--- a/apps/crenshaw2-1b
+++ b/apps/crenshaw2-1b
Binary files differdiff --git a/apps/dquotes b/apps/dquotes
index fe2b9da5..a39d796f 100755
--- a/apps/dquotes
+++ b/apps/dquotes
Binary files differdiff --git a/apps/factorial b/apps/factorial
index 424b6a84..bdb55aaa 100755
--- a/apps/factorial
+++ b/apps/factorial
Binary files differdiff --git a/apps/hex b/apps/hex
index 5087ab7d..144ada1a 100755
--- a/apps/hex
+++ b/apps/hex
Binary files differdiff --git a/apps/mu b/apps/mu
index c2e1d535..1e8f07bf 100755
--- a/apps/mu
+++ b/apps/mu
Binary files differdiff --git a/apps/pack b/apps/pack
index ebae4f3a..381f8784 100755
--- a/apps/pack
+++ b/apps/pack
Binary files differdiff --git a/apps/sigils b/apps/sigils
index 087caf38..00181c37 100755
--- a/apps/sigils
+++ b/apps/sigils
Binary files differdiff --git a/apps/survey b/apps/survey
index 76cadf48..11709e1e 100755
--- a/apps/survey
+++ b/apps/survey
Binary files differdiff --git a/apps/tests b/apps/tests
index 8c013997..3652e6a3 100755
--- a/apps/tests
+++ b/apps/tests
Binary files differ