Jeethru said: > > Detecting and Adjusting references is one of the most basic things an > > optimizer should be capable of doing. This is especially true on a PIC > > since there are only 2 instructions capable of directly modifying the > > program counter, CALL and GOTO. And there might also be instructions > > which add/move/subtract(i've never seen this) to the PCL register. > > This should be no trouble detecting. Olin responded: > I think we're going in circles here. A few posts ago I should, as an > example, a MOVLW instruction that might or might not need to be adjusted > depending on the program intent. The problem is that there is no way to > know that intent by just looking at the final instructions. It's not just > instructions that modify the program counter that matter. Any reference to > a program memory address needs to be adjusted, and there is no way to find > all the instructions that do this. > > I've been trying to say basically the same thing for several posts in a row. > Maybe I'm not explaining this well, but either way I'm getting tired of it. > Perhaps others can jump in here, I'm done responding to this issue. Believe > what you like. Go ahead and try it. I add: Olin is 100% right. Object code is not the place to start doing these optimizations. In general, it is IMPOSSIBLE to determine the intent of a specific instruction like his MOVLW's. As he said -- if you think you can do it go ahead and try. But I will be _highly_ surprised if you succeed. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads