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


Groups > comp.lang.forth > #8534

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-31 20:10 -0500
Organization Aioe.org NNTP Server
Message-ID <jdobmr$4rm$1@speranza.aioe.org> (permalink)
References (12 earlier) <dd825268-f575-4665-ba8d-bd6297b89455@z12g2000yqm.googlegroups.com> <jdkvtq$r0f$1@speranza.aioe.org> <724b7ee6-9199-4566-b504-c8b90203cd4d@d8g2000yqk.googlegroups.com> <jdmpe1$kcb$1@speranza.aioe.org> <a9e89231-b066-43ef-be72-2f0fe439a526@n39g2000yqh.googlegroups.com>

Show all headers | View raw


"BruceMcF" <agila61@netscape.net> wrote in message
news:a9e89231-b066-43ef-be72-2f0fe439a526@n39g2000yqh.googlegroups.com...
> On Dec 31, 5:52 am, "Rod Pemberton" <do_not_h...@noavailemail.cmm>
> wrote:
> > <dictionary header>
> > CFA: DOVAR
> > comma'd constant
> > .string ... ; ( non-standard format )
> > DODOES
> > DOES> address
> > EXIT
>
> > Yes, if DOVAR continues execution after the constant, that would
> > require a branch or 'DOSTR' to skip over ALLOT'd space ...
>
> Over and above the massive wasted space you are adding to CREATEd
> segments that have a DOES> applied just to avoid padding all CREATEd
> words by one cell ...

Yeah, that too ...

> ... while building the body in standard Forth code, the data space is
> *contiguous* ~ unbroken.

Yes.

> CFA: DOVAR
>      .word ... ; comma'd constant
>      ; **1 ?
>      .word nextitem
>      ; **2 ?
>      .byte $4,"item
>      ; **3 ?
> [...]
> Now matter how much you squirm, the DODOES cannot be placed
> at point "**2" above without violating contiguity of the body. So its
> got to either be at point **1 or at point **3.
> [...]
> So it has to be at **1.

It seems that it is quite complicated to store a DOES> address in the PF
region.  I.e., a variable location leads to inability to locate it, a fixed
location will overwrite data or code address or vice-versa, allowing
execution to continue until it finds it will work for code definitions but
not data definitions which will have to be jumped over, etc.  The apparent
difficulties in implementing DOES> would imply to me that DOES> is really
not a good fit with the way a Forth interpreter works ...  I don't believe
that other Forth words have such issues, do they?  Well, I can't store the
DOES> address in the CFA.  I'm 100% positive that'll fail.  So, I may have
no choice but to add a extra field for it.  Once I do that, that field will
be named PFA instead of the code or data part of a word.  So, what is the
code or data part usually named?

> Yes, there are issues: you are breaking the actual use of CREATE
> for actual code, while flailing around with trying to do the basics the
> hard way around.

I'm just exploring the options ...

If I hadn't realized the my DOES> only worked for CONSTANT and VARIABLE, I
wouldn't be going through this.  It was hard enough to find info on how they
worked the first time, and to get them to work for CONSTANT and VARIABLE.  I
couldn't even dump definitions as hex values back then ...

The one solution is elegant for a code definition, IMO.  I hadn't considered
a data definition.  That could be lack of Forth experience, or it could be I
didn't come across the iimplementation problem via execution of some other
word since I'm not done implementing ...  ;-)   E.g., I haven't implemented
." dot-quote, etc., where I would be storing a block of data in a word.
E.g., I know another use of CREATE fails due to an overwrite of my input
buffer.  I just haven't found and fixed it yet.

Thanks.


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