Scott Dattalo tried to tell me... >Here's another PIC bit-banging challenge. Given a two-bit variable >create the three-bit variable: > > A | B >-------+-------- > 00 | 000 > 01 | 001 > 10 | 011 > 11 | 111 > >Bonus points to those who can: > 1) Keep A unchanged 1 point > 2) Clear the remaining bits of B 1 points > 3) Isosynchronous execution 3 points > 4) Keep W unchanged 5 points > >Execution points: 15 - (maximum cycles to complete) Here's my code: out goto Done start btfss A, 1 goto out btfsc A, 0 bsf A, 2 bsf A, 0 Done whatever This scores 18 cycles - 5 (15 -5 = 10) isosynchronous 3 w intact 5 I'm assuming that the rest bit 2 of A is clear initially. If it's not, insert the following at start: start movlw kMASK xorwf A, F for a new score of 12 or, insert this at start start bcf A, 2 for a new score of 17 Jason