Anthony Toft wrote: > A ways back there was some discussion on the use of finite state > machines (FSM) in designing software for the PIC. > > I have been thinking about writing a compiler for the PIC basically > since I started messing with them, but there are several out there or in > the works... > > So I have decided to make an FSM compiler, you define the FSM in a > structured language, and the resulting ASM makes the pic behave as > described. This is like defining a high level language based on the capabilities of the machine code of the processor, when what you really want to do is define a high level language based on the needs of the human programmer. In the first instance you end up with an assembler, in the second you end up with a high level language like PASCAL, LISP or SQL. FSM is one of the few programming techniques that really should be implemented in a graphical programming language. State diagrams cut through all the BS and hard to visualise interactions in an FSM. Trying to visualise a non trivial FSM without the use of state diagrams is like trying to read with your eyes closed. There are many state machine compilers, libraries and tools available on the net. I strongly recommend you play with a few and find out what their strengths and weaknesses are before you decide to embark on this. If your tool is not going to be at least as good as these you may as well use one of these instead. > > Is there any need for this? If there is and you'd use it, what would you > like to see in it? What language would you like to see it modeled on (C, > Pascal)? How would you like it to look (file structure)? What features > would you like to see? > > Anthony Regards Sergio Masci http://www.xcprod.com/titan/XCSB - optimising structured PIC BASIC compiler -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.