From: Bernard M. <bme...@gm...> - 2008-07-15 23:15:08
|
Thanks Michael, I got the code working. I used *: perform @ execute ;* , did not need the "compile" word. I also had to tweak the code a bit to take care of atmel 16 bit word addressing, but apart from that it works fine. I will post the code to be included in the library, that is if anyone finds writing state machines useful, I personally use them all the time to make code faster and more readable ...... Cheers, Bernie On Wed, Jul 16, 2008 at 10:37 AM, Kalus Michael <mic...@on...> wrote: > Bernhard. > > Am 15.07.2008 um 03:03 schrieb Bernard Mentink: > > > > > Also, in the FSM code he defines a PERFORM word as: .... : PERFORM > > compile > > @ compile execute ; > > Would the same thing in amForth be: .... : PERFORM defer @ defer > > execute ; > > or do we still use "compile"???? I am a bit > > rusty on what "defer" does. > > > > No idea what ist goin on here. > > I found a definition in former F83 for the 6502 cpu: > > : PERFORM ( ADDR -- ) @ EXECUTE ; > > > gforth doc says: > ...execute performs the semantics represented by the > XT (i.e., for XTs produced with ' the interpretation semantics). > > So: ' swap execute simply does SWAP > > To get an execution vector you can store an XT (execution token) into > a variable and PERFORM this variable with the phrase @ EXECUTE > > > > variable dance > > ' hiphop dance ! > ... > perform dance > ... > ' walz dance ! > ... > perform dance > > > Does this help? Michael > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > |