----- Original Message ----- From: To: Microcontroller discussion list - Public. Sent: Friday, October 08, 2004 4:58 PM Subject: Re: [PIC] new optimisation in XCSB > On Fri, 8 Oct 2004, Sergio Masci wrote: > > > > > An insteresting question is what does you favourite PIC C compiler make of > > > > > > > > if ((A == B) == 0) > > > That's very good. I've seen some really inefficient code generated for this in > > the past. Which compiler is this? > > Hi-Tech PICC. > Thanks for the info. > > Are A and B defined as global or local here? > > They were global to make the assembly listing more readable. When > local, it looks like this: > > 00000A 50E1 movf fsr1l,w,c > 00000C 18D9 xorwf fsr2l,w,c > 00000E A4D8 btfss status,2,c > 000010 8880 bsf 3968,4,c ;volatile > > since no RAM is allocated for A and B. But this is only part of the code, you still need to include the code that calculates the addresses of A and B at run time and prepares fsr1l and fsr2l. Regards Sergio Masci http://www.xcprod.com/titan/XCSB - optimising PIC compiler _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist