Oops, good catch. That was my mistake in transcribing from the little scrap of paper I was working this out on. Other than that, should my routine work? Josh -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams Doug Hewett wrote: > > The 'lower 6 bits' should be b'00111111' > and the 'upper 2 bits' should be.... > > Your example code takes the upper 6 bits from PORTA inasmuchas it clears the lower 2 bits. > >> Hi, just want to get a quick check of my code. I think it will work, but >> I want to be sure. Basically I want to take the lower 6 bits from PortA, >> the 2 upper bits from PortB, and mask them together into one byte. Will >> this work? >> movf PORTA, W >> andlw b'11111100' >> movwf TEMP >> movf PORTB, W >> andlw b'00000011' >> iorwf TEMP, F -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics