if(bit1) bit2=1;else bit2=0; is shorter.
Not really. "if(bit1) bit2=1;else bit2=0;" compiles into 5 instructions while "bit2 = bit1;" into 4 instructions when bit2 is declared as volatile.
Regards,
Pavel
<{POST_SNAPBACK}>
This is what I got
CLRF CompTempVar164
BTFSC gbl_bit1,0
INCF CompTempVar164, F
BTFSC CompTempVar164,0
BSF gbl_bit2,6
BTFSS CompTempVar164,0
BCF gbl_bit2,6
The transfer itself is 4 but the setup is another 3.