mirror of
https://github.com/hsoft/collapseos.git
synced 2025-01-12 13:48:05 +11:00
forth: make "(entry)" call WORD itself
Otherwise, when a defining word would be called outside a definition itself, it would get the name of the last parsed word, that is, itself! For example, dummy.fs, instead of creating a "_______" entry, created a "(entry)" entry...
This commit is contained in:
parent
5387e08437
commit
ca7c21d49f
@ -42,7 +42,7 @@
|
|||||||
; IMMEDIATE
|
; IMMEDIATE
|
||||||
|
|
||||||
: CREATE
|
: CREATE
|
||||||
WORD (entry) ( empty header with name )
|
(entry) ( empty header with name )
|
||||||
ROUTINE C [LITN] ( push cellWord addr )
|
ROUTINE C [LITN] ( push cellWord addr )
|
||||||
, ( write it )
|
, ( write it )
|
||||||
;
|
;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
( When building a compiled dict, always include this unit at
|
( When building a compiled dict, always include this unit at
|
||||||
the end of it so that Forth knows how to hook LATEST into
|
the end of it so that Forth knows how to hook LATEST into
|
||||||
it )
|
it )
|
||||||
WORD _______ (entry)
|
(entry) _______
|
||||||
|
|
||||||
( After each dummy word like this, we poke IO port 2 with our
|
( After each dummy word like this, we poke IO port 2 with our
|
||||||
current HERE value. The staging executable needs it to know
|
current HERE value. The staging executable needs it to know
|
||||||
|
@ -883,7 +883,6 @@ ENDDEF:
|
|||||||
.db 1 ; IMMEDIATE
|
.db 1 ; IMMEDIATE
|
||||||
DEFINE:
|
DEFINE:
|
||||||
.dw compiledWord
|
.dw compiledWord
|
||||||
.dw WORD
|
|
||||||
.dw ENTRYHEAD
|
.dw ENTRYHEAD
|
||||||
.dw NUMBER
|
.dw NUMBER
|
||||||
.dw compiledWord
|
.dw compiledWord
|
||||||
@ -1238,6 +1237,12 @@ PARSEI:
|
|||||||
.dw $-PARSE
|
.dw $-PARSE
|
||||||
.db 0
|
.db 0
|
||||||
ENTRYHEAD:
|
ENTRYHEAD:
|
||||||
|
.dw compiledWord
|
||||||
|
.dw WORD
|
||||||
|
.dw .private
|
||||||
|
.dw EXIT
|
||||||
|
|
||||||
|
.private:
|
||||||
.dw nativeWord
|
.dw nativeWord
|
||||||
pop hl
|
pop hl
|
||||||
ld de, (HERE)
|
ld de, (HERE)
|
||||||
@ -1272,7 +1277,6 @@ ENTRYHEAD:
|
|||||||
.db 0
|
.db 0
|
||||||
SYSV:
|
SYSV:
|
||||||
.dw compiledWord
|
.dw compiledWord
|
||||||
.dw WORD
|
|
||||||
.dw ENTRYHEAD
|
.dw ENTRYHEAD
|
||||||
.dw NUMBER
|
.dw NUMBER
|
||||||
.dw sysvarWord
|
.dw sysvarWord
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
: CODE
|
: CODE
|
||||||
( same as CREATE, but with ROUTINE V )
|
( same as CREATE, but with ROUTINE V )
|
||||||
WORD (entry)
|
(entry)
|
||||||
ROUTINE V [LITN] ,
|
ROUTINE V [LITN] ,
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user