On 3/17/07, John Dammeyer wrote: > Hi, > > Just for fun I took Orin's version and compiled it with the Bytecraft C. > > It took 33 words including saving the argument which takes 3. Interesting. I was thinking that this was a mistake: > while ( len-- ) > 0998 1283 BCF STATUS,RP0 { > 0999 1703 BSF STATUS,RP1 > 099A 0847 MOVF 147,W > 099B 03C7 DECF 147 > 099C 3800 IORLW 00h Delay_10xUs_2MHz(DITLEN); > 099D 1903 BTFSC STATUS,Z > 099E 29A6 GOTO 09A6h > 099F 3064 MOVLW 64h > 09A0 118A BCF PCLATH,3 > 09A1 160A BSF PCLATH,4 > 09A2 2737 CALL 1737h > 09A3 158A BSF PCLATH,3 > 09A4 120A BCF PCLATH,4 > 09A5 2998 GOTO 0998h } And the code agrees. I should have done: do { Delay(); } while ( --len ); Which the compiler should be able to optimize nicely. Postfix operators tend to generate extra code. This change is only safe since I know I'm going through the loop at least once. Orin. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist