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

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

View File

@ -988,41 +988,9 @@ SCPY:
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)"
.fill 1
.dw LITRD
.dw SCPY
.db 0
FIND_:
.dw nativeWord