Mark Wills
2011-05-12 15:22:46 UTC
In my system, the PFA of a word is in the cell immediately following
the CFA, as one would expect.
However, for words built with DOES> the PFA is at CFA + 2 cells:
: THING CREATE DOES> @ ;
THING FRED
FRED will look like this:
FRED GOTO xxx yyy
Where xxx is the address of the word following DOES> in the parent.
The *address* of yyy will be pushed to the stack at runtime.
As you can see, this effectively means the PFA of DOES> words is at
'CFA+2 cells.
Is this an issue? Or, can I do:
: >PFA >CFA 1 CELLS + ;
: >BODY >CFA 2 CELLS + ;
Thanks
Mark
the CFA, as one would expect.
However, for words built with DOES> the PFA is at CFA + 2 cells:
: THING CREATE DOES> @ ;
THING FRED
FRED will look like this:
FRED GOTO xxx yyy
Where xxx is the address of the word following DOES> in the parent.
The *address* of yyy will be pushed to the stack at runtime.
As you can see, this effectively means the PFA of DOES> words is at
'CFA+2 cells.
Is this an issue? Or, can I do:
: >PFA >CFA 1 CELLS + ;
: >BODY >CFA 2 CELLS + ;
Thanks
Mark