Sergio Masci wrote: > > It seems as though two instructions (BTFSC RA3 / BSF RB4) would > > suffice... What three instructions are generated by XCSB? > > Yes you are right two machine instructions would be better than three, > but the point is that three is still increadibly good going when you > concider the amount of source that has been condensed into these three > instructions. > > The three instructions generated by xcsb are: > > btfss 5,3 > goto x_else_0000 > bsf 6,4 > x_else_0000 Sergio: I'm sorry if my comment was misunderstood... I'm aware of the point you were making; I asked about the three instructions only because I was curious. Your compiler's ability to understand what the function parameters actually mean is impressive; I assume that you'll eventually add some peephole optimization as a final step, to clean up simple cases like this one. By the way, do both of these also generate three instructions? proc main() if test_bit(RA3) == 0 then // was originally "== 1" set_bit(RB4) endif proc main() if test_bit(RA3) == 1 then {} else set_bit(RB4) endif -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist