>> Greetings, >> 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 are a few of my favorite 'instant' code-squeezing methods, none of which require a great deal of analysis of code (and therefore useful when going back to code written a long time ago & trying to squeeze a few small mods..). Any sequence of call xxx movlw yyy can usually be shrunk by omitting the MOVLW and RETLW'ing yyy in subroutine xxx (obviously as long as other calls don't use a returned W value from that routine). Obviously if the same value of yyy is used more than once, use this value so you can lose more than one MOVLW. Any sequence of more than two instructions which is used more than once can be shortened by putting it in a subroutine - the code structure may not look pretty but when you're that short of space, ANYTHING GOES & to hell with pretttiness! Remember that putting it in a subroutine also allows the RETLW trick above. This is very amenable to someone writing a utility to search and tabulate all such repeats - any takers? Any subroutine which is called only once can usually be put in-line (see comment above regarding structure!) . If you want it to be more readable, put the code in a macro. Remember that some SFRs and bits in SFRs can often be used as RAM - ADRES is my usual favorite, as it only gets overwritten by an adc conversion. I'm probably stating the obvious to most programmers, but just in case... (and this applies to almost any processor)- any code that goes call xxx return can be replaced by goto xxx ____ ____ _/ L_/ Mike Harrison / White Wing Logic / wwl@netcomuk.co.uk _/ L_/ _/ W_/ Hardware & Software design / PCB Design / Consultancy _/ W_/ /_W_/ Industrial / Computer Peripherals / Hazardous Area /_W_/