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 20 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 2 of 3 — ← Prev page 1 [2] 3  Next page →


#19854

From"Rod Pemberton" <do_not_have@notemailnotz.cnm>
Date2013-02-20 16:08 -0500
Message-ID<kg3dt8$4e3$1@speranza.aioe.org>
In reply to#19840
"Zbiggy" <zbigniew2011REMOVE@gmail.REMOVE.com> wrote in message
news:slrnki9gu3.76c.zbigniew2011REMOVE@Tichy.myhome.org...
> In comp.lang.forth, Mark Wills wrote:
>
> > My goodness! So much code to determine the cell size!
> >
> > Why not simply: HERE 0 , HERE SWAP - .
> >
> > That'll print 2 on a 16-bit system (so the cell size is 2
> > bytes, i.e. 16 bits) and 4 on a 32 bit system etc.
>
> Well, the assumption was, that there was end of the world, or
> end of Maya calendar - or we are using kForth - and we've got
> no HERE at our disposal.

Originally, I was going to ask if kForth had DP since,
historically, HERE , ALLOT , and ,(comma) were built using it.
I.e., if kForth has DP you could define your own HERE.

However, I found that kForth has a page on it's ANS compliance
or lack of compliance:

http://www.ccreweb.org/software/kforth/kforth5.html#ANS%20Forth%20Compliance

"Special Features"

" ... non-standard behavior that it assigns the address of the new
memory region to the parameter field address (PFA) ..."


That's effectively the address for HERE .


"?ALLOT has the same behavior as ALLOT plus it returns the start
address of the dynamically allocated region on the parameter
stack.  ALLOT has the following equivalent definition under ANS
Forth:"

": ?ALLOT ( u -- a ) HERE SWAP ALLOT ;"


So, you *might* be able use ?ALLOT to give you the cell size since
it returns HERE.  E.g., you might be able to define HERE this way:

: HERE 0 ?ALLOT ;

However, there is no quarantee that when using that definition
multiple times, as in "HERE 0 , HERE SWAP - .", that the addresses
returned by ?ALLOT are adjacent.  I.e., the dynamically allocated
regions _might_ be disjointed because of the dynamic allocations.
If that's the case, you'll see extremely large differences in
value between the addresses returned by two uses of ?ALLOT.


Rod Pemberton


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


#19838 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

FromstephenXXX@mpeforth.com (Stephen Pelc)
Date2013-02-20 10:06 +0000
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<51249f35.628943162@192.168.0.50>
In reply to#19825
On 19 Feb 2013 19:16:26 +0100, Zbiggy
<zbigniew2011REMOVE@gmail.REMOVE.com> wrote:

>: cellSize ( -- n )
>  $ff
>  99 2 do
>    8 lshift $ff + dup -1 =
>    if drop i leave then
>  loop
>  dup 99 > if abort" Can't calculate proper cell size" then ;

It's getting better! You may well find that UNLOOP EXIT allows
further simplification. Alternatively, replace DO ... LOOP
with BEGIN ... UNTIL or some such.

Stephen

-- 
Stephen Pelc, stephenXXX@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads

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


#19839 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

FromZbiggy <zbigniew2011REMOVE@gmail.REMOVE.com>
Date2013-02-20 12:32 +0100
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<slrnki9glp.6s7.zbigniew2011REMOVE@Tichy.myhome.org>
In reply to#19838
In comp.lang.forth, Stephen Pelc wrote:

> It's getting better! You may well find that UNLOOP EXIT allows
> further simplification. Alternatively, replace DO ... LOOP
> with BEGIN ... UNTIL or some such.

Well, OK - then we'll need a counter:

: cellSize ( -- n )
  1 $ff
  begin
    swap 1+ swap 8 lshift $ff +
    dup -1 =
  until
  drop ;

-- 
It's us, the scobs.

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


#19842 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

FromAndrew Haley <andrew29@littlepinkcloud.invalid>
Date2013-02-20 06:55 -0600
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<9KSdndkwz5w2WrnMnZ2dnUVZ_sqdnZ2d@supernews.com>
In reply to#19839
Zbiggy <zbigniew2011REMOVE@gmail.remove.com> wrote:
> In comp.lang.forth, Stephen Pelc wrote:
> 
>> It's getting better! You may well find that UNLOOP EXIT allows
>> further simplification. Alternatively, replace DO ... LOOP
>> with BEGIN ... UNTIL or some such.
> 
> Well, OK - then we'll need a counter:
> 
> : cellSize ( -- n )
>  1 $ff
>  begin
>    swap 1+ swap 8 lshift $ff +
>    dup -1 =
>  until
>  drop ;

But this only tells you how many octets are in a cell.  It doesn't
tell you how many address units that is.  To do that you need to store
to memory.

And this isn't a vacuous or pedantic objection: Forth really does run
on cell-addressed machines.

Andrew.

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


#19844 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

FromZbiggy <zbigniew2011REMOVE@gmail.REMOVE.com>
Date2013-02-20 14:03 +0100
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<slrnki9m15.cpr.zbigniew2011REMOVE@Tichy.myhome.org>
In reply to#19842
In comp.lang.forth, Andrew Haley wrote:

> But this only tells you how many octets are in a cell.  It doesn't
> tell you how many address units that is.  To do that you need to store
> to memory.
>
> And this isn't a vacuous or pedantic objection: Forth really does run
> on cell-addressed machines.

Does it mean, that we can have - say - a Forth system, where:

- a cell is 8 bytes "wide"
- but the smallest addressed unit, which I can fill/occupy e.g. with c,
  is 2 bytes wide ("bi-byte")?

Are there such unusual Forths around?
-- 
It's us, the scobs.

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


#19845 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

FromAndrew Haley <andrew29@littlepinkcloud.invalid>
Date2013-02-20 07:48 -0600
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<2JWdnc6zYMq7SbnMnZ2dnUVZ_rOdnZ2d@supernews.com>
In reply to#19844
Zbiggy <zbigniew2011REMOVE@gmail.remove.com> wrote:
> In comp.lang.forth, Andrew Haley wrote:
> 
>> But this only tells you how many octets are in a cell.  It doesn't
>> tell you how many address units that is.  To do that you need to store
>> to memory.
>>
>> And this isn't a vacuous or pedantic objection: Forth really does run
>> on cell-addressed machines.
> 
> Does it mean, that we can have - say - a Forth system, where:
> 
> - a cell is 8 bytes "wide"

8 octets, so it's a 64-bit system.

> - but the smallest addressed unit, which I can fill/occupy e.g. with c,
>  is 2 bytes wide ("bi-byte")?

Yes.

> Are there such unusual Forths around?

Not eaxctly.  There are, however, Forths running on things like the
Motorola 56k, with 24-bit program words and 24-bit data words.  In
this case the cell size is 1.

Andrew.

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


#19846 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2013-02-20 15:30 +0000
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<2013Feb20.163030@mips.complang.tuwien.ac.at>
In reply to#19844
Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> writes:
>Does it mean, that we can have - say - a Forth system, where:
>
>- a cell is 8 bytes "wide"
>- but the smallest addressed unit, which I can fill/occupy e.g. with c,
>  is 2 bytes wide ("bi-byte")?

Yes.  Certainly possible in Forth 94 and 200x.

>Are there such unusual Forths around?

No.  Current hardware is either byte-addressed (with 8-bit bytes) or
word-addressed, and the Forth systems reflect that.  E.g., 8-bit aus
with 16-bit, 32-bit, or 64-bit cells, or x-bit aus with x-bit cells,
where x can be 16, 18, 20, 32, whatever.

- 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]


#19833 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

From"Rod Pemberton" <do_not_have@notemailnotz.cnm>
Date2013-02-19 18:08 -0500
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<kg10ih$itt$1@speranza.aioe.org>
In reply to#19816
"Zbiggy" <zbigniew2011REMOVE@gmail.REMOVE.com> wrote in message
news:slrnki74ju.lgk.zbigniew2011REMOVE@Tichy.myhome.org...
>
> OK - this one you'll like:
>

Huh ... ?

> : cellSize ( -- n )
>   $ff
>   20 2 do
>     dup 8 lshift $ff + dup -1 =
>     if 2drop i leave else nip then
>   loop
> ;
>

NIP is not in fig-Forth, Forth-79, Forth-83.
NIP is CORE EXT for ANS.

LSHIFT is not in fig-Forth, Forth-79, Forth-83.
LSHIFT is CORE for ANS.

What if there is no support for $ to indicate hex?
IIRC, that's ANS only too.

LEAVE is present in all four.
But, IIRC, it's behavior changed.  Is it used correctly ... ?

I guess ANS  users might like it ...


FYI,

ANS has LSHIFT RSHIFT 2* 2/
Forth-83 has ASHIFT SHIFT ROTATE 2* 2/
Forth-79 has 2* 2/
fig-Forth has / *

fig-Forth, Forth-79, Forth-83, ANS, have HERE .
fig-Forth has DP .  Forth-79 Forth-83 ANS have ALLOT .


Rod Pemberton


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


#19821 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2013-02-19 16:55 +0000
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<2013Feb19.175518@mips.complang.tuwien.ac.at>
In reply to#19813
Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> writes:
>In comp.lang.forth, Anton Ertl wrote:
>
>> In this particular case, it's easy to be portable and be just as
>> useful as the nonportable version:
>> here 0 , here swap - constant cell
>>: cell+ cell + ;
>>: cells cell * ;
>>
>> BTW, this works even if the au is not a byte.
>
>But what, if we've got no HERE?

Then the system is not Forth-83.  And as a Forth system, it's pretty
lacking.

>Therefore more reliable solution would be:
>
>variable tmp
>$ff tmp !
>: cellSize ( -- n )  20 1 do tmp @ 8 lshift $ff + dup
>  -1 = if drop i 1+ leave else tmp ! then loop ;

This assumes an 8-bit au (not universal) and 2s-complement arithmetic
(pretty universal), and <20 aus/cell (pretty universal), and that
number prefixes ("$ff") work (not universal).  I think this solution
is much less reliable than the one using HERE.

Something along the following lines should work on HERE-less systems
with fewer dependencies:

33 constant celllimit 
: scan0 ( end start -- n )
  do
    i c@ 0= if
      i unloop exit
    then
  loop
  -1 ;

pad celllimit erase \ or does kForth lack PAD, too?
                    \ then do something with ALLOCATE
0 invert pad !
pad celllimit + pad scan0 pad - .

- 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]


#19823 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

FromZbiggy <zbigniew2011REMOVE@gmail.REMOVE.com>
Date2013-02-19 18:42 +0100
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<slrnki7hum.24s.zbigniew2011REMOVE@Tichy.myhome.org>
In reply to#19821
In comp.lang.forth, Anton Ertl wrote:

> pad celllimit erase \ or does kForth lack PAD, too?
>                     \ then do something with ALLOCATE

No, from what I see, the lack of HERE , c, was the most significant
difference to "more standard compliant" Forths:
 http://ccreweb.org/software/kforth/kforth5.html#Special Features
(and somewhat different functionality of ALLOT)
-- 
It's us, the scobs.

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


#19832 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

From"Rod Pemberton" <do_not_have@notemailnotz.cnm>
Date2013-02-19 18:08 -0500
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<kg10hs$isd$1@speranza.aioe.org>
In reply to#19813
"Zbiggy" <zbigniew2011REMOVE@gmail.REMOVE.com> wrote in message
news:slrnki6v5a.dts.zbigniew2011REMOVE@Tichy.myhome.org...
>
> But what, if we've got no HERE? E.g. kForth has no HERE, neither
> , c, etc.
>

Why would you have a Forth with no HERE?

HERE is specified and/or required by fig-Forth, Forth-79,
Forth-83, and ANS.


Rod Pemberton

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


#19834 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

FromZbiggy <zbigniew2011REMOVE@gmail.REMOVE.com>
Date2013-02-20 00:20 +0100
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<slrnki85pg.clc.zbigniew2011REMOVE@Tichy.myhome.org>
In reply to#19832
In comp.lang.forth, Rod Pemberton wrote:

> Why would you have a Forth with no HERE?
>
> HERE is specified and/or required by fig-Forth, Forth-79,
> Forth-83, and ANS.

Well, there does exist at least one without HERE - I thought, maybe there
are more Forth implementations like this around.
-- 
It's us, the scobs.

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


#19855 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

From"Rod Pemberton" <do_not_have@notemailnotz.cnm>
Date2013-02-20 16:08 -0500
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<kg3du3$4g8$1@speranza.aioe.org>
In reply to#19834
"Zbiggy" <zbigniew2011REMOVE@gmail.REMOVE.com> wrote in message
news:slrnki85pg.clc.zbigniew2011REMOVE@Tichy.myhome.org...
> In comp.lang.forth, Rod Pemberton wrote:
>
> > Why would you have a Forth with no HERE?
> >
> > HERE is specified and/or required by fig-Forth, Forth-79,
> > Forth-83, and ANS.
>
> Well, there does exist at least one without HERE - I thought,
> maybe there are more Forth implementations like this around.

As noted in the kForth link (in my other post), the lack of HERE
in kForth is a technical implementation issue.

Anyway, I don't know about all Forths, but I know about the
presence of HERE in some Forths.

While developing my Forth interpreter, I did some comparisons of
various issues for a bunch of Forths.  These are mostly older DOS
based Forths but a few that work in Windows.  One of the issues I
checked regarded availibility and/or correct usage of DP, HERE,
TIB, and ALLOT.

So, I have a note that HERE is implemented for:

eForth (6 versions), CamelForth, TCOM, SPF,
RetroForth, BBW4Forth, AtLast, This4th,
8088 fig-Forth, F83, ZimmerForth, F-PC,
MiniForth, Win32Forth, bigForth, gForth.


Rod Pemberton




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


#19787 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2013-02-18 13:38 +0000
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<2013Feb18.143843@mips.complang.tuwien.ac.at>
In reply to#19785
Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> writes:
>In comp.lang.forth, cybercow222@gmail.com 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 ?
>
>Do you know, how is your cell size? Say, it is 4 bytes (for 32-bit system):
>
>: cells (n -- )   4 * ;
>: cell+ ( -- )   4 + ;

Then it's not Forth-83.  In Forth-83 the following is guaranteed to work:

: cells 2 * ; \ or : cell 2* ;
: cell+ 2 + ;

There have been some Forth systems, though that were Forth-83 in most
respects, but not in cell size.

- 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]


#19792 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

FromZbiggy <zbigniew2011REMOVE@gmail.REMOVE.com>
Date2013-02-18 15:39 +0100
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<slrnki4iru.gbf.zbigniew2011REMOVE@Tichy.myhome.org>
In reply to#19787
In comp.lang.forth, Anton Ertl wrote:

> Then it's not Forth-83.  In Forth-83 the following is guaranteed to work:

You mean: Forth-83 was "16-bit" only?

Is there any table available, with all the differences among the standards
listed?
-- 
It's us, the scobs.

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


#19796 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2013-02-18 14:50 +0000
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<2013Feb18.155007@mips.complang.tuwien.ac.at>
In reply to#19792
Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> writes:
>In comp.lang.forth, Anton Ertl wrote:
>
>> Then it's not Forth-83.  In Forth-83 the following is guaranteed to work:
>
>You mean: Forth-83 was "16-bit" only?

Yes.

>Is there any table available, with all the differences among the standards
>listed?

There is an Annex in ANS Forth that discusses the differences.

- 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]


#19800 — Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect

From"Elizabeth D. Rather" <erather@forth.com>
Date2013-02-18 08:56 -1000
SubjectRe: Can i (easily) implement cell+ and cells in an Forth83 - like dialect
Message-ID<3LedncRG-vbY5L_MnZ2dnUVZ_oidnZ2d@supernews.com>
In reply to#19796
On 2/18/13 4:50 AM, Anton Ertl wrote:
> Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> writes:
>> In comp.lang.forth, Anton Ertl wrote:
>>
>>> Then it's not Forth-83.  In Forth-83 the following is guaranteed to work:
>>
>> You mean: Forth-83 was "16-bit" only?
>
> Yes.
>
>> Is there any table available, with all the differences among the standards
>> listed?
>
> There is an Annex in ANS Forth that discusses the differences.
>
> - anton
>

It's Appendix D.3. You may find the document here:
http://forthworks.com/mirrors/taygeta/Literature/ansforth.pdf

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]


#19790

FromMark Wills <forthfreak@gmail.com>
Date2013-02-18 06:38 -0800
Message-ID<9c12dbde-a53d-4735-8e42-4bb43685f7e8@cd3g2000vbb.googlegroups.com>
In reply to#19785
On Feb 18, 1:17 pm, Zbiggy <zbigniew2011REM...@gmail.REMOVE.com>
wrote:
> In comp.lang.forth, cybercow...@gmail.com 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.htmlwhich
> > 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 ?
>
> Do you know, how is your cell size? Say, it is 4 bytes (for 32-bit system):
>
> : cells (n -- )   4 * ;
> : cell+ ( -- )   4 + ;
>
> --
> It's us, the scobs.

Forth 83 is 16-bit, not 32-bit, so those 4's should be 2's ;-)

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


#19788

Fromcybercow222@gmail.com
Date2013-02-18 06:00 -0800
Message-ID<d9de8efc-b42b-413c-8cc4-d22a6a64ae60@googlegroups.com>
In reply to#19784
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).

Cheers!

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


#19789

FromMatthias Koch <matthias.koch@hot.uni-hannover.de>
Date2013-02-18 15:01 +0100
Message-ID<kftcdj$r43$1@newsserver.rrzn.uni-hannover.de>
In reply to#19788
> 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

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


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

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


csiph-web