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


Groups > comp.lang.forth > #9257

Re: bug report Bernd Paysan's bigForth v231 v240

From "Rod Pemberton" <do_not_have@noavailemail.cmm>
Newsgroups comp.lang.forth
Subject Re: bug report Bernd Paysan's bigForth v231 v240
Date 2012-01-27 20:21 -0500
Organization Aioe.org NNTP Server
Message-ID <jfvim7$hsl$1@speranza.aioe.org> (permalink)
References <jfneqd$dfi$1@speranza.aioe.org> <66478a3e-d8f8-4aed-a36b-2e61806f6a21@cf6g2000vbb.googlegroups.com> <jfp955$87t$1@speranza.aioe.org> <692e810d-4789-456d-8b63-829cd518232c@do4g2000vbb.googlegroups.com>

Show all headers | View raw


"Mark Wills" <markrobertwills@yahoo.co.uk> wrote in message
news:692e810d-4789-456d-8b63-829cd518232c@do4g2000vbb.googlegroups.com...
...

> So, it seems, with bigForth, that it's using HERE for something,

Yes.

> and it's tripping you up,

No.

> because you didn't compile a value into the body
> of the word you created

True.

The space is not allocated from Forth's perspective.  It's present though.
So, it was allocated for use, just not in the Forth sense.  From Forth's
perspective, it still could be allocated at a later time though, e.g.,
ALLOT.

Whether one should or shouldn't use space that is not allocated from Forth's
perspective is apparently open to debate.  I've not noticed anything in the
spec's on it, although I haven't fully read them ...

> as was expected.

uh ...


fig-Forth copies parsing data to HERE.  It's part of WORD.That should
overwrite what's at HERE when unallocated.  I couldn't get the test to work
on actual fig-Forths.  CREATE <name> was accepted, but the CREATE-ed word
couldn't be found ...  I based my parsing on fig-Forth code.  It seems
bigForth is doing the same.

FYI, it turns out it's an easy fix.

Instead of copying every word parsed by ENCLOSE via CMOVE to HERE, you leave
the parsed words in your parsing buffer which is TIB in my case.  The code
only copies the name to the name field when CREATE is executed, instead of
copying the parsed token every time WORD is executed.  I had to change
FIND and CREATE and WORD  You probably won't need to change FIND.

Fixing "the issue" has a few advantages too.

Copying every parsed word in the input stream to HERE slowed down my
interpreter.  bigForth seems so slow ...  Now, it only copies when CREATE
creates a name field.  Copying the parsed stream to HERE also implies the
name field is at the start of the dictionary.  I.e., an additional copy is
needed if the name field isn't at the start and you are copying all parsed
to HERE.  When not copying all parsed data to HERE, you still need a copy
but you eliminate the unecessary copies to HERE.

> Did you try the code I posted earlier?
>

No, I didn't.  I will since you brought it up again.

> CREATE FRED
> : TEST 1 2 3 ;
> FRED
> error: FRED not found

There's no error on mine ...  At the moment, it passively does nothing for
unfound words.  That's on the TO DO list.  I have to ' TICK <name> DUMP to
see if the word is correctly built.  DUMP is customized C code which
displays the dictionary header and a fixed bunch of cells, e.g., first
portion of the body or PF area, as hex.

But, from what you said in the other posts, I think you may have meant TEST.
You were probably thinking of something like this:

CREATE FRED
: TEST 1 2 3 ;
4 FRED !
TEST

The store to FRED should've overwritten the first part of the dictionary
structure for TEST.  If your name field is first, the name field will be
corrupted, i.e., it shouldn't find TEST.  The now fixed version of my
interpreter "blows up" since the link field is first.

> This is because, what gets compiled, is this:
>
>                      BODY
> -----+---------+----+------+-------+-----+---+-----+---+------+
> FRED | DO_PUSH | 0* | TEST | LIT 1 | LIT | 2 | LIT | 3 | EXIT |
> -----+---------+----+------+-------+-----+---+-----+---+------+
>   ^--------------------+
>
> So, the *body* of FRED actually has a part of the definition
> of TEST in it.

My interpreter does the following.  I recently removed DOVAR  That's been
replaced with an ENTER VAR sequence for now.  I've not fixed my DOES> with
an additional field in the header yet either ...  FRED returns the address
of TEST.

                BODY
-----+---------+-----+------+-------+-----+---+-----+---+------+
FRED | ENTER   | VAR | TEST | LIT 1 | LIT | 2 | LIT | 3 | EXIT |
-----+---------+-----+------+-------+-----+---+-----+---+------+
   ^--------------------+

> [snip]
>
> Does that make sense?

Yes.

I don't have an issue understanding what is happening.  I found and brought
up the issue.

> * The zero is normally compiled just in case a CREATEd word is
> subsequently modified by DOES> - it reserves space for an address if
> required. If a CREATEd word is modified by DOES> then the DO_PUSH
> (which just pushes the address of the body of the created word) is
> replace with DO_DOES and the 0 in front of it is replaced with the
> address of the code just after DOES> in the parent word.

It's on the TO DO list ...  I have to make sure it doesn't break my
structure addressing words.


Rod Pemberton


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


Thread

bug report Bernd Paysan's bigForth v231 v240 "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-01-24 18:26 -0500
  Re: bug report Bernd Paysan's bigForth v231 v240 Brad <hwfwguy@gmail.com> - 2012-01-24 16:06 -0800
    Re: bug report Bernd Paysan's bigForth v231 v240 David Kuehling <dvdkhlng@gmx.de> - 2012-01-25 11:03 +0100
    Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-25 04:31 -0800
      Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-25 08:00 -1000
        Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-25 10:04 -0800
  Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-24 14:06 -1000
    Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-25 04:40 -0800
      Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-25 04:42 -0800
      Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-25 08:02 -1000
      Re: bug report Bernd Paysan's bigForth v231 v240 Coos Haak <chforth@hccnet.nl> - 2012-01-25 19:45 +0100
    Re: bug report Bernd Paysan's bigForth v231 v240 "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-01-25 11:00 -0500
      Re: bug report Bernd Paysan's bigForth v231 v240 Coos Haak <chforth@hccnet.nl> - 2012-01-25 19:40 +0100
        Re: bug report Bernd Paysan's bigForth v231 v240 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-01-26 15:37 +0000
          Re: bug report Bernd Paysan's bigForth v231 v240 Coos Haak <chforth@hccnet.nl> - 2012-01-26 22:53 +0100
      Re: bug report Bernd Paysan's bigForth v231 v240 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-01-25 17:50 +0000
  Re: bug report Bernd Paysan's bigForth v231 v240 "Peter Knaggs" <pjk@bcs.org.uk> - 2012-01-25 00:27 +0000
  Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-25 04:29 -0800
    Re: bug report Bernd Paysan's bigForth v231 v240 "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-01-25 11:01 -0500
      Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-25 07:51 -1000
  Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-25 04:43 -0800
    Re: bug report Bernd Paysan's bigForth v231 v240 "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-01-25 11:02 -0500
      Re: bug report Bernd Paysan's bigForth v231 v240 Doug Hoffman <glidedog@gmail.com> - 2012-01-25 11:27 -0500
      Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-25 08:38 -0800
        Re: bug report Bernd Paysan's bigForth v231 v240 Arnold Doray <invalid@invalid.com> - 2012-01-26 00:54 +0000
          Re: bug report Bernd Paysan's bigForth v231 v240 Coos Haak <chforth@hccnet.nl> - 2012-01-26 22:58 +0100
            Re: bug report Bernd Paysan's bigForth v231 v240 Arnold Doray <invalid@invalid.com> - 2012-01-27 04:15 +0000
              Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-27 02:29 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-27 02:44 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 Arnold Doray <invalid@invalid.com> - 2012-01-27 14:38 +0000
                Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-27 08:06 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-27 08:08 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 Arnold Doray <invalid@invalid.com> - 2012-01-27 15:30 +0000
                Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-27 08:06 -1000
        Re: bug report Bernd Paysan's bigForth v231 v240 "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-01-27 20:21 -0500
          Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-27 16:19 -1000
            Re: bug report Bernd Paysan's bigForth v231 v240 "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-01-28 14:18 -0500
              Re: bug report Bernd Paysan's bigForth v231 v240 Alex McDonald <blog@rivadpm.com> - 2012-01-28 12:30 -0800
              Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-28 13:42 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 Brad <hwfwguy@gmail.com> - 2012-01-28 17:37 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-29 00:31 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-29 07:19 -1000
                Re: bug report Bernd Paysan's bigForth v231 v240 BruceMcF <agila61@netscape.net> - 2012-01-29 15:36 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-30 03:46 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-12 18:01 -0500
              Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-28 13:38 -1000
              Re: bug report Bernd Paysan's bigForth v231 v240 BruceMcF <agila61@netscape.net> - 2012-01-28 19:58 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 kenney@cix.compulink.co.uk - 2012-01-29 05:04 -0600
                Re: bug report Bernd Paysan's bigForth v231 v240 John Passaniti <john.passaniti@gmail.com> - 2012-01-29 10:58 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 BruceMcF <agila61@netscape.net> - 2012-01-29 16:04 -0800
              Re: bug report Bernd Paysan's bigForth v231 v240 Arnold Doray <invalid@invalid.com> - 2012-01-29 09:18 +0000
                Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-29 07:23 -1000
            Re: bug report Bernd Paysan's bigForth v231 v240 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-01-30 14:20 +0000
              Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-30 06:51 -0800
                Re: bug report Bernd Paysan's bigForth v231 v240 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-01-30 15:08 +0000
              Re: bug report Bernd Paysan's bigForth v231 v240 Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-01-30 09:10 -0600
          Re: bug report Bernd Paysan's bigForth v231 v240 BruceMcF <agila61@netscape.net> - 2012-01-27 19:02 -0800
          Re: bug report Bernd Paysan's bigForth v231 v240 Brad <hwfwguy@gmail.com> - 2012-01-28 09:32 -0800
      Re: bug report Bernd Paysan's bigForth v231 v240 Mark Wills <markrobertwills@yahoo.co.uk> - 2012-01-25 08:42 -0800
      Re: bug report Bernd Paysan's bigForth v231 v240 BruceMcF <agila61@netscape.net> - 2012-01-25 09:33 -0800
      Re: bug report Bernd Paysan's bigForth v231 v240 "Elizabeth D. Rather" <erather@forth.com> - 2012-01-25 07:55 -1000
      Re: bug report Bernd Paysan's bigForth v231 v240 Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-01-25 22:17 +0000
  Re: bug report Bernd Paysan's bigForth v231 v240 BruceMcF <agila61@netscape.net> - 2012-01-25 07:30 -0800
  Re: bug report Bernd Paysan's bigForth v231 v240 Bernd Paysan <bernd.paysan@gmx.de> - 2012-02-07 17:12 +0100

csiph-web