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? > > Thanks in advance > > Daniel Najemy - Data General Corporation, Numaliine Power Systems if you are talking about doing or with higher with lower nibbles this is what you can do. cblock 00 lower result endc movf temp,w ; temp is your byte example 00001111 swapf temp,w ; now temp is 11110000 movwf lower ; save swaped nibbles iorwf temp,w ; do or w with temp w is lower and temp is higher movwf result ; save it in result movwf portb ; display the result on portb it is not tested if this is what you need I can make it work and send it to you. Andre Abelian ========================================== = http://www.compufire.com = = mailto:andre@compufire.com = = mailto:mcu-engineering@compufire.com = = Andre Abelian: Engine Electronics, Inc.= = Tel 909-589-5485 Fax 909-598-5695 = ==========================================