Browse Source

forth: Forth-ify "IMMED?"

pull/95/head
Virgil Dupras 4 years ago
parent
commit
408d93bd23
4 changed files with 15 additions and 19 deletions
  1. BIN
      emul/forth/z80c.bin
  2. +2
    -18
      forth/forth.asm
  3. +1
    -1
      forth/icore.fs
  4. +12
    -0
      forth/z80c.fs

BIN
emul/forth/z80c.bin View File


+ 2
- 18
forth/forth.asm 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


+ 1
- 1
forth/icore.fs 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


+ 12
- 0
forth/z80c.fs 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

Loading…
Cancel
Save