At 12:12 PM 5/30/2003 +0200, you wrote: > > You can implement what you want as bytecode in the eeprom and > > a bytecode interpreter that runs in the pic and executes it. > > Eg. for the expression above it would be in byte code > > something like (after correcting the & in the middle to && > > which is likely what you wanted): > > > > !fetch var1 !fetch var2 !and !sgn !fetch var3 !literal > > 0x0C !sub !sgn !and !if !literal DoSomething !acall !fi > > > > where each word would take one EEPROM cell or more (you can > > compress some of it). > >Ok, It sounds cool! >Instead of coding a complex parser it would be a good idea to store in >eeprom some commands like you explained. To do 'If ((Var1 & >Var2)&(Var3<0x0C))' I will store in eeprom something like: Yes, the parsing could be done off-line on a PC and a simulated stack machine could be coded on the PIC using bytecodes/tokens stored in the EEPROM. I've done this (not with a PIC, but it's no different). Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body