From: Leon N M. <leo...@gm...> - 2010-09-27 04:35:23
|
Ok, I've added a very rough version of >FLOAT, which takes the address and length of a string and returns a float. For example, here's an 8 character long string starting at address 471 -- first displayed using TYPE, then converted to a float and printed with FS. > 471 8 type 46.3e-42 ok > 471 8 >float fs. 4.6298862E-41 ok It's not so accurate (and it's slow) because it's using some floating point arithmetic where integer arithmetic will do, but I'll deal with that later (I even hope to use a nice conversion algorithm, like <http://portal.acm.org/citation.cfm?id=368376>). Two things: 1) How does exception handling work? >FLOAT is supposed to return FALSE if it's can't convert something to a string, but currently it will just throw an error because NUMBER will throw an error (since NUMBER is used under the hood). I'd like to catch any error NUMBER throws and then return FALSE as required. 2) Currently NUMBER accepts numbers with a leading negative sign, but not a leading positive sign (e.g. -101 works, but +101 causes an error). ANS94 requires floats to work with both, so it would be easier for me if NUMBER works with both. (Does ANS94 say anything about accepting positive signs for integers?) -Leon |
From: pito <pi...@vo...> - 2010-09-30 12:18:43
|
Hi, I am doing following: > bl parse 7.77854e-12 ok > .s 0 16381 11 1 16383 380 ok > type 7.77854e-12 ok > bl parse 7.77854e-12 type 7.77854e-12 ok > bl parse 7.77854e-12 >float ^ ?? -13 28 > Why?? Pito |
From: Kalus M. <mic...@on...> - 2010-09-30 13:30:54
|
Hi. Am 30.09.2010 um 14:18 schrieb pito: .. >> bl parse 7.77854e-12 >float > ^ > ?? -13 28 >> > Why?? Pito This indicates that >float is unknown to your system. 28 characters from the beginning of the line is the end of the unknown word = >float There was a patch recently for quit.asm that moves the ^ sign to a more obvious position. In quit.asm you find: .. .dw PFA_QUIT5 .dw XT_SLITERAL .dw 4 .db " ?? " .dw XT_ITYPE .dw XT_BASE .dw XT_FETCH .dw XT_TO_R .dw XT_DECIMAL .dw XT_DOT .dw XT_G_IN .dw XT_FETCH .dw XT_DOT .dw XT_R_FROM .dw XT_BASE .dw XT_STORE replace with following code: ; indicate error position: .dw XT_G_IN .dw XT_FETCH .dw XT_SPACES .dw XT_DOLITERAL .dw '^' .dw XT_EMIT .dw XT_CR ; show error code and position count .dw XT_SLITERAL .dw 4 .db " ?? " .dw XT_ITYPE .dw XT_BASE .dw XT_FETCH .dw XT_TO_R .dw XT_DECIMAL .dw XT_DOT .dw XT_G_IN .dw XT_FETCH .dw XT_DOT .dw XT_R_FROM .dw XT_BASE .dw XT_STORE ; then .dw XT_CR ; mk .dw XT_EXIT You may play with this till it satisfies your needs. Michael |
From: pito <pi...@vo...> - 2010-09-30 13:34:18
|
Michael, thanks for the patch I will try! Unfortunately I have >float there, I did upload it several times, but it seems this come with amf4.2. I'll try 4.0..Pito |
From: pito <pi...@vo...> - 2010-09-30 13:44:57
|
Yes, it is something with 4.2. I'm back to 4.0 and: > bl parse 4.2232e-12 type 4.2232e-12 ok > bl parse 4.2232e-12 >float ok > fs. 4.2231998E-12 ok > bl parse 4.2232e-12 >float fs. 4.2231998E-12 ok > I wrote to Matthias on 4.2 "issue", there must be something different against 4.0 which is cousing me issues..P. |
From: Leon N M. <leo...@gm...> - 2010-09-30 13:46:06
|
When you get it working, you'll find a bug -- 77854 is too large for a regular integer, so you'll get a wacky answer: > bl parse 7.77854e-12 >float . fs. -1 7.1231751E-12 ok Take off a digit, and things get better: > bl parse 7.7785e-12 >float . fs. -1 7.7784925E-12 ok I'm working on a rewrite with double length integers to fix this (and other problems). -Leon >Thursday 30 September 2010 >From: "pito" <pi...@vo...> >Subject: Re: [Amforth-devel] >FLOAT > Michael, thanks for the patch I will try! > > Unfortunately I have >float there, I did upload it several times, > but it seems this come with amf4.2. I'll try 4.0..Pito > > > --------------------------------------------------------------------------- > --- Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: pito <pi...@vo...> - 2010-09-30 13:49:32
|
my result (I am using the asm 4 primitives flib): > bl parse 7.77854e-12 >float . fs. 11514 -9.698532E-20 ok > Pito |
From: pito <pi...@vo...> - 2010-09-30 13:56:16
|
Again with a clean stacK: > .s ok > ok > .s ok > bl parse 7.77854e-12 >float fs. 7.1231794E-12 ok > .s 0 16377 7 1 16379 370 2 16381 11 3 16383 370 ok > a lot of stuff on the stack there..P. |
From: Leon N M. <leo...@gm...> - 2010-09-30 14:23:34
|
> > bl parse 7.77854e-12 >float fs. > > 7.1231794E-12 ok Like I said, 7.77854e-12 will give you a funky answer becasue 77854 > 32767 -- it can't fit in a regular integer. The top of the stack should be TRUE or FALSE (depending on whether it could do the coversion or not), so I'm a little surprised you get this answer without a '.' before 'FS.'. Yesterday I uploaded a small change without testing it (the code to handle e,E,d,D) -- maybe that's causing a problem too. -Leon |
From: pito <pi...@vo...> - 2010-09-30 14:41:05
|
> surprised you get this answer without a '.' before > 'FS.'. so after a fresh install 4.0: > .s ok > bl parse 7.77854e-12 >float fs. 7.1231794E-12 ok > .s 0 16377 7 1 16379 370 2 16381 11 3 16383 370 ok > ..... ^ ?? -13 6 > .s ok > bl parse 7.77854e-12 >float . fs. 11514 -9.698532E-20 ok > .s 0 16379 370 1 16381 11 2 16383 370 ok > |
From: pito <pi...@vo...> - 2010-09-30 15:19:02
|
Well, I downloaded your newest library now ( I worked with the old one ): with your f* f/ f+ f- : > ok > bl parse 1.234e18 >float . fs. -1 1.2339984E18 ok > .s ok > bl parse 1.234e18 >float fs. -exponent > 127 > .s with my asm f* f/ f+ f- : > .s ok > bl parse 1.234e18 >float . fs. -1 1.2340002E18 ok > .s ok > bl parse 1.234e18 >float fs. -6.788775E38 ok > .s 0 16383 99 ok > PS: 1.there is "ceil" - or shouldn't it be called fceil? 2.pls uncomment those small things like d=, normally you cannot see an error easily when uploading it so many will overlook it, better to have it twice. |
From: pito <pi...@vo...> - 2010-09-30 15:52:37
|
Let's try (:-): \ SIMPLE FLOATS INPUT TEST bl parse 0.000000e0 >float . fs. bl parse 9.999000e0 >float . fs. bl parse -9.999000e0 >float . fs. bl parse 9.999000e9 >float . fs. bl parse -9.999000e9 >float . fs. bl parse 9.999000e+0 >float . fs. bl parse -9.999000e+0 >float . fs. bl parse 9.999000e-0 >float . fs. bl parse -9.999000e-0 >float . fs. bl parse 9.999000e+00 >float . fs. bl parse -9.999000e+00 >float . fs. bl parse 9.999000e-00 >float . fs. bl parse -9.999000e-00 >float . fs. bl parse 9.999000e+30 >float . fs. bl parse -9.999000e+30 >float . fs. bl parse 9.999000e-30 >float . fs. bl parse -9.999000e-30 >float . fs. bl parse 0.000000e0 >float . fs. bl parse 0.000099e+31 >float . fs. bl parse -0.000099e+31 >float . fs. bl parse 0.000099e-31 >float . fs. bl parse -0.000099e-31 >float . fs. bl parse 1.000077e+24 >float . fs. bl parse -1.000077e+24 >float . fs. bl parse 1.000077e-24 >float . fs. bl parse -1.000077e-24 >float . fs. bl parse 1.234567e0 >float . fs. bl parse -1.234567e0 >float . fs. bl parse 1.234567e-0 >float . fs. bl parse -1.234567e-0 >float . fs. bl parse 1.234567e+0 >float . fs. bl parse -1.234567e+0 >float . fs. bl parse 1.234567e-00 >float . fs. bl parse -1.234567e+00 >float . fs. bl parse 1.234567e30 >float . fs. bl parse -1.234567e30 >float . fs. bl parse 1.234567e+30 >float . fs. bl parse -1.234567e+30 >float . fs. bl parse 1.234567e-30 >float . fs. bl parse -1.234567e-30 >float . fs. bl parse 9.999999e+30 >float . fs. bl parse -9.999999e+30 >float . fs. bl parse 9.999999e-30 >float . fs. bl parse -9.999999e-30 >float . fs. |
From: Kalus M. <mic...@on...> - 2010-09-30 16:08:32
|
Hi Pito. If >float is assembler defined and closed with something like end- code, this end-code has to smudge the definition the same way ; (semicolon) does it. It has been a long standing claim that a definition may not be found until it is finished. So setting the "smudgebit" is last thing to do. amforth4.2 has this behavior now. Maybe you found a side effect of this new behaviour. But there shoud be some kind of "smudge" word to solve this problem then. Michael Am 30.09.2010 um 15:44 schrieb pito: > Yes, it is something with 4.2. I'm back to 4.0 and: > >> bl parse 4.2232e-12 type > 4.2232e-12 ok >> bl parse 4.2232e-12 >float > ok >> fs. > 4.2231998E-12 ok >> bl parse 4.2232e-12 >float fs. > 4.2231998E-12 ok >> > > I wrote to Matthias on 4.2 "issue", there must be something > different against 4.0 which is cousing me issues..P. > |
From: pito <pi...@vo...> - 2010-09-30 18:42:26
|
Hi, this is a short story on how I've found a bug in an asm word. After few days of experimenting at amforth level I decided either to start with other hobby or to find out how to simulate the whole stuff and see what is actually going on by stepping via the avr flash code. The experiments with AVR Studio - mainly simulation at asm level finished with an early crash. By chance I found the crash is caused by the debugger - when the asm source wants to continue into a "debugger" (for the code outside the "amforth.asm") the debuger is called, but not set properly (my understanding) and crashes. Now, how it works: 1. compile amforth in AVR Studio as usuall 2. then close all projects 3. open file - e.g. amforth42_1284p.hex (MUST BE .HEX) 4. Studio offers a new project name e.g. amforth42_1284p_hex.aps - do save 5. select device and debug platform (simulator2 and 1284p) 6. finish 7. debuger opens and you will see the flash disassembled 8. then go Debug -> Up/download memory, choose EEPROM and load eeprom from file e.g. amforth42_1284p.eep, open memory watch window and select eeprom - you will see the eeprom content 9. TERMINAL - I did not find terminal in AVR Studio, so I downloaded HAPSIM for AVR Studio: download, run hapsim.exe and do file -> New Control -> Terminal, it will connect to AVR studio, you may set settings 10. Place breakpoints where you want (here you see entire flash disassembling only, so help yourself and open .lst file and navigate accordingly) when not keen on stepping via all code there 11. when you Run the debuger you will see after few seconds amforth's hello and promt in the Terminal, you may work as usual (mind the respones are several seconds) and you may step via the flash. I did not try to upload a new word, but I ran existing word and watched what is going on. It help me to find the bug - otherwise I would not find him by today.. I would be happy to know your experience with amforth debugging/simulating as well. Pito. |
From: Leon N. M. <leo...@gm...> - 2010-09-30 16:31:03
|
On Thursday, September 30, 2010 10:18:54 am pito wrote: ... > PS: > 1.there is "ceil" - or shouldn't it be called fceil? ANS94 specifies that the floor command should be FLOOR, not FFLOOR. I figure ceil should do the same (which I think makes sense -- there's no point in having a floor or ceil for integers). > 2.pls uncomment those small things like d=, normally you cannot see > an error easily when uploading it so many will overlook it, better > to have it twice. Will do, although I think the real solution is to have it included by default in amforth -- it's listed on <http://amforth.sourceforge.net/words/> after all. -Leon |
From: pito <pi...@vo...> - 2010-10-01 11:54:59
|
\ COME UP WITH BETTER NAMES FOR NEXT TWO : partnumber fsnip, fcut, ncut, nsnip, nclip, fclip, fstrip, nstrip, nslit, flsit, nrive, frive, ntear, ftear, nrift, frift, nnip, fchap, nchap, nhew, fhew : extract nsuck, fsuck, nmilk, fmilk, nsap, fsap, fblot, nblot, nsip, fsip (;-). Pito |
From: pito <pi...@vo...> - 2010-10-02 11:48:39
|
Hi, in case of "1.234e" "1.234" "1.234e0" string>float drops the "0" exp from rstack : : string>float ( c-addr u-length -- f ) \ get exponent first -- this is the number that follows e, E, d, or D 101 extract dup 0= if drop \ 'e' 69 extract dup 0= if drop \ 'E' 100 extract dup 0= if drop \ 'd' 68 extract dup 0= \ 'D' ##### <<< Pito: dup 0= if then then then \ ##### <<< Pito: then then then then >r ( adr length, R: exp ) .... and the: \ now, shift according to exp r> dup 0= if drop else returns a wrong result. With #### up there it returns "0" from rstack (an error from partnumber but a correct exp) which "could be taken" as a good exp ("0" in those cases) so we may get the right result for above floats (when "now, shift according to exp" will be changed somehow). P. |
From: pito <pi...@vo...> - 2010-09-30 17:03:46
|
> Will do, although I think the real solution is to > have it included by default > in amforth -- it's listed on > <http://amforth.sourceforge.net/words/> after > all. sure, some needs to be .included.. Some new creazy ideas for >float tests: \ SIMPLE FLOATS INPUT TEST bl parse 0e0 >float . fs. bl parse -0e0 >float . fs. bl parse -0e-0 >float . fs. bl parse -0e-0 >float . fs. bl parse +0e-0 >float . fs. bl parse +0e+0 >float . fs. bl parse 0.0e0 >float . fs. bl parse -0.0e0 >float . fs. bl parse -0.0e-0 >float . fs. bl parse -0.0e-0 >float . fs. bl parse +0.0e-0 >float . fs. bl parse +0.0e+0 >float . fs. bl parse 1e0 >float . fs. bl parse -1e0 >float . fs. bl parse -1e-0 >float . fs. bl parse -1e-0 >float . fs. bl parse +1e-0 >float . fs. bl parse +1e+0 >float . fs. bl parse 1.0e0 >float . fs. bl parse -1.0e0 >float . fs. bl parse -1.0e-0 >float . fs. bl parse -1.0e-0 >float . fs. bl parse +1.0e-0 >float . fs. bl parse +1.0e+0 >float . fs. bl parse 1.0e09 >float . fs. bl parse -1.0e09 >float . fs. bl parse -1.0e-09 >float . fs. bl parse -1.0e-09 >float . fs. bl parse +1.0e-09 >float . fs. bl parse +1.0e+09 >float . fs. bl parse 9e0 >float . fs. bl parse -9e0 >float . fs. bl parse 9e-0 >float . fs. bl parse -9e+0 >float . fs. bl parse 9e09 >float . fs. bl parse -9e09 >float . fs. bl parse 9e-09 >float . fs. bl parse -9e+09 >float . fs. bl parse +9e+0 >float . fs. bl parse -9e+0 >float . fs. bl parse +9e-0 >float . fs. bl parse +9e+0 >float . fs. bl parse +9e+09 >float . fs. bl parse -9e+09 >float . fs. bl parse +9e-09 >float . fs. bl parse +9e+09 >float . fs. bl parse +9.e+0 >float . fs. bl parse -9.e+0 >float . fs. bl parse +9.e-0 >float . fs. bl parse +9.e+0 >float . fs. bl parse +9.9e0 >float . fs. bl parse -9.9e0 >float . fs. bl parse +9.9e0 >float . fs. bl parse +9.9e0 >float . fs. bl parse +9.9e+0 >float . fs. bl parse -9.9e+0 >float . fs. bl parse +9.9e-0 >float . fs. bl parse +9.9e+0 >float . fs. bl parse +9.9e+09 >float . fs. bl parse -9.9e+09 >float . fs. bl parse +9.9e-09 >float . fs. bl parse +9.9e+09 >float . fs. bl parse 0.000000e0 >float . fs. bl parse 0.000000e-0 >float . fs. bl parse -0.000000e0 >float . fs. bl parse -0.000000e-0 >float . fs. bl parse +0.000000e+0 >float . fs. bl parse +0.000000e-0 >float . fs. bl parse -0.000000e+0 >float . fs. bl parse -0.000000e-0 >float . fs. bl parse 9.000000e0 >float . fs. bl parse 9.000000e-0 >float . fs. bl parse -9.000000e0 >float . fs. bl parse -9.000000e-0 >float . fs. bl parse +9.000000e+0 >float . fs. bl parse +9.000000e-0 >float . fs. bl parse -9.000000e+0 >float . fs. bl parse -9.000000e-0 >float . fs. bl parse 9.000000e09 >float . fs. bl parse 9.000000e-09 >float . fs. bl parse -9.000000e09 >float . fs. bl parse -9.000000e-09 >float . fs. bl parse +9.000000e+09 >float . fs. bl parse +9.000000e-09 >float . fs. bl parse -9.000000e+09 >float . fs. bl parse -9.000000e-09 >float . fs. bl parse 9.999000e0 >float . fs. bl parse -9.999000e0 >float . fs. bl parse 9.999000e9 >float . fs. bl parse -9.999000e9 >float . fs. bl parse 9.999000e+0 >float . fs. bl parse -9.999000e+0 >float . fs. bl parse 9.999000e-0 >float . fs. bl parse -9.999000e-0 >float . fs. bl parse 9.999000e+00 >float . fs. bl parse -9.999000e+00 >float . fs. bl parse 9.999000e-00 >float . fs. bl parse -9.999000e-00 >float . fs. bl parse 9.999999e+30 >float . fs. bl parse -9.999999e+30 >float . fs. bl parse 9.999999e-30 >float . fs. bl parse -9.999999e-30 >float . fs. bl parse 999999.9e+30 >float . fs. bl parse -999999.9e+30 >float . fs. bl parse 999999.9e-30 >float . fs. bl parse -999999.9e-30 >float . fs. bl parse 999999.9e30 >float . fs. bl parse -999999.9e30 >float . fs. bl parse 999999.9e-30 >float . fs. bl parse -999999.9e-30 >float . fs. bl parse +999999.9e30 >float . fs. bl parse +999999.9e-30 >float . fs. bl parse 0.000000e0 >float . fs. bl parse 000000.0e-0 >float . fs. bl parse 000000.0e+0 >float . fs. bl parse +000000.0e-0 >float . fs. bl parse +000000.0e+0 >float . fs. bl parse -000000.0e-0 >float . fs. bl parse -000000.0e+0 >float . fs. bl parse 000000.1e-0 >float . fs. bl parse 000000.1e+0 >float . fs. bl parse +000000.1e-0 >float . fs. bl parse +000000.1e+0 >float . fs. bl parse -000000.1e-0 >float . fs. bl parse -000000.1e+0 >float . fs. bl parse 000000.1e-01 >float . fs. bl parse 000000.1e+01 >float . fs. bl parse +000000.1e-01 >float . fs. bl parse +000000.1e+01 >float . fs. bl parse -000000.1e-01 >float . fs. bl parse -000000.1e+01 >float . fs. bl parse 0.000099e+31 >float . fs. bl parse -0.000099e+31 >float . fs. bl parse 0.000099e-31 >float . fs. bl parse -0.000099e-31 >float . fs. bl parse 1.000077e+24 >float . fs. bl parse -1.000077e+24 >float . fs. bl parse 1.000077e-24 >float . fs. bl parse -1.000077e-24 >float . fs. bl parse 1.234567e0 >float . fs. bl parse -1.234567e0 >float . fs. bl parse 1.234567e-0 >float . fs. bl parse -1.234567e-0 >float . fs. bl parse 1.234567e+0 >float . fs. bl parse -1.234567e+0 >float . fs. bl parse 1.234567e-00 >float . fs. bl parse -1.234567e+00 >float . fs. bl parse 1.234567e30 >float . fs. bl parse -1.234567e30 >float . fs. bl parse 1.234567e+30 >float . fs. bl parse -1.234567e+30 >float . fs. bl parse 1.234567e-30 >float . fs. bl parse -1.234567e-30 >float . fs. bl parse 9.999999e+30 >float . fs. bl parse -9.999999e+30 >float . fs. bl parse 9.999999e-30 >float . fs. bl parse -9.999999e-30 >float . fs. bl parse +9.999999e+30 >float . fs. bl parse -9.999999e+30 >float . fs. bl parse +9.999999e-30 >float . fs. bl parse -9.999999e-30 >float . fs. bl parse +9.999999e30 >float . fs. bl parse -9.999999e30 >float . fs. |
From: Matthias T. <mt...@we...> - 2010-09-30 18:44:46
|
hi Pito, > > Will do, although I think the real solution is to > > have it included by default > > in amforth -- it's listed on > > <http://amforth.sourceforge.net/words/> after > > all. > sure, some needs to be .included.. d= is not needed for every amforth system. The default contains the minimum (as I see it) to make a working system. Nothing more. Its up to the user to include whatever (s)he needs. Thats why I put the relevant "master" include files into the application source tree. The dic_* include files in core/* are provided to ease the work, they are not must-use files.. Matthias |
From: Matthias T. <mt...@we...> - 2010-09-30 18:37:38
|
hi, > Hi Pito. > > If >float is assembler defined and closed with something like end- > code, this end-code has to smudge the definition the same way ; > (semicolon) does it. >float is forth code. (http://github.com/lnmaurer/amforth-float ) > It has been a long standing claim that a definition may not be found > until it is finished. So setting the "smudgebit" is last thing to do. > amforth4.2 has this behavior now. Maybe you found a side effect of > this new behaviour. But there shoud be some kind of "smudge" word to > solve this problem then. what should that smudge do? if you want to use the word currently beeing defined, use recurse, after the ; the new name will be visible anyway. btw: there is no smudge bit in amforth. Matthias |
From: Kalus M. <mic...@on...> - 2010-09-30 19:07:37
|
Hi Pito. >float is an assembler defined word, or is it colon definition? http://www.bradrodriguez.com/papers/moving6.htm: COMPILER OPERATION "... Also, : will HIDE the new word, and ; will REVEAL it (by setting and clearing the "smudge" bit in the name). This is to allow a Forth word to be redefined in terms of its "prior self"." What amforth-4.2 does to hide a word during compilation, and reveal it on completion of definition, is setting a noname variable in ram internaly called COLON_SMUDGE. While DP proceeds while compiling, content of COLON_SMUDGE does not. When the definition is complete, you fetch content of COLON_SMUDGE and store it to the current pointer. Now the last defined word gets revealed. Its basicaly this (is this true Mathias?): variable colon_smudge ... dp colon_smudge ! code: <name> {..code..} end_code colon_smudge @ get-current ! Since COLON_SMUDGE is noname, try this work around. Include smudge.asm in your dict_appl.inc - this is what has to go into smudge.asm: VE_SMUDGE: .dw $ff06 .db "smudge" .dw VE_HEAD .set VE_HEAD = VE_SMUDGE XT_SMUDGE: .dw DO_COLON PFA_SMUDGE: .dw XT_DOLITERAL .dw COLON_SMUDGE .dw XT_FETCH .dw XT_GET_CURRENT .dw XT_ESTORE .dw XT_EXIT Then code your >float and execute smudge thereafter. Use smuge after every code definition. Maybe we should put it into the end-code word. Hope it does the job and you find your >float then. Michael Am 30.09.2010 um 20:37 schrieb Matthias Trute: > hi, > >> Hi Pito. >> >> If >float is assembler defined and closed with something like end- >> code, this end-code has to smudge the definition the same way ; >> (semicolon) does it. > >> float is forth code. (http://github.com/lnmaurer/amforth-float ) > >> It has been a long standing claim that a definition may not be found >> until it is finished. So setting the "smudgebit" is last thing to do. >> amforth4.2 has this behavior now. Maybe you found a side effect of >> this new behaviour. But there shoud be some kind of "smudge" word to >> solve this problem then. > > what should that smudge do? if you want to use the word currently > beeing defined, use recurse, after the ; the new name will be visible > anyway. btw: there is no smudge bit in amforth. > > > Matthias > > > > ---------------------------------------------------------------------- > -------- > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: pito <pi...@vo...> - 2010-09-30 19:15:16
|
> >float is an assembler defined word, or is it > >colon definition? it is Leon's word - the colon definition, not an assembler word. See Leon's lib http://github.com/lnmaurer/amforth-float/blob/master/float.fth P. |
From: Kalus M. <mic...@on...> - 2010-09-30 20:13:27
|
Hi Pito. Am 30.09.2010 um 21:15 schrieb pito: >>> float is an assembler defined word, or is it >>> colon definition? > it is Leon's word - the colon definition, not an assembler word. > See Leon's lib > http://github.com/lnmaurer/amforth-float/blob/master/float.fth > > P. Hm, I see. Very strange, definition looks ok. Have no amforth-4.2 installed jet, maybe do it next days. PS: In float.fth I found: \ STACK MANIPULATION WORDS \ DOESN'T WORK? : f>r ( f -- , R: -- f ) >r >r ; \ DOESN'T WORK? : fr> ( -- f, R: f -- ) r> r> ; .. This indeed won't work. Use 2>r and 2r> instead, they are provided in core/words allready. Maybe you like this littel brainteaser: http://www.forth-ev.de/wiki/doku.php/enigmatic:to-r_r-from :-) Michael |
From: pito <pi...@vo...> - 2010-09-30 21:31:59
|
Hi, there is a bug in the flib at line 116 of Leon's listing: : dreversedigits2 ( dinitial n-digits -- dfinal ) dup 0= if s>f <<<<<< here - used prior its actual definition .... Frankly, I overlooked that aprox. 20times today! The word dreversedigits2 is not used however! But it fires an error (overlooked in the screen listing). I've found that by a chance as I saw something on the stack after the upload. I've checked now it crashes the dictionary - as I wasn't able to run >float (a crash to reflash). I've removed the dreversedigits2 and now it works at least for few floats. > bl parse 1.234e-20 >float . fs. -1 1.2339996E-20 ok > bl parse 9.9999e-19 >float . fs. -1 9.999901E-19 ok > bl parse 9.9999e32 >float . fs. -1 9.999901E32 ok > bl parse -9.9999e-32 >float . fs. -1 -8.0000973E-32 ok > bl parse -9.999e-32 >float . fs. -1 -8.0009995E-32 ok > bl parse 9.999e-32 >float . fs. -1 9.9989977E-32 ok > bl parse +9.999e-32 >float . fs. 0 amforth 4.0 ATmega1284P PS; IS THERE AN OPTION TO CONFIGURE ERROR HANDLING SUCH IT STOPS UPLOAD WHEN AN ERROR THROWN ???? Pito. |