> Well, I have managed to completely fill a PIC14000 and >am now looking through the listings trying to find dead code >segments -- like floating point subroutines that are never >called and can be commented out of the code to reclaim more >space. Here's a thought--there are three ways for a routine to run. You can call it, goto it, or run into it. For a quick and dirty utility, it shouldn't be too hard to simply make a table of all the gotos and calls in the entire program. This table contains routines that are probably used. Then run through and look for instructions that are preceded by a goto or return (without a leadig bit test), and check to see if they're in the first table. If not, the execution can't reach that point and it's dead code. This will report tables and other computed goto targets incorrectly, of course. It'll also report routines as used, although the only reference to them may be in other dead routines. Maybe it would be better to start at 0x0000 (and 0x0004), building a tree to keep track of the conditionals. Then run down the branches, marking the code as 'live', until you hit live code. Once you've traversed the entire tree, any code that isn't marked live is dead. (Unless there are computed gotos...) later, newell