Scott, The problem here is that every time you 'RRF PORTA', the entire port it read, and the first bit is rotated into the C bit. Rather than rotating the port each time, you need to read the port into memory first, then rotate that data. Example: (sorry for the mixed Parallax & Microchip mnemonics) movw porta movf myvar, w rrf myvar btfsc status, c goto code1 rrf myvar btfsc status, c goto code2 . . . Only problem this creates is that any changes in portA during processing are not recognized until next time through this code. Mitch Miller Omaha, NE mdmiller2@home.com ----- Original Message ----- From: Scott To: Sent: Tuesday, October 19, 1999 8:02 PM Subject: Polling PortA > I want to use portA to read two switches for one project and four > switches for another. How do I make each bit rotate through the carry > flag consecutivly. I have been using the following code, but it only > reads the first bit. I am using a 16c56 > > > movlw 0x0F > tris PORTA > movlw 0x00 > tris PORTB > > input bcf STATUS, C > rrf PORTA, W > btfsc STATUS, C > goto code_1 > rrf PORTA, W > btfsc STATUS, C > goto code_2 > goto input > > I was able to write the rest of this program and simulate it with > success and I have been stareing at this part for four hours with no > luck. > > Scott