Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: quick review of References: NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:27998 On Tue, 21 Jan 2014 17:07:54 -0500, Elizabeth D. Rather wrote: > On 1/21/14 10:18 AM, Rod Pemberton wrote: >> Sorry, yes, that should've had two colons which was, hopefully, obvious: >>: : CREATE :NONAME DROP ... > > CREATE is inappropriate here. You want your word that builds a header. > And :NONAME is also inappropriate because it returns the xt that youhave > to DROP. All you need to do is build the header, have a code > field that points to DOCOL, and start the compiler. I must've run into a problem somewhere. It appears I backed out (CREATE) and these definitions: : : (CREATE) COMPILE ENTER ] SMUDGE ; : CREATE (CREATE) COMPILE DOVAR ; I also had this definition for ; in another file paired with the definition of : above: : ; COMPILE EXIT SMUDGE [COMPILE] [ ; IMMEDIATE It appears that (CREATE) when I backed it out is very similar to the operations I have for :NONAME plus the BL WORD COUNT .. CMOVE for name field in my : definition. >> I have a low-level : and this would be for defining a new >> high-level : in Forth. > > Why do you need 2 versions of : ? > I was attempting to eliminate the as much code in C as I could. The idea was minimize as much non-standard behavior as possible by having as little of the code in C as is possible. If I can express : in high-level Forth, I may be able to eliminate the bootstrap version of : in C. > There is nothing about a :NONAME to link. > I have to link "around" it. I.e., the pointer used for linking could be incorrect without a header for :NONAME. Of course, it could be correct also. I don't know right now. It gets updated somewhere automatically. I don't recall where I put that... Sigh, I really needed to review my code before discussing. > Yes, the thing built by :NONAME has a code field, normally > (in an ITC Forth) the address of DODOES, followed by the > executable content. > > [...] > > An xt needs to be the address of the code required to execute the word. > It has to be there for all words. That isn't what I'm calling the > "header". A "header" consists of name and linking info. > Ah, the CFA is not part of the header... So, words still have a CFA without the header. Sigh, I should've realized that. The low-level "primitives" - because they're in C - have NFA, LFA, DOES field, etc which can be placed after the CFA and PFA by the C compiler. The high-level Forth is compiled sequentially. Okay, that should mean the :NONAME definitions don't need a header. It's still compiling an CFA, the ENTER. > Hope this helps. > Yes. Thanks. I'm thinking what you said earlier should work. Rod Pemberton