Hmm, it appears that the spaces were stripped from my message, leaving the loops unlabeled. Oh well, here's the same thing with markers to validate the spaces: > movf PORTB, 0 > movwf port_contents > movf bit_to_test, 0 ; check whatever bit # you want > movwf count > sublw 0x07 ; must be <= 7 > btfss STATUS, C > goto skip_check > incf count ; bit 0 needs one rrf > clrc >Loop > rrf port_contents > decfsz count > goto Loop > btfss STATUS, C ; check the desired bit > goto bit_was_clear > goto bit_was_set >skip_check >.... _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.