bit_K = 24 ; Change this value for desired
; baud rate as shown in table.
half_bit = bit_K/2
serial_in = ra.2
data_out = rb
; Variable storage above special-purpose registers.
org 8
delay_cntr ds 1 ; counter for serial delay routines
bit_cntr ds 1 ; number of received bits
rcv_byte ds 1 ; the received byte
; Org 0 sets ROM origin to beginning for program.
org 0
; Remember to change device info if programming a different PIC. Do not use RC
; devices. They are not sufficiently accurate or stable for serial communication.
device pic16c54,xt_osc,wdt_off,protect_off
reset begin
; Set up I/O ports.
begin mov !ra, #00000100b ; Use RA.2 for serial input.
mov !rb, #0 ; Output to LEDs.
:start_bit snb serial_in ; Detect start bit. Change to sb
; serial_in if using 22k resistor
; input.
jmp :start_bit ; No start bit yet? Keep watching.
call start_delay ; Wait one-half bit time to the
; middle of the start bit.
jb Serial_in, :start_bit ; If the start bit is still good,
; continue. Otherwise, resume
; waiting.
; Change to jnb Serial_in,
:start_bit
; if using 22k resistor input.
mov bit_cntr, #8 ; Set the counter to receive 8 data
; bits.
clr rcv_byte ; Clear the receive byte to get
; ready for new data.
:receive call bit_delay ; Wait one bit time.
movb c,Serial_in ; Put the data bit into carry.
; Change to movb c,/Serial_in if
; using 22k resistor input.
rr rcv_byte ; Rotate the carry bit into the
; receive byte.
djnz bit_cntr,:receive ; Not eight bits yet? Get next bit.
call bit_delay ; Wait for stop bit.
mov data_out, rcv_byte ; Display data on LEDs.
goto begin:start_bit ; Receive next byte.
here is the complete program if it helps
Ill check out ur tutorials too