but, but, but... Removing page code from a goto that doesn't need it may cause a goto after that to move out of range of the target that was in range that you have already removed paging code from which you would then have to put back and which could then cause another goto to move out of range... ...I just don't see this one as being solvable this way. Somebody please prove me wrong --- James Newton (PICList Admin #3) mailto:jamesnewton@piclist.com 1-619-652-0593 PIC/PICList FAQ: http://www.piclist.com or .org -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Scott Dattalo Sent: Wednesday, May 02, 2001 09:48 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: Super Assembler (parser) Importance: Low On Wed, 2 May 2001, James Newton wrote: > How would you account for the movement of code near the end of the program > as a result of the insertion or deletion of page directives earlier in the > code? E.g. You process a forward goto that you see does not require a page > setting because it is in the same page but later you have to add page > setting code for another goto between the first one and the first ones > target. Now the first gotos target is pushed out of range and requires > paging code. Going back to insert it might even cause the second goto to > pushed in range of its target and removal of its page setting code may bring > the first goto target back in range. First of all, I don't have this implemented and have not given it a significant amount of thought. But, one way to approach this problem is to begin by assuming the worst case scenario - all gotos will cross the dreaded page boundary. Then as a post processing step, you go back and analyze that assumption and remove all cases that don't cross the boundary. The way the pCode optimizer works in SDCC right now is that it will continue to loop on the rule processing until no more rules are applicable. So the boundary condition you described (of instructions being pushed away or towards the code page boundary) will be handled by multiple passes through the optimizer. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads