From 3109ca3bdd4f45fa03050dd8a4c147d3ffb91b99 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Wed, 12 May 2021 23:51:34 +0100 Subject: [PATCH] Added keep mode parsing to asma --- projects/software/asma.usm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/projects/software/asma.usm b/projects/software/asma.usm index ef11ea7..21404fd 100644 --- 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* / )