Hello : I want to optimize this : If number = 2 then var = xxABxxxx If number = 1 then var = xxxxABxx If number = 0 then var = xxxxxxAB I wrote this large code (assuming A is '0' and B is '1'): movlw 0x02 BANKSEL number xorwf number, W bz n2 ; number is 2, so branch to n2 movlw 0x01 xorwf number, W bz n1 ; number is 1, branch to n1 bcf var, 0x01 ;number is 0, write xxxxxxAx bsf var, 0x00 ; write xxxxxxxB goto finish n2 bcf var, 0x05 ; write xxAxxxxx bsf var, 0x04 ; write xxxBxxxx goto finish n1 bcf var, 0x03 ; write xxxxAxxx bsf var, 0x02 ; write xxxxxBxx finish ... ... ... more code ... ... ... Anyone knows how to optimize that? -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body