                device pic16c71,hs_osc,wdt_off,pwrt_off,protect_off
                id 'sr01'
        include 'mheader.src'

RA3         =   ra.3
RB5         =   rb.5
            
            org     0h
            jmp     5
            org 4h            
doint       jmp     rcv
            org 5h
            clr     PCLATH
            clrb    rp0
            mov     ADCON0, #10000001b
            mov	    INTCON, #00100000b	;RTCC, INT IRQ enabled
            call    dally
            setb    rp0
            mov     TRISA, #0011b
            mov     TRISB, #00000001b
            mov     OPTION, #00000011b  ;RTCC=inst,RB pull-up, /4   
            mov     ADCON1, #00000010b
            clrb    rp0
            mov     RTCC, #fullframe
            setb    waitb
            clrb    inmsg
            clr     ra
            clr     rb
            setb    TXSWTCH
            clrb    PTX
            clr     FSR
            setb    GIE
main        nop
            setb    RA3
            nop
            clrb    RA3
            clrb    RB5
            nop
            jmp     main
rcv         mov     RTCC, #fullframe
            mov     mybyte, #85 ; U
            call    sout
            mov     mybyte, #109; m
            call    sout
            mov     mybyte, #107; k
            call    sout
            mov     mybyte, #103; g
            call    sout
;           jb      waitb, mloop
;            jb      inmsg, msg_demod
intend      clrb    RTIF
            reti

                    INCLUDE 'msgdemod.src'
                    INCLUDe 'collect.src'
                    
dally		mov	tempa,#255
:l1		mov	tempb,#255
:l2		djnz	tempb,:l2
		djnz	tempa,:l1
		ret

