From 145fdd8e059f04217432b74d8d0301d174cc2de7 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 21 Mar 2020 16:27:21 -0400 Subject: [PATCH] forth: rename "LITS" to "LIT<" --- forth/core.fs | 2 +- forth/dictionary.txt | 3 ++- forth/forth.asm | 18 ++++++------------ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/forth/core.fs b/forth/core.fs index 252acb1..a2fc0cc 100644 --- a/forth/core.fs +++ b/forth/core.fs @@ -5,7 +5,7 @@ : BEGIN H ; IMMEDIATE : AGAIN COMPILE (bbr) H -^ C, ; IMMEDIATE : UNTIL COMPILE SKIP? COMPILE (bbr) H -^ C, ; IMMEDIATE -: ( BEGIN LITS ) WORD SCMP NOT UNTIL ; IMMEDIATE +: ( BEGIN LIT< ) WORD SCMP NOT UNTIL ; IMMEDIATE ( Hello, hello, krkrkrkr... do you hear me? Ah, voice at last! Some lines above need comments BTW: Forth lines limited to 64 cols because of default diff --git a/forth/dictionary.txt b/forth/dictionary.txt index 700e06b..a403d2c 100644 --- a/forth/dictionary.txt +++ b/forth/dictionary.txt @@ -143,7 +143,8 @@ CMP n1 n2 -- n Compare n1 and n2 and set n to -1, 0, or 1. NOT f -- f Push the logical opposite of f *** Strings *** -LITS x -- a Read following LIT and push its addr to a +LIT< x -- Read following word and write to HERE as a string + literal. SCMP a1 a2 -- n Compare strings a1 and a2. See CMP SLEN a -- n Push length of str at a. diff --git a/forth/forth.asm b/forth/forth.asm index 6fb5a87..fd86931 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -988,25 +988,19 @@ LITN: ld (HERE), hl jp next - .db "LITS" + .db "LIT<" .fill 3 .dw LITN .db 1 ; IMMEDIATE -LITS: +LITRD: .dw compiledWord - .dw .wrLIT + .dw NUMBER + .dw LIT + .dw WR .dw WORD .dw .scpy .dw EXIT -.wrLIT: - .dw nativeWord - ld hl, (HERE) - ld de, LIT - call DEinHL - ld (HERE), hl - jp next - .scpy: .dw nativeWord pop hl @@ -1018,7 +1012,7 @@ LITS: .db "(find)" .fill 1 - .dw LITS + .dw LITRD .db 0 FIND_: .dw nativeWord