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. -----Original Message----- From: Josh Koffman [mailto:listsjosh@3MTMP.COM] Sent: Thursday, December 19, 2002 6:49 PM To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]: Quick Binary logic check 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 I changed the name of my register to TEMP so it wouldn't be quite so confusing. Thanks! Josh -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams -- 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 -- 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