diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-07-03 18:27:01 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-07-03 18:27:01 -0700 |
commit | c95648c96093ce0d44c21191bab0ee2c9b04becc (patch) | |
tree | eb58e435a158100b99e152199b193acc53df4ab3 /310copy-bytes.subx | |
parent | 7ced4e44ddb6e15152eb8bcef9dda68aba53710b (diff) | |
download | mu-c95648c96093ce0d44c21191bab0ee2c9b04becc.tar.gz |
reading from streams
The Mu shell has no string literals, only streams. No random access, only sequential access. But I've been playing fast and loose with its read pointer until now. Hopefully things are cleaned up now.
Diffstat (limited to '310copy-bytes.subx')
-rw-r--r-- | 310copy-bytes.subx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/310copy-bytes.subx b/310copy-bytes.subx index 2586a53f..64b8148a 100644 --- a/310copy-bytes.subx +++ b/310copy-bytes.subx @@ -102,6 +102,8 @@ test-stream-to-array: (write _test-input-stream "abc") # skip something (read-byte _test-input-stream) # => eax + 8b/-> *$_test-input-stream->read 0/r32/eax + (check-ints-equal %eax 1 "F - test-stream-to-array/pre") # var out/ecx: (handle array byte) 68/push 0/imm32 68/push 0/imm32 @@ -109,7 +111,9 @@ test-stream-to-array: # (stream-to-array _test-input-stream %ecx) (lookup *ecx *(ecx+4)) # => eax - (check-strings-equal %eax "bc") + (check-strings-equal %eax "bc" "F - test-stream-to-array") + 8b/-> *$_test-input-stream->read 0/r32/eax + (check-ints-equal %eax 1 "F - test-stream-to-array/read-pointer-not-perturbed") # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp |