Re: Separated headers
- From: mark4 <i440r@xxxxxxxxxxxx>
- Date: Mon, 21 Apr 2008 19:54:54 -0700 (PDT)
On Apr 21, 3:48 am, "Maki" <veselic...@xxxxxxxx> 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- @ ; 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!
.
- Follow-Ups:
- Re: Separated headers
- From: m_l_g3
- Re: Separated headers
- From: Maki
- Re: Separated headers
- References:
- Separated headers
- From: Maki
- Separated headers
- Prev by Date: comp.lang.forth charter
- Next by Date: Re: Separated headers
- Previous by thread: Re: Separated headers
- Next by thread: Re: Separated headers
- Index(es):
Relevant Pages
|