forth: Forth-ify "IMMEDIATE"

This commit is contained in:
Virgil Dupras 2020-03-27 21:36:05 -04:00
parent 41cd8086d4
commit 8f990ff954
4 changed files with 9 additions and 11 deletions

Binary file not shown.

View File

@ -781,19 +781,10 @@ DOES:
jp EXIT+2 jp EXIT+2
.db "IMMEDIATE" .fill 23
.dw $-DOES
.db 9
IMMEDIATE:
.dw nativeWord
ld hl, (CURRENT)
dec hl
set FLAG_IMMED, (hl)
jp next
.db "IMMED?" .db "IMMED?"
.dw $-IMMEDIATE .dw $-DOES
.db 6 .db 6
ISIMMED: ISIMMED:
.dw nativeWord .dw nativeWord

View File

@ -79,6 +79,7 @@
0xc5 OP1qq PUSHqq, 0xc5 OP1qq PUSHqq,
0xc1 OP1qq POPqq, 0xc1 OP1qq POPqq,
0x03 OP1qq INCss, 0x03 OP1qq INCss,
0x0b OP1qq DECss,
0x09 OP1qq ADDHLss, 0x09 OP1qq ADDHLss,
: _1rr : _1rr

View File

@ -227,3 +227,9 @@ CODE R>
JTBL 12 + CALLnn, JTBL 12 + CALLnn,
HL PUSHqq, HL PUSHqq,
;CODE ;CODE
CODE IMMEDIATE
CURRENT LDHL(nn),
HL DECss,
7 (HL) SETbr,
;CODE