forth: Forth-ify "LIT", "LITS", "LIT<"

This commit is contained in:
Virgil Dupras 2020-03-22 11:56:40 -04:00
parent 54fd5fbb2b
commit 46833f3819
2 changed files with 5 additions and 34 deletions

View File

@ -1,5 +1,9 @@
: H HERE @ ; : H HERE @ ;
: -^ SWAP - ; : -^ SWAP - ;
: [LITN] LITN ; IMMEDIATE
: LIT ROUTINE S [LITN] , ;
: LITS LIT SCPY ;
: LIT< WORD LITS ; IMMEDIATE
: COMPILE ' LITN ['] , , ; IMMEDIATE : COMPILE ' LITN ['] , , ; IMMEDIATE
: [COMPILE] ' , ; IMMEDIATE : [COMPILE] ' , ; IMMEDIATE
: BEGIN H ; IMMEDIATE : BEGIN H ; IMMEDIATE
@ -37,7 +41,6 @@
H 1 - ( push a. -1 for allot offset ) H 1 - ( push a. -1 for allot offset )
; IMMEDIATE ; IMMEDIATE
: [LITN] LITN ; IMMEDIATE
: CREATE : CREATE
WORD (entry) ( empty header with name ) WORD (entry) ( empty header with name )
ROUTINE C [LITN] ( push cellWord addr ) ROUTINE C [LITN] ( push cellWord addr )

View File

@ -988,41 +988,9 @@ SCPY:
jp next jp next
.db "LIT"
.fill 4
.dw SCPY
.db 0
LIT_:
.dw compiledWord
.dw NUMBER
.dw LIT
.dw WR
.dw EXIT
.db "LITS"
.fill 3
.dw LIT_
.db 0
LITS:
.dw compiledWord
.dw LIT_
.dw SCPY
.dw EXIT
.db "LIT<"
.fill 3
.dw LITS
.db 1 ; IMMEDIATE
LITRD:
.dw compiledWord
.dw WORD
.dw LITS
.dw EXIT
.db "(find)" .db "(find)"
.fill 1 .fill 1
.dw LITRD .dw SCPY
.db 0 .db 0
FIND_: FIND_:
.dw nativeWord .dw nativeWord