From 3330291c4535fac457076b6b1a70650db988466d Mon Sep 17 00:00:00 2001 From: Alexandre Dumont Date: Sun, 14 Nov 2021 12:10:33 +0100 Subject: [PATCH] Forth: Add shortcuts for : and ; in FIND --- forth.s | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/forth.s b/forth.s index a5bb593..a4adc65 100644 --- a/forth.s +++ b/forth.s @@ -888,6 +888,31 @@ defword "FIND",, STA W LDA LATEST+1 STA W+1 + +; shortcuts in FIND for ":" and ";" + LDA 2,X + CMP #1 + BNE @nxt_word +; 1 char word. here we test if the word is ":" + LDA (G2) + CMP #':' + BNE @not_colon + ; word is ":"!! + LDA #h_FCOLON + STA 5,X + JMP do_DROP +@not_colon: + CMP #';' + BNE @not_semi + ; word is ";"!! + LDA #h_SEMICOLON + STA 5,X + JMP do_DROP +@not_semi: @nxt_word: ; store W+2 in G1 (G1 points to the counted str) CLC