showa movlw pa_val ;send "PORTA = "
call strsend
movlw 0x08 ;set bitnum counter variable
movwf bitnum
movff PORTA,temp1 ;save PORTA value in temp1
a_loop rlcf temp1 ;rotate bit into carry
bnc a_30 ;is the bit set?
movlw 0x31 ;yes, rs_send $31
call rs_send
goto a_bump
a_30 movlw 0x30 ;rs_send $30
call rs_send
a_bump decfsz bitnum ;decrement counter
goto a_loop ;counter not zero, go again
movlw 0x0d ;rs_send CR
call rs_send
movlw 0x0a ;rs_send NL
call rs_send
return