summaryrefslogtreecommitdiff
path: root/04b/in03
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-01-06 14:02:30 -0500
committerpommicket <pommicket@gmail.com>2022-01-06 14:02:30 -0500
commitdb552a4dcacc5d82f00e595be4ca3faae75a3ddb (patch)
tree330a8e413fea115662dd9ad3d54e64ba81046eaf /04b/in03
parent8c6b19fdd3a8bca886692056b8f4942b889323c9 (diff)
string
Diffstat (limited to '04b/in03')
-rw-r--r--04b/in0331
1 files changed, 31 insertions, 0 deletions
diff --git a/04b/in03 b/04b/in03
index b07874d..66bc3a6 100644
--- a/04b/in03
+++ b/04b/in03
@@ -140,6 +140,13 @@ call :string=
D=A
?D!0:handle_byte
+I=:line
+J=:"string"
+C=x20
+call :string=
+D=A
+?D!0:handle_string
+
; set delimiter to newline
C=xa
@@ -227,6 +234,27 @@ align
:byte
reserve d1
+:handle_string
+ I=:line
+ ; 7 = length of "string "
+ I+=d7
+ J=I
+ ; find end of string
+ :string_loop
+ C=1J
+ D=xa
+ ?C=D:string_loop_end
+ J+=d1
+ !:string_loop
+ :string_loop_end
+ ; get length of string
+ D=J
+ D-=I
+ ; output fd
+ J=d4
+ syscall x1
+ !:read_line
+
:handle_call
J=I
; just use the rvalue function call code
@@ -1586,6 +1614,9 @@ align
:"byte"
str byte
x20
+:"string"
+ str string
+ x20
:"function"
str function
xa