commit 3109ca3bdd4f45fa03050dd8a4c147d3ffb91b99
parent be9ae6ea1b743c550ae8a07c1fa095b34994ce09
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Wed, 12 May 2021 23:51:34 +0100
Added keep mode parsing to asma
Diffstat:
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/projects/software/asma.usm b/projects/software/asma.usm
@@ -20,7 +20,7 @@
&filename
( "test.usm 00 )
- "projects/software/noodle.usm 00
+ "projects/demos/piano.usm 00
@asma-print-error ( -- )
;asma/error LDA2 .Console/string DEO2
@@ -207,6 +207,7 @@
%asma-SHORT-FLAG { #20 }
%asma-RETURN-FLAG { #40 }
+%asma-KEEP-FLAG { #80 }
@asma-parse-opcode ( -- byte 00 if valid opcode
OR 01 otherwise )
@@ -237,10 +238,14 @@
POP asma-SHORT-FLAG ORA ,&loop JMP
¬-two
- LIT 'r NEQ ,¬-return JCN
- asma-RETURN-FLAG ORA ,&loop JMP
+ DUP LIT 'r NEQ ,¬-return JCN
+ POP asma-RETURN-FLAG ORA ,&loop JMP
- ¬-return ( 00 byte / end* )
+ ¬-return
+ LIT 'k NEQ ,¬-keep JCN
+ asma-KEEP-FLAG ORA ,&loop JMP
+
+ ¬-keep ( 00 byte / end* )
¬-found ( incoming-ptr* / end* )
POP2r
&too-short ( token* / )