On Fri, 13 Sep 2002, Kari Lehikko wrote: >My first thought was to create a _huge_ switch-case to handle all the >different states of the state machine, but as this switch-case would be >several thousand lines long, the maintaining would be pure hell... even >thinking about searching a specific case every time gives me the creeps. >(I have that kind of approach in one code, wish I've never wrote it...) Usually you generate this state machine code from a higher level code. Petri nets would be one (I have software like this on Linux), a quickly hacked Prolog program another. The latter allows interactive simulation in ways that I like. Check if the compiler is reasonably efficient in compiling switches. If not you will need to build a jump table instead. Also not by hand! Peter -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads