Nice idea for a small program that runs top to bottom in one pass. In practice, I think if you could find a way to exercise all the paths through your code reliably, you could make a fortune marketing it as a test tool! I think code which fills a 14000 will have a number of possible paths - especially as the original purpose of this thread is to find the unused backwaters! I'm sure someone out there with time on their hands will have started work on the 'dead code detector' killer app! Incidentally, I looked at writing a code analyser some time ago ,using the .COD file as input, but gave up due to lack of documentation. Anyone know where .COD format is documented? Neil ---------- From: Norm Cramer Sent: 31 March 1998 14:21 To: PICLIST@MITVMA.MIT.EDU Subject: Re: Wanted: Utility that detects dead PIC code segments >At 23:42 30/03/98 -0600, Scott Newell wrote: >>> 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. >> What about running the program in MPLAB with a trace of all addresses. When the run is done, sort the trace file in address order and look for holes (no code executed there). These will be unused code in your particular test. Norm