From: Bernard M. <bme...@gm...> - 2008-07-15 01:03:20
|
Hi All, I am trying to implement some "finite state machine" code from J. Noble. In his example code from an older Forth standard, he uses the word TUCK derived from "under" as ..... : TUCK compile under ; I cannot find the words tuck or under in amForth core words, does anyone have the definition for "tuck" at hand? 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. And lastly, the FSM code is: : FSM: ( width -- ) CREATE , ] DOES> ( n adr -- ) TUCK @ mystate @ * + CELLS CELL+ + ( adr') PERFORM ; I notice he enters into compile mode with the "]" word just before the DOES> word, is that necessary to do with the latest CREATE/DOES code? Thanks in advance .. Bernie |