Browse code

Added keep mode parsing to asma

Andrew Alderwick authored on 12/05/2021 22:51:34
Showing 1 changed files
... ...
@@ -20,7 +20,7 @@
20 20
 
21 21
 	&filename
22 22
 		( "test.usm 00 )
23
-		"projects/software/noodle.usm 00
23
+		"projects/demos/piano.usm 00
24 24
 
25 25
 @asma-print-error ( -- )
26 26
 	;asma/error LDA2 .Console/string DEO2
... ...
@@ -207,6 +207,7 @@
207 207
 
208 208
 %asma-SHORT-FLAG { #20 }
209 209
 %asma-RETURN-FLAG { #40 }
210
+%asma-KEEP-FLAG { #80 }
210 211
 
211 212
 @asma-parse-opcode ( -- byte 00 if valid opcode
212 213
                      OR 01 otherwise )
... ...
@@ -237,10 +238,14 @@
237 238
 	POP asma-SHORT-FLAG ORA ,&loop JMP
238 239
 
239 240
 	&not-two
240
-	LIT 'r NEQ ,&not-return JCN
241
-	asma-RETURN-FLAG ORA ,&loop JMP
241
+	DUP LIT 'r NEQ ,&not-return JCN
242
+	POP asma-RETURN-FLAG ORA ,&loop JMP
242 243
 
243
-	&not-return ( 00 byte / end* )
244
+	&not-return
245
+	LIT 'k NEQ ,&not-keep JCN
246
+	asma-KEEP-FLAG ORA ,&loop JMP
247
+
248
+	&not-keep ( 00 byte / end* )
244 249
 	&not-found ( incoming-ptr* / end* )
245 250
 	POP2r
246 251
 	&too-short ( token* / )