by mark4 <i440r@[EMAIL PROTECTED]
>
Apr 21, 2008 at 07:54 PM
On Apr 21, 3:48 am, "Maki" <veselic...@[EMAIL PROTECTED]
> wrote:
> I have recently cross-compiled my first forth system (subroutine
threads),
> and now I want to separate headers from code. Current header arrangement
> looks like this:
> [link][flags][count][name] code
> I guess I need one more pointer in the header like this:
> [link][flags][count][name][code_ptr] which will connect header to
> definition.
>
> Questions:
>
> 1. What is the best way to handle allocation in name dictionary? My
current
> thought is to revector dp with words like:
> PROGRAM HERE ( returns dp from program code dictionary)
> NAMES HERE ( returns dp from name dictionary)
>
> 2. Implementation of word >name is trickier. It appears that >name now
> should use FIND to go back to name field.
>
> Are there any other pitfalls that I should pay attention to when doing
this?
> Any advices an comments appreciated.
> Best regards,
> M.
>
> --
> M.Veselic
> Sigma Lab.
you dont need to use find to locate a word header when you separate
headers from code space, isforth does this and >name is basically
defined as : >name 4- @[EMAIL PROTECTED]
; because i store an NFA pointer at CFA -4.
the trick is when you do headerless words this pointer has to be
cleared or it will point to bogus data!