commit 97f0001d189e7a4d65182e9f85f801ea2e2a66f3
parent 937eeaf9644e79c69f4d975c0f2025070f137fba
Author: Christian Ermann <christianermann@gmail.com>
Date:   Sat, 15 Jun 2024 21:08:02 -0400
Add '(' and '\'
Diffstat:
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/forth.asm b/forth.asm
@@ -402,7 +402,6 @@ _WORD:
 ; After a non-whitespace character is found, RDI is used to hold the address
 ; of the next character to be stored.
 ;
-    
     call _KEY
     cmp al, ' '
     je .skip_whitespace
@@ -410,7 +409,6 @@ _WORD:
     je .skip_whitespace
     cmp al, 0xD
     je .skip_whitespace
-
     mov rdi, .buffer
 
 .store_char:
@@ -446,6 +444,7 @@ _WORD:
     ret
 
 
+
 defcode "FIND", 4, 0, FIND
 ; Find a word in the dictionary.
 ;
@@ -1146,6 +1145,29 @@ defcode "WORDS", 5, 0, WORDS
 .end:
     NEXT
 
+defcode "\", 1, 0, SLASH
+.skip_comment:
+    call _KEY
+    cmp al, 0xA
+    je .end
+    cmp al, 0xD
+    je .end
+    jmp .skip_comment
+.end:
+    NEXT
+
+defcode "(", 1, 0, LEFT_PAREN
+.skip_comment:
+    call _KEY
+    cmp al, 0xA
+    je .end
+    cmp al, 0xD
+    je .end
+    cmp al, ')'
+    je .end
+    jmp .skip_comment
+.end:
+    NEXT
 
 section '.data' data readable writable