Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #19821
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: Can i (easily) implement cell+ and cells in an Forth83 - like dialect |
| Date | 2013-02-19 16:55 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2013Feb19.175518@mips.complang.tuwien.ac.at> (permalink) |
| References | (5 earlier) <slrnki5h3l.1r2.zbigniew2011REMOVE@Tichy.myhome.org> <kfue13$kn6$1@speranza.aioe.org> <QP6dnYcdGMeMr77MnZ2dnUVZ_rOdnZ2d@supernews.com> <2013Feb19.093926@mips.complang.tuwien.ac.at> <slrnki6v5a.dts.zbigniew2011REMOVE@Tichy.myhome.org> |
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/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
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
csiph-web