Najemy, Daniel wrote: > > Good morning - > > I'm trying to do the following: > > I have a byte (let's call it TEMP), and I'm trying to logically 'OR' > together 3 of the bits within the byte. > > ie. RESULT = (TEMP,3) or (TEMP,4) or (TEMP,5) > > There doesn't seem to be any bit wise 'or' functions. Any ideas on how > to implement this? Yeah, we had this discussion a few months back. Using the nomenclature then, here's a way to or two arbitrary bits in two aribtrary registers and place the result in another arbitray register: e.g. C.bit_C = A.bit_a | B.bit_b: BCF C,bit_c BTFSS A,bit_a BTFSC B,bit_b BSF C,bit_c Which could be extended for three or more bits. However in your case, there's even a simpler trick: CLRF RESULT ;Assume all three bits are low MOVF TEMP,W ANDLW (1<<3) | (1<<4) | (1<<5) SKPZ INCF RESULT ;At least one bit was high Scott -- __o I buy pizza instead of gas. \< (*)/(*)