Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: d>f and f>d...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 6 Topic 3792 of 4325
Post > Topic >>

Re: d>f and f>d missing in ficl and order for double cells?

by Elizabeth D Rather <erather@[EMAIL PROTECTED] > Mar 2, 2008 at 08:45 AM

Frank Buss wrote:
> Looks like these 2 words are missing in ficl. Maybe there are other
useful
> words to convert integers to floats and vice-versa?
> 
.... [code snipped]
>
> 
> But this doesn't work. Looks like ficl saves a double in low/high
format.
> This is the output of Win32Forth:
> 
> 12. . .
> 0 12
> 
> and this on ficl (compiled on an ARM platform) :
> 12. . .
> 12 0
> 
> Which one is the right one? I don't understand what the word "above"
means
> in "3.1.4.1 Double-cell integers".

"Above" is in the context of the stack, and means closer to TOS.  On 
most systems that's a lower memory address, but the intent is to avoid 
being specific about memory addresses to avoid constraining
implementations.

> For me it looks better to push the high value as the last item on stack,
> because then I can just drop it, if not needed, instead of "swap drop"

Yes, that's exactly why the order is as it is (that was also 
overwhelming common practice when the rule was written)

, so
> I've changed the ficl parsing function, now my d>f and f>d words are
> working as expected, e.g. like this:
> 
> 12. d>f -6. d>f f/ f>d drop .
> -2
> 
> But the other double words are not working any more. 

Probably ficl has a lot of dependencies on the order they chose.

> Is there a better
> Forth system for ARM9 plaforms, maybe compiled instead of interpreted?
> Currently it runs in a WindowsCE environment and I need to interface to
> lots of C functions for driver accessing. Later it is possible that it
> should work with "Net+OS" ( http://www.digi.com/pdf/fs_netos7.pdf
),
too,
> which has lots of C functions, too.

Ficl is probably the most C-friendly.  There's a SwiftX for ARMs, but 
it's really designed for standalone targets.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310-491-3356
5155 W. Rosecrans Ave. #1018  Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com

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




 6 Posts in Topic:
d>f and f>d missing in ficl and order for double cells?
Frank Buss <fb@[EMAIL   2008-03-02 17:01:00 
Re: d>f and f>d missing in ficl and order for double cells?
Andrew Haley <andrew29  2008-03-02 18:02:19 
Re: d>f and f>d missing in ficl and order for double cells?
Elizabeth D Rather <er  2008-03-02 08:45:21 
Re: d>f and f>d missing in ficl and order for double cells?
Frank Buss <fb@[EMAIL   2008-03-03 05:18:15 
Re: d>f and f>d missing in ficl and order for double cells?
Andrew Haley <andrew29  2008-03-03 10:58:35 
Re: d>f and f>d missing in ficl and order for double cells?
anton@[EMAIL PROTECTED]   2008-03-03 10:47:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 16:29:37 CST 2008.