On Wednesday 20 October 2004 12:17 am, Jan-Erik Soderholm wrote: > Well, earlier you wrote : > > if (foo[bar++] > 3) <-might be nice on a chip with pre/post > > inc pointers such as 6809 but probably comes out > > horrible on PIC. > > I was just asking why that whould "come out horrible > on a PIC". I was thinking of a certain x86 processor doing far pointers using 16bit commands when I said that, and therefore expected to see a fair bit of register swaps using dx,ax,ds and more. I was also thinking about some rather large embedded programs which produced about 8k of code and did a lot of Freg swapping.... example routineX uses F10,F11,F12 as temp, but routineY also uses F10,F11, so a couple routines call both routineX and routineY, therefore you got a fair bit of swapping in/out of F10,F11 due to the conflicting routines (problem due to not being able to hold values on a stack). (just guessing steps required since got no compiler to verify) movfw bar incf bar,f addwf foo,w movwf IND0 etc... which is reasonable... Basically, call that statement I made earlier, a mistake on my part. I shouldn't apply large ideas to a PIC since it's going to deal with tiny tables & re-use some registers within a limited prog + mem space anyways. BTW, since you're hanging on that statement ready to pound it into the ground, I'm guessing you looked at it and got a ready reply... ....so what did your compiler produce? _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist