Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #8212

Re: dot-quote implementation question

From "Rod Pemberton" <do_not_have@noavailemail.cmm>
Newsgroups comp.lang.forth
Subject Re: dot-quote implementation question
Date 2011-12-19 05:26 -0500
Organization Aioe.org NNTP Server
Message-ID <jcn3cl$3c4$1@speranza.aioe.org> (permalink)
References (5 earlier) <b1b9cfa4-29dd-431d-9d52-9f8ac4d59ebd@v6g2000yqv.googlegroups.com> <jc7oeq$76d$1@speranza.aioe.org> <36148df9-ee6c-43b3-bf46-d0123bd1f593@d17g2000yql.googlegroups.com> <jcknkl$3s3$1@speranza.aioe.org> <1970f26a-92f9-48b8-b4f6-9267c0e780eb@n39g2000yqh.googlegroups.com>

Show all headers | View raw


"BruceMcF" <agila61@netscape.net> wrote in message
news:1970f26a-92f9-48b8-b4f6-9267c0e780eb@n39g2000yqh.googlegroups.com...
> On Dec 18, 7:53 am, "Rod Pemberton" <do_not_h...@noavailemail.cmm>
> wrote:
...

> > It's in C not assembly, so I can't put "raw" jump-to addresses
> > into the CFA. If it were in assembly, the CFA could be set to any
> > address where a valid assembly routine exists.  I.e., for assembly
> > that works that way, the CFA can be set to the exact starting point
> > of the after-DOES> code.  It just jumps there using the CFA value.
> [...]
> > Since mine is in C, the CFA must point to a valid C routine.
> > I can't place a C routine inlined with the after-DOES> code and
> > call that routine. I don't have a built-in C compiler in my Forth
> > interpreter. So, I can't create address values at runtime for the
> > CFA. All CFA values must be known at compile time. This means I
> > have a limited and fixed set of legitimate CFA values, unlike an
> > assembly implementation which could have a huge number of them.
>
> But since you have a bound set of CFA routines, instead of storing
> their address in the CFA, you can store their addresses in a short
> table and point to an index of their addresses in the CFA, as int.
>
> Then the inner interpreter executes out of the CFA routine table for
> CFA values under, say, 255, and knows that its a DOES> address if the
> CFA value is bigger than 16. So you've got an implicitly bit threaded
> CFA on something like:
>    (cfa && !0FFh)

Yes, would work.  But, I'd prefer not to do it that way.  I did something
similar with just 0 as a trap value.

> As long as you have LAST then you don't need a smudge ~ just don't
> link into the dictionary at ":", but instead use ";" to link into the
> dictionary using LAST. You'll need a LAST>LFA word or sequence like
> your LAST>CFA sequence, and that'll be set.

Currently, CREATE calls (CREATE) prior to COMPILE DOVAR.
(CREATE) sets the link and other fields.

> > The sequence "LAST @ CFA !" stores DODOES into the CFA
> > overwriting a DOVAR put there via CREATE. The sequence "R> ,"
> > stores the address of the after-DOES> code in the PFA.
>
> You can't do that.

I'm currently doing that ...  So, why can't I?

> You need to make your CFA two int's long, leave one
> alone when you create it, and make the PFA start the
> second cell after the CFA starts.

Why do I need the extra cell?

> In short, you are recreating the <BUILDS ... DOES> behavior, but if
> you have that behavior, then DOES> *cannot pair with CREATE anymore*,
> not unless CREATE has an empty slot waiting for the address, so that
> approach is quite definitely non-compliant without the padding of the
> CREATE structure.

What do you mean by DOES> cannot pair with CREATE?

Also, do you mean when compiling a definition or interpreting interative
input?  If interpreting interactive input, is DOES> allowed to be used
outside a definition?  fig-Forth indicates DOES> is compile only:

"A word which defines the run-time action within a high-level
defining word. ..."

So far, I'm recreating the fig-Forth behavior for CREATE ... DOES> or so I
think but not exactly ...  Is that the same as the <BUILDS ... DOES>
behavior?  fig-Forth has both CREATE and <BUILDS .  I haven't implemented
fig-Forth like <BUILDS and have no plans to do so.  I did do CREATE and
DOES> based on fig-Forth.

> Its either creating a two-int structure at the point of the CFA and
> the PFA for CREATED words at an offset of two ints, or else some form
> of encoding in the entry in the CFA field. You can't do what you are
> doing now and have a Forth94 compliant system.

Ok.  Well, it's nowhere near Forth94 yet.


Rod Pemberton


Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-10 05:28 -0500
  Re: dot-quote implementation question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-12-10 12:00 +0000
    Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-10 06:52 -0800
    Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-10 21:10 -0500
      Re: dot-quote implementation question "A. K." <akk@nospam.org> - 2011-12-11 08:59 +0100
      Re: dot-quote implementation question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-12-11 03:40 -0600
        Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-12 05:04 -0500
          Re: dot-quote implementation question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-12-12 04:56 -0600
            Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-13 10:08 -0500
          Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-12 07:42 -0800
            Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-13 09:47 -0500
              Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-17 04:57 -0500
                Re: dot-quote implementation question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-12-17 04:20 -0600
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-18 07:18 -0500
                Re: dot-quote implementation question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-12-18 06:30 -0600
                Re: dot-quote implementation question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-12-20 03:04 -0600
              Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-17 08:15 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-18 07:53 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-18 09:14 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-19 05:24 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-19 09:11 -0800
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-19 10:53 -0800
                Re: dot-quote implementation question "Elizabeth D. Rather" <erather@forth.com> - 2011-12-19 08:38 -1000
                Re: dot-quote implementation question "A. K." <akk@nospam.org> - 2011-12-19 21:34 +0100
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-19 12:51 -0800
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-18 10:16 -0800
                Re: dot-quote implementation question "Elizabeth D. Rather" <erather@forth.com> - 2011-12-18 08:18 -1000
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-19 05:25 -0500
                Re: dot-quote implementation question Coos Haak <chforth@hccnet.nl> - 2011-12-19 22:23 +0100
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-20 10:53 -0500
                Re: dot-quote implementation question Coos Haak <chforth@hccnet.nl> - 2011-12-20 19:58 +0100
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-20 11:44 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-21 16:16 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-20 11:50 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-21 14:56 -0500
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-21 21:49 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-18 14:33 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-19 05:26 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-19 09:38 -0800
                Re: dot-quote implementation question "Elizabeth D. Rather" <erather@forth.com> - 2011-12-19 08:49 -1000
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-19 13:04 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-20 10:57 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-20 12:23 -0800
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-20 14:27 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-21 16:14 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-21 14:53 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-21 21:48 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-21 22:02 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-29 03:39 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-29 12:37 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-30 13:31 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-30 11:12 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-31 05:52 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-31 11:33 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-31 20:10 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-31 19:12 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-01-04 05:13 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2012-01-04 12:49 -0800
                Re: dot-quote implementation question Coos Haak <chforth@hccnet.nl> - 2011-12-22 00:55 +0100
                Re: dot-quote implementation question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-12-20 21:43 +0000
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-19 13:25 -0800
                Re: dot-quote implementation question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-12-20 03:00 -0600
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-20 04:40 -0800
                Re: dot-quote implementation question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-12-20 21:55 +0000
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-20 14:33 -0800
                Re: dot-quote implementation question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-12-22 20:33 +0000
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-22 13:32 -0800
                Re: dot-quote implementation question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-12-21 03:01 -0600
                Re: dot-quote implementation question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-12-22 20:38 +0000
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-20 10:53 -0500
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-20 10:49 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-20 08:20 -0800
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-20 04:49 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-20 10:58 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-21 08:41 -0800
                Re: dot-quote implementation question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-12-21 16:14 -0500
                Re: dot-quote implementation question BruceMcF <agila61@netscape.net> - 2011-12-21 15:14 -0800
      Strings (was: dot-quote implementation question) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-12-11 10:33 +0000
        Re: Strings (was: dot-quote implementation question) kenney@cix.compulink.co.uk - 2011-12-12 02:53 -0600

csiph-web