1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-25 17:18:06 +11:00

forth: rename "LITS" to "LIT<"

This commit is contained in:
Virgil Dupras 2020-03-21 16:27:21 -04:00
parent 4627e1c977
commit 145fdd8e05
3 changed files with 9 additions and 14 deletions

View File

@ -5,7 +5,7 @@
: BEGIN H ; IMMEDIATE : BEGIN H ; IMMEDIATE
: AGAIN COMPILE (bbr) H -^ C, ; IMMEDIATE : AGAIN COMPILE (bbr) H -^ C, ; IMMEDIATE
: UNTIL COMPILE SKIP? 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? ( Hello, hello, krkrkrkr... do you hear me?
Ah, voice at last! Some lines above need comments Ah, voice at last! Some lines above need comments
BTW: Forth lines limited to 64 cols because of default BTW: Forth lines limited to 64 cols because of default

View File

@ -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 NOT f -- f Push the logical opposite of f
*** Strings *** *** 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 SCMP a1 a2 -- n Compare strings a1 and a2. See CMP
SLEN a -- n Push length of str at a. SLEN a -- n Push length of str at a.

View File

@ -988,25 +988,19 @@ LITN:
ld (HERE), hl ld (HERE), hl
jp next jp next
.db "LITS" .db "LIT<"
.fill 3 .fill 3
.dw LITN .dw LITN
.db 1 ; IMMEDIATE .db 1 ; IMMEDIATE
LITS: LITRD:
.dw compiledWord .dw compiledWord
.dw .wrLIT .dw NUMBER
.dw LIT
.dw WR
.dw WORD .dw WORD
.dw .scpy .dw .scpy
.dw EXIT .dw EXIT
.wrLIT:
.dw nativeWord
ld hl, (HERE)
ld de, LIT
call DEinHL
ld (HERE), hl
jp next
.scpy: .scpy:
.dw nativeWord .dw nativeWord
pop hl pop hl
@ -1018,7 +1012,7 @@ LITS:
.db "(find)" .db "(find)"
.fill 1 .fill 1
.dw LITS .dw LITRD
.db 0 .db 0
FIND_: FIND_:
.dw nativeWord .dw nativeWord