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


Groups > comp.lang.forth > #19784 > unrolled thread

Can i (easily) implement cell+ and cells in an Forth83 - like dialect

Started bycybercow222@gmail.com
First post2013-02-18 04:57 -0800
Last post2013-02-24 13:33 -0800
Articles 19 on this page of 59 — 16 participants

Back to article view | Back to comp.lang.forth


Contents

  Can i (easily) implement cell+ and cells in an Forth83 - like dialect cybercow222@gmail.com - 2013-02-18 04:57 -0800
    Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-18 14:17 +0100
      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-18 14:18 +0100
        Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect stephenXXX@mpeforth.com (Stephen Pelc) - 2013-02-18 21:57 +0000
          Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-19 00:10 +0100
            Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-19 00:15 +0100
              Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2013-02-18 18:39 -0500
                Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect "Elizabeth D. Rather" <erather@forth.com> - 2013-02-18 22:04 -1000
                  Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-19 08:39 +0000
                    Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-19 13:21 +0100
                      Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect stephenXXX@mpeforth.com (Stephen Pelc) - 2013-02-19 13:12 +0000
                        Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-19 14:29 +0100
                          Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-19 14:54 +0100
                            Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect stephenXXX@mpeforth.com (Stephen Pelc) - 2013-02-19 16:25 +0000
                              Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-19 18:29 +0100
                                Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-19 19:16 +0100
                                  Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Mark Wills <forthfreak@gmail.com> - 2013-02-20 01:07 -0800
                                    Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-20 12:36 +0100
                                      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Lars Brinkhoff <lars.spam@nocrew.org> - 2013-02-20 20:15 +0100
                                        Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-20 20:31 +0100
                                      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2013-02-20 16:08 -0500
                                  Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect stephenXXX@mpeforth.com (Stephen Pelc) - 2013-02-20 10:06 +0000
                                    Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-20 12:32 +0100
                                      Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-02-20 06:55 -0600
                                        Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-20 14:03 +0100
                                          Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-02-20 07:48 -0600
                                          Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-20 15:30 +0000
                            Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2013-02-19 18:08 -0500
                      Re: Can i (easily) implement cell+ and cells in an Forth83 - like   dialect anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-19 16:55 +0000
                        Re: Can i (easily) implement cell+ and cells in an Forth83 - like   dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-19 18:42 +0100
                      Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2013-02-19 18:08 -0500
                        Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-20 00:20 +0100
                          Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2013-02-20 16:08 -0500
      Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-18 13:38 +0000
        Re: Can i (easily) implement cell+ and cells in an Forth83 - like  dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-18 15:39 +0100
          Re: Can i (easily) implement cell+ and cells in an Forth83 - like   dialect anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-18 14:50 +0000
            Re: Can i (easily) implement cell+ and cells in an Forth83 - like   dialect "Elizabeth D. Rather" <erather@forth.com> - 2013-02-18 08:56 -1000
      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Mark Wills <forthfreak@gmail.com> - 2013-02-18 06:38 -0800
    Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect cybercow222@gmail.com - 2013-02-18 06:00 -0800
      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2013-02-18 15:01 +0100
        Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Mark Wills <forthfreak@gmail.com> - 2013-02-18 06:40 -0800
        Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect awegel@arcor.de (Alex Wegel) - 2013-02-21 10:42 +0100
          Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-02-21 12:19 +0000
            Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-21 14:08 +0000
              Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-21 15:56 +0100
                Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Coos Haak <chforth@hccnet.nl> - 2013-02-21 16:31 +0100
      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect "Elizabeth D. Rather" <erather@forth.com> - 2013-02-18 11:26 -1000
    Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect cybercow222@gmail.com - 2013-02-20 04:39 -0800
      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-20 13:59 +0100
      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-20 15:35 +0000
        Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Mark Wills <markrobertwills@yahoo.co.uk> - 2013-02-20 08:21 -0800
          Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Coos Haak <chforth@hccnet.nl> - 2013-02-21 01:06 +0100
            Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Mark Wills <markrobertwills@yahoo.co.uk> - 2013-02-20 23:04 -0800
          Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect awegel@arcor.de (Alex Wegel) - 2013-02-21 10:42 +0100
    Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect "Clyde W. Phillips Jr." <cwpjr02@gmail.com> - 2013-02-23 15:14 -0800
      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Paul Rubin <no.email@nospam.invalid> - 2013-02-23 15:33 -0800
      Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Coos Haak <chforth@hccnet.nl> - 2013-02-24 00:46 +0100
        Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect Coos Haak <chforth@hccnet.nl> - 2013-02-24 01:00 +0100
          Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect "Clyde W. Phillips Jr." <cwpjr02@gmail.com> - 2013-02-24 13:33 -0800

Page 3 of 3 — ← Prev page 1 2 [3]


#19793

FromMark Wills <forthfreak@gmail.com>
Date2013-02-18 06:40 -0800
Message-ID<2f582c7a-c493-4362-87d3-46d1e2c9d073@fw24g2000vbb.googlegroups.com>
In reply to#19789
On Feb 18, 2:01 pm, Matthias Koch <matthias.k...@hot.uni-hannover.de>
wrote:
> > Is there any particular command i must run to check if i have 4 bytes cell size ?
>
> hex -1 u.
>
> This gives a cell with all bits set on two complement systems - so you can count how many bits your particular implementation is wide.
>
> Matthias

Neat.

I was thinking:

HERE 0 , HERE SWAP - .

That should give you an answer of 2. In other words, a single cell is
two bytes.

For the pedants, we'll assume the OPs hardware has an 8-bit byte ;-)

[toc] | [prev] | [next] | [standalone]


#19868

Fromawegel@arcor.de (Alex Wegel)
Date2013-02-21 10:42 +0100
Message-ID<1kyn1ba.nu13lg12suahsN%awegel@arcor.de>
In reply to#19789
Matthias Koch <matthias.koch@hot.uni-hannover.de> wrote:

> > Is there any particular command i must run to check if
> > i have 4 bytes cell size ?
> 
> hex -1 u.
> 
> This gives a cell with all bits set on two complement systems - so
> you can count how many bits your particular implementation is wide.

Following this route (ie. to use forths number conversion):

: bits/cell ( --n) base @ 2 base ! 0 invert 0 <# #s #> nip swap base ! ;

...this code can also be used without a definition (in contrast to a
solution containing a loop):

base @ 2 base !
0 invert 0 <# #s #> constant bits/cell
drop base !

[toc] | [prev] | [next] | [standalone]


#19871

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2013-02-21 12:19 +0000
Message-ID<512610e3$0$26880$e4fe514c@dreader37.news.xs4all.nl>
In reply to#19868
In article <1kyn1ba.nu13lg12suahsN%awegel@arcor.de>,
Alex Wegel <awegel@arcor.de> wrote:
>Matthias Koch <matthias.koch@hot.uni-hannover.de> wrote:
>
>> > Is there any particular command i must run to check if
>> > i have 4 bytes cell size ?
>>
>> hex -1 u.
>>
>> This gives a cell with all bits set on two complement systems - so
>> you can count how many bits your particular implementation is wide.
>
>Following this route (ie. to use forths number conversion):
>
>: bits/cell ( --n) base @ 2 base ! 0 invert 0 <# #s #> nip swap base ! ;
>
>...this code can also be used without a definition (in contrast to a
>solution containing a loop):
>
>base @ 2 base !
>0 invert 0 <# #s #> constant bits/cell
>drop base !

At least it is half decent, but Chuck Moore would say
4 CONSTANT CELL and get it over with.

>


Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#19875

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2013-02-21 14:08 +0000
Message-ID<2013Feb21.150854@mips.complang.tuwien.ac.at>
In reply to#19871
albert@spenarnc.xs4all.nl (Albert van der Horst) writes:
>In article <1kyn1ba.nu13lg12suahsN%awegel@arcor.de>,
>Alex Wegel <awegel@arcor.de> wrote:
>>base @ 2 base !
>>0 invert 0 <# #s #> constant bits/cell
>>drop base !

Pretty cool.

>At least it is half decent, but Chuck Moore would say
>4 CONSTANT CELL and get it over with.

I doubt that he would define CELL or BITS/CELL (has any of his Forths
had any of these words?).  And if he did, he would write

1 constant cell
18 constant bits/cell

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2013: http://www.euroforth.org/ef13/

[toc] | [prev] | [next] | [standalone]


#19876

FromZbiggy <zbigniew2011REMOVE@gmail.REMOVE.com>
Date2013-02-21 15:56 +0100
Message-ID<slrnkich02.b1u.zbigniew2011REMOVE@Tichy.myhome.org>
In reply to#19875
In comp.lang.forth, Anton Ertl wrote:

> 1 constant cell
> 18 constant bits/cell

Not "16"?
-- 
It's us, the scobs.

[toc] | [prev] | [next] | [standalone]


#19877

FromCoos Haak <chforth@hccnet.nl>
Date2013-02-21 16:31 +0100
Message-ID<7w7dtig8le24.14pnodkzyhmyf$.dlg@40tude.net>
In reply to#19876
Op 21 Feb 2013 15:56:17 +0100 schreef Zbiggy:

> In comp.lang.forth, Anton Ertl wrote:
> 
>> 1 constant cell
>> 18 constant bits/cell
> 
> Not "16"?

No, http://www.greenarraychips.com/

-- 
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html 

[toc] | [prev] | [next] | [standalone]


#19803

From"Elizabeth D. Rather" <erather@forth.com>
Date2013-02-18 11:26 -1000
Message-ID<K5CdncfXD8TrAb_MnZ2dnUVZ_rKdnZ2d@supernews.com>
In reply to#19788
On 2/18/13 4:00 AM, cybercow222@gmail.com wrote:
> Thank You all for quick responses!
>
> I wouldn't imagine that the Forth community is so alive :)
> Is there any particular command i must run to check if i have 4 bytes cell size ?
> In the manual i found a statement which says that the integers are 32 bit (long type in C) for 32 bit system. Which indeed it is, i compiled the interpreter as 32bit target (-m32),  (is written in C).

In which case you have a system that is similar to Forth83, but not 
fully conforming. There may be other ways in which it does not conform.

Forth83 was extremely specific about many implementation details. The 
major philosophical difference between Forth83 and ANS Forth (Forth94) 
is that the latter took the approach of defining semantics (behavior) 
rather than implementation. As a result, there are not only Standard 
32-bit and 64-bit systems, there are also sophisticated optimizing 
compilers and other significant under-the-hood improvements in Standard 
Systems.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#19841

Fromcybercow222@gmail.com
Date2013-02-20 04:39 -0800
Message-ID<1cbc034f-2d3c-43fc-b434-16649c2a4c38@googlegroups.com>
In reply to#19784
Uh doh :) It does have HERE, thank you guys! the cell constant with the solution:

here 0 , here swap - constant cell 
: cell+ cell + ; 
: cells cell * 

gives 4 as a result :) And that surely will help in my experimenting sessions, thank you again.

Unfortunately, from the example link i posted, just later i realised that is so much gForth tied, so i can't do much with ooforth.fs extension, i miss words like CMOVE and LASTXT, and i'm not so brave either with Forth or C to implement it myself, possibly will find my road to it.

Best regards

[toc] | [prev] | [next] | [standalone]


#19843

FromZbiggy <zbigniew2011REMOVE@gmail.REMOVE.com>
Date2013-02-20 13:59 +0100
Message-ID<slrnki9loa.cpr.zbigniew2011REMOVE@Tichy.myhome.org>
In reply to#19841
In comp.lang.forth, cybercow222@gmail.com wrote:

> Unfortunately, from the example link i posted, just later i realised that
> is so much gForth tied,

From what I see, _it is_ Gforth...

> so i can't do much with ooforth.fs extension,

...yes, with someone's "library" of OO-related words.

> i miss words like CMOVE and LASTXT, and i'm not so brave either with Forth
> or C to implement it myself, possibly will find my road to it.

But what's the problem? Just install Gforth, then "include ooforth.fs", and
everything's prepared.
-- 
It's us, the scobs.

[toc] | [prev] | [next] | [standalone]


#19847

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2013-02-20 15:35 +0000
Message-ID<2013Feb20.163526@mips.complang.tuwien.ac.at>
In reply to#19841
cybercow222@gmail.com writes:
>Uh doh :) It does have HERE, thank you guys! the cell constant with the sol=
>ution:
>
>here 0 , here swap - constant cell=20
>: cell+ cell + ;=20
>: cells cell *=20
>
>gives 4 as a result :) And that surely will help in my experimenting sessio=
>ns, thank you again.
>
>Unfortunately, from the example link i posted, just later i realised that i=
>s so much gForth tied, so i can't do much with ooforth.fs extension, i miss=
> words like CMOVE and LASTXT, and i'm not so brave either with Forth or C t=
>o implement it myself, possibly will find my road to it.

CMOVE is a standard word and is straightforward to implement.  LASTXT
is not, but you should be able to build something with carnal
knowledge of the Forth system; if you have the source code of Forth
system, looking at IMMEDIATE or DOES> might provide some inspiration.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2013: http://www.euroforth.org/ef13/

[toc] | [prev] | [next] | [standalone]


#19848

FromMark Wills <markrobertwills@yahoo.co.uk>
Date2013-02-20 08:21 -0800
Message-ID<83fce08d-f196-458c-ba88-3ea9856af605@e11g2000vbv.googlegroups.com>
In reply to#19847
On Feb 20, 3:35 pm, an...@mips.complang.tuwien.ac.at (Anton Ertl)
wrote:
> cybercow...@gmail.com writes:
> >Uh doh :) It does have HERE, thank you guys! the cell constant with the sol=
> >ution:
>
> >here 0 , here swap - constant cell=20
> >: cell+ cell + ;=20
> >: cells cell *=20
>
> >gives 4 as a result :) And that surely will help in my experimenting sessio=
> >ns, thank you again.
>
> >Unfortunately, from the example link i posted, just later i realised that i=
> >s so much gForth tied, so i can't do much with ooforth.fs extension, i miss=
> > words like CMOVE and LASTXT, and i'm not so brave either with Forth or C t=
> >o implement it myself, possibly will find my road to it.
>
> CMOVE is a standard word and is straightforward to implement.  LASTXT
> is not, but you should be able to build something with carnal
> knowledge of the Forth system; if you have the source code of Forth
> system, looking at IMMEDIATE or DOES> might provide some inspiration.
>
> - anton
> --
> M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
> comp.lang.forth FAQs:http://www.complang.tuwien.ac.at/forth/faq/toc.html
>      New standard:http://www.forth200x.org/forth200x.html
>    EuroForth 2013:http://www.euroforth.org/ef13/

You might be able to re-define ; to get at the latest XT.

In my system it would be something like (un-tested):

variable latestxt
: ; [compile] ; latest @ >cfa lastestxt ! ; immediate

Latest points at the head of the dictionary entry in my system, hence
>CFA.

[toc] | [prev] | [next] | [standalone]


#19859

FromCoos Haak <chforth@hccnet.nl>
Date2013-02-21 01:06 +0100
Message-ID<1l1z1bp4or8kg.mqt7tpavpwwf$.dlg@40tude.net>
In reply to#19848
Op Wed, 20 Feb 2013 08:21:24 -0800 (PST) schreef Mark Wills:

> On Feb 20, 3:35 pm, an...@mips.complang.tuwien.ac.at (Anton Ertl)
> wrote:
>> cybercow...@gmail.com writes:
>>>Uh doh :) It does have HERE, thank you guys! the cell constant with the sol=
>>>ution:
>>
>>>here 0 , here swap - constant cell=20
>>>: cell+ cell + ;=20
>>>: cells cell *=20
>>
>>>gives 4 as a result :) And that surely will help in my experimenting sessio=
>>>ns, thank you again.
>>
>>>Unfortunately, from the example link i posted, just later i realised that i=
>>>s so much gForth tied, so i can't do much with ooforth.fs extension, i miss=
>>> words like CMOVE and LASTXT, and i'm not so brave either with Forth or C t=
>>>o implement it myself, possibly will find my road to it.
>>
>> CMOVE is a standard word and is straightforward to implement.  LASTXT
>> is not, but you should be able to build something with carnal
>> knowledge of the Forth system; if you have the source code of Forth
>> system, looking at IMMEDIATE or DOES> might provide some inspiration.
>>
>> - anton
>> --
>> M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
>> comp.lang.forth FAQs:http://www.complang.tuwien.ac.at/forth/faq/toc.html
>>      New standard:http://www.forth200x.org/forth200x.html
>>    EuroForth 2013:http://www.euroforth.org/ef13/
> 
> You might be able to re-define ; to get at the latest XT.
> 
> In my system it would be something like (un-tested):
> 
> variable latestxt
>: ; [compile] ; latest @ >cfa lastestxt ! ; immediate
> 
> Latest points at the head of the dictionary entry in my system, hence
>>CFA.

It might be better to set the value of latestxt by : and :noname
That way implementation of e.g. RECURSE is simple.

-- 
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html 

[toc] | [prev] | [next] | [standalone]


#19860

FromMark Wills <markrobertwills@yahoo.co.uk>
Date2013-02-20 23:04 -0800
Message-ID<9605fc88-fde9-4f5a-a28d-ced9b91a619b@j9g2000vbz.googlegroups.com>
In reply to#19859
On Feb 21, 12:06 am, Coos Haak <chfo...@hccnet.nl> wrote:
> Op Wed, 20 Feb 2013 08:21:24 -0800 (PST) schreef Mark Wills:
>
>
>
>
>
> > On Feb 20, 3:35 pm, an...@mips.complang.tuwien.ac.at (Anton Ertl)
> > wrote:
> >> cybercow...@gmail.com writes:
> >>>Uh doh :) It does have HERE, thank you guys! the cell constant with the sol=
> >>>ution:
>
> >>>here 0 , here swap - constant cell=20
> >>>: cell+ cell + ;=20
> >>>: cells cell *=20
>
> >>>gives 4 as a result :) And that surely will help in my experimenting sessio=
> >>>ns, thank you again.
>
> >>>Unfortunately, from the example link i posted, just later i realised that i=
> >>>s so much gForth tied, so i can't do much with ooforth.fs extension, i miss=
> >>> words like CMOVE and LASTXT, and i'm not so brave either with Forth or C t=
> >>>o implement it myself, possibly will find my road to it.
>
> >> CMOVE is a standard word and is straightforward to implement. LASTXT
> >> is not, but you should be able to build something with carnal
> >> knowledge of the Forth system; if you have the source code of Forth
> >> system, looking at IMMEDIATE or DOES> might provide some inspiration.
>
> >> - anton
> >> --
> >> M. Anton Ertlhttp://www.complang.tuwien.ac.at/anton/home.html
> >> comp.lang.forth FAQs:http://www.complang.tuwien.ac.at/forth/faq/toc.html
> >> New standard:http://www.forth200x.org/forth200x.html
> >> EuroForth 2013:http://www.euroforth.org/ef13/
>
> > You might be able to re-define ; to get at the latest XT.
>
> > In my system it would be something like (un-tested):
>
> > variable latestxt
> >: ; [compile] ; latest @ >cfa lastestxt ! ; immediate
>
> > Latest points at the head of the dictionary entry in my system, hence
> >>CFA.
>
> It might be better to set the value of latestxt by : and :noname
> That way implementation of e.g. RECURSE is simple.
>
> --
> Coos
>
> CHForth, 16 bit DOS applicationshttp://home.hccnet.nl/j.j.haak/forth.html- Hide quoted text -
>
> - Show quoted text -

Good point!

[toc] | [prev] | [next] | [standalone]


#19867

Fromawegel@arcor.de (Alex Wegel)
Date2013-02-21 10:42 +0100
Message-ID<1kyn175.u9hr4018wyc06N%awegel@arcor.de>
In reply to#19848
Mark Wills <markrobertwills@yahoo.co.uk> wrote:

> 
> You might be able to re-define ; to get at the latest XT.
> 
> In my system it would be something like (un-tested):
> 
> variable latestxt
> : ; [compile] ; latest @ >cfa lastestxt ! ; immediate
> 
> Latest points at the head of the dictionary entry in my system, hence
> >CFA.

Why not just use

: latestxt latest @ >cfa ; 

and call it when you actually need the xt?

[toc] | [prev] | [next] | [standalone]


#19966

From"Clyde W. Phillips Jr." <cwpjr02@gmail.com>
Date2013-02-23 15:14 -0800
Message-ID<61ce9955-56b2-40e0-82f8-025667ec0146@googlegroups.com>
In reply to#19784
On Monday, February 18, 2013 6:57:15 AM UTC-6, Supercyber Cow wrote:
> Hi all, i'm currently doing some simple Forth experimentation on an simple Forth dialect (threaded) that more or less conforms to Froth-83 and came across this page: http://onestepback.org/articles/poly/gp-forth.html which explains how to make simple class / object alike pragma in forth. I really would like to do this example training, but my Forth doesn't have cell+ and cells words. Is there any kind of work-around i can do to get this sample running ?
> 
> 
> 
> Thank you in advance!

After reading the simple and the sophisticated attempts at solving this issue I wonder if the stack universally represents 'cell' size on a given FORTH system? If so do all FORTH systems support sp@? If so would:

sp@ 1 sp@ swap drop - u. 

work ?

[toc] | [prev] | [next] | [standalone]


#19968

FromPaul Rubin <no.email@nospam.invalid>
Date2013-02-23 15:33 -0800
Message-ID<7xobfad2ri.fsf@ruckus.brouhaha.com>
In reply to#19966
"Clyde W. Phillips Jr." <cwpjr02@gmail.com> writes:
> sp@ 1 sp@ swap drop - u. 

sp@ doesn't seem to be in ANS, which makes sense as ANS Forth is
supposed to be ok for actual stack hardware.

Your word is implementation dependent even with sp@ and reasonable
assumptions about stack layout, because you don't necessarily know if
the stack grows upwards or downwards.  I think

   sp@ sp@ - abs .

might be ok most of the time though.

[toc] | [prev] | [next] | [standalone]


#19971

FromCoos Haak <chforth@hccnet.nl>
Date2013-02-24 00:46 +0100
Message-ID<1cu9dpd4gipsg.mho9c8grei8a$.dlg@40tude.net>
In reply to#19966
Op Sat, 23 Feb 2013 15:14:13 -0800 (PST) schreef Clyde W. Phillips Jr.:

> On Monday, February 18, 2013 6:57:15 AM UTC-6, Supercyber Cow wrote:
>> Hi all, i'm currently doing some simple Forth experimentation on an simple Forth dialect (threaded) that more or less conforms to Froth-83 and came across this page: http://onestepback.org/articles/poly/gp-forth.html which explains how to make simple class / object alike pragma in forth. I really would like to do this example training, but my Forth doesn't have cell+ and cells words. Is there any kind of work-around i can do to get this sample running ?
>> 
>> 
>> 
>> Thank you in advance!
> 
> After reading the simple and the sophisticated attempts at solving this issue I wonder if the stack universally represents 'cell' size on a given FORTH system? If so do all FORTH systems support sp@? If so would:
> 
> sp@ 1 sp@ swap drop - u. 
> 
> work ?

The standard prescribes all items have cell width.
The word sp@ does not appear in the standard, except in the appendix for
CATCH and THROW.
What does your '1' do?
sp@ sp@ nip - .
In my implementation 'dsp@ dsp@ nip - .' displays 2. Same as '1 cells .'

-- 
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html 

[toc] | [prev] | [next] | [standalone]


#19973

FromCoos Haak <chforth@hccnet.nl>
Date2013-02-24 01:00 +0100
Message-ID<ugbxitb0wq74.6p9ikefkuxwe.dlg@40tude.net>
In reply to#19971
Op Sun, 24 Feb 2013 00:46:45 +0100 schreef Coos Haak:

> Op Sat, 23 Feb 2013 15:14:13 -0800 (PST) schreef Clyde W. Phillips Jr.:
> 
>> On Monday, February 18, 2013 6:57:15 AM UTC-6, Supercyber Cow wrote:
>>> Hi all, i'm currently doing some simple Forth experimentation on an simple Forth dialect (threaded) that more or less conforms to Froth-83 and came across this page: http://onestepback.org/articles/poly/gp-forth.html which explains how to make simple class / object alike pragma in forth. I really would like to do this example training, but my Forth doesn't have cell+ and cells words. Is there any kind of work-around i can do to get this sample running ?
>>> 
>>> 
>>> 
>>> Thank you in advance!
>> 
>> After reading the simple and the sophisticated attempts at solving this issue I wonder if the stack universally represents 'cell' size on a given FORTH system? If so do all FORTH systems support sp@? If so would:
>> 
>> sp@ 1 sp@ swap drop - u. 
>> 
>> work ?
> 
> The standard prescribes all items have cell width.
> The word sp@ does not appear in the standard, except in the appendix for
> CATCH and THROW.
> What does your '1' do?
> sp@ sp@ nip - .
> In my implementation 'dsp@ dsp@ nip - .' displays 2. Same as '1 cells .'

Like Paul Rubin found out, the nip must go.
If sp@ would exist in colorforth, the answer would be 1.

-- 
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html 

[toc] | [prev] | [next] | [standalone]


#19993

From"Clyde W. Phillips Jr." <cwpjr02@gmail.com>
Date2013-02-24 13:33 -0800
Message-ID<40253f72-ec98-4287-b0c6-eb47f82da8e1@googlegroups.com>
In reply to#19973
On Saturday, February 23, 2013 6:00:34 PM UTC-6, Coos Haak wrote:
> Op Sun, 24 Feb 2013 00:46:45 +0100 schreef Coos Haak:
> 
> 
> 
> > Op Sat, 23 Feb 2013 15:14:13 -0800 (PST) schreef Clyde W. Phillips Jr.:
> 
> > 
> 
> >> On Monday, February 18, 2013 6:57:15 AM UTC-6, Supercyber Cow wrote:
> 
> >>> Hi all, i'm currently doing some simple Forth experimentation on an simple Forth dialect (threaded) that more or less conforms to Froth-83 and came across this page: http://onestepback.org/articles/poly/gp-forth.html which explains how to make simple class / object alike pragma in forth. I really would like to do this example training, but my Forth doesn't have cell+ and cells words. Is there any kind of work-around i can do to get this sample running ?
> 
> >>> 
> 
> >>> 
> 
> >>> 
> 
> >>> Thank you in advance!
> 
> >> 
> 
> >> After reading the simple and the sophisticated attempts at solving this issue I wonder if the stack universally represents 'cell' size on a given FORTH system? If so do all FORTH systems support sp@? If so would:
> 
> >> 
> 
> >> sp@ 1 sp@ swap drop - u. 
> 
> >> 
> 
> >> work ?
> 
> > 
> 
> > The standard prescribes all items have cell width.
> 
> > The word sp@ does not appear in the standard, except in the appendix for
> 
> > CATCH and THROW.
> 
> > What does your '1' do?
> 
> > sp@ sp@ nip - .
> 
> > In my implementation 'dsp@ dsp@ nip - .' displays 2. Same as '1 cells .'
> 
> 
> 
> Like Paul Rubin found out, the nip must go.
> 
> If sp@ would exist in colorforth, the answer would be 1.
> 
> 
> 
> -- 
> 
> Coos
> 
> 
> 
> CHForth, 16 bit DOS applications
> 
> http://home.hccnet.nl/j.j.haak/forth.html

1 was a brain fart on my part as I didn't have a system to test on...

Your reference to colorforths' 1 I could take as 1 bit :>) on the GreenArray HW.

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.forth


csiph-web