forth: Forth-ify "IMMED?"

This commit is contained in:
Virgil Dupras 2020-03-27 21:58:24 -04:00
parent 8f990ff954
commit 408d93bd23
4 changed files with 15 additions and 19 deletions

Binary file not shown.

View File

@ -781,27 +781,11 @@ DOES:
jp EXIT+2
.fill 23
.db "IMMED?"
.dw $-DOES
.db 6
ISIMMED:
.dw nativeWord
pop hl
call chkPS
dec hl
ld de, 0
bit FLAG_IMMED, (hl)
jr z, .notset
inc de
.notset:
push de
jp next
.fill 51
; ( n -- )
.db "LITN"
.dw $-ISIMMED
.dw $-DOES
.db 4
LITN:
.dw nativeWord

View File

@ -113,7 +113,7 @@
WORD
(find)
( is word )
IF DUP IMMED? IF EXECUTE ELSE , THEN
IF DUP _c IMMED? IF EXECUTE ELSE , THEN
( maybe number )
ELSE (parse*) @ EXECUTE LITN THEN
AGAIN

View File

@ -233,3 +233,15 @@ CODE IMMEDIATE
HL DECss,
7 (HL) SETbr,
;CODE
CODE IMMED?
HL POPqq,
chkPS,
HL DECss,
DE 0 LDddnn,
7 (HL) BITbr,
3 JRZe, ( notset )
DE INCss,
( notset )
DE PUSHqq,
;CODE