> 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 > Why wouldn't the compiler just generate: movlw 3 xorwf foo,w skpz goto endif Bob Ammerman RAm Systems _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist