I just added pick to my amforth executable and unless I'm doing something
wrong I think it has a problem. First I push four numbers onto the stack.

(ATmega328P)> 100 200 300 400
 ok

Then I verify what I pushed

(ATmega328P)> .s
400 300 200 100  ok

Now I use pick to print each number individually. So far all is well

(ATmega328P)> 0 pick .
400  ok
(ATmega328P)> 1 pick .
300  ok
(ATmega328P)> 2 pick .
200  ok
(ATmega328P)> 3 pick .
100  ok

Then I try this subtraction. 1 pick = 300; 3 pick = 100; I expect 200

(ATmega328P)> 1 pick 3 pick - .

100  ok

Got 100 as the answer?????

Just to verify stack hasn't changed

(ATmega328P)> .s
400 300 200 100  ok

One more test

(ATmega328P)> 0 pick 1 pick - .
0  ok


Any clues ?

-- 
Craig Lindley
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to