> As soon as the whole Hex File has been loaded and Disassembled, > the Optimizer could search for a pattern like > > BSF EECON1,EEPGD > ;...(Any or No instructions that Don't modify EECON1)... > BSF EECON1,RD > > If this sequence is detected, The optimizer might set a flag. > later on while optimizing, it could ignore instructions which > seem absurd to it. I don't see what this does for you. So you can detect code secquences that might be attempts to read or write the program memory. Even if you got this 100% right it doesn't address any of the show stopping issues I described. > There is one more way of detecting it. > Its prudent programming practice to have a goto to skip a table > or any "data" in instructions. > > it could be like: > > goto skip_table > table: > addwf PCL > dt "0123456789" > skip: > ;..(Any instructions)... Again, this is addressing only a tiny part of the problem at best. > And for a novice user, all optimizations will be realtively safe. I don't think there are any meaningful optimizations that can be performed on the final instructions only that are safe. As soon as you move an instruction, you could be breaking references to that address with no way to detect some of those references. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body