On Tue, 3 Jul 2001 07:31:25 -0400, you wrote: >> I'm thinking of writing an Optimizer for PIC Hex Files. >> It would take in a hex file, Disassemble it, and then >> try various optimizations. > >This is impossible in the general sense. For example, suppose you >encountered > > MOVLW h'3A' > >That could be the low or high byte of an address, or just an arbitrary >constant. There are lots of other gotchas too. You need to know the >original intent of the code to do any meaningful optimizations. Not necessarily true. There are a number of 'peephole' optimisations on short sequences of instructions that can be done with little or no knowledge of the intent, especially on compiler output (OK the compiler should do it, but often doesn't) , as long as you can keep track of things like tables, jump targets and page bits.=20 I would think that a more realistic project might be something which analyses the code and suggests areas where improvements could be made, allowing the user full control.=20 -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.