On Sunday 17 October 2004 12:26 pm, Wouter van Ooijen wrote: > > if (foo == 3) { > > > > would collect "foo" and subtract the #3 to test for zero > > > > if (3 == foo) { > > > > would collect 3, place it on the stack, then collect foo, > > then subtract foo from stack value "3" > > stack?? ...just thinking-out-loud that C is supposed to be cross-platform. ;-) C is usually analyzed from left to right. If you wish to speak PIC, you could say a fictional compiler creates this.... if (foo == 3) { movfw foo xorlw 3 skpz goto endif ;do "if" here if (3 == foo) { movlw 3 movwf scratchpad_temp movfw foo xorlw scratchpad_temp skpz goto endif ;do "if" here > Some compilers might do that, but most C compilers for PICs I know will > evaluate 3 == foo and foo == 3 the same way. Jal certainly does. Yes, there are optimizing compilers, but if you want your code to be transportable, you can't assume all compilers optimize to that degree. I've had to optimize more than enough code, so "if (foo == 3) {" has become second nature to me... _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist