org 0x00
#include <p16f877a.inc>
__CONFIG _HS_OSC &_WDT_OFF &_PWRTE_ON &_LVP_OFF
bsf STATUS,5
movlw 0x24
movwf TXSTA
movlw D'77'
movwf SPBRG
movlw 0x00
movwf TRISC
movlw b'00100100'
movwf TXSTA ;enable Async Transmission, set brgh
bcf STATUS,5
bsf RCSTA,7
loop
movlw 'S'
call test
movlw 'h'
call test
movlw 'e'
call test
movlw 'r'
call test
movlw 'i'
call test
movlw A't'
call test
movlw A'r'
call test
movlw A'o'
call test
movlw A'n'
call test
movlw A'i'
call test
movlw A'c'
call test
movlw A's'
call test
movlw A' '
call test
movlw A'P'
call test
movlw A'A'
call test
movlw A'F'
call test
movlw A'-'
call test
movlw A'K'
call test
movlw A'I'
call test
movlw A'E'
call test
movlw A'T'
call test
movlw 0x0d
call test
movlw 0x0a
call test
call DELAY_100MS
goto fin
test
movwf TXREG
again
btfss PIR1,4
goto again
return
fin
call DELAY_1S
goto loop
DELAY EQU 0x20
DELAY_2 EQU 0x21
DELAY_1 EQU 0x22
DELAY_100MS:
MOVLW D'255'
MOVWF DELAY_2
DELAY_LOOP1_NEST:
MOVLW D'255'
MOVWF DELAY
DELAY_LOOP1:
DECFSZ DELAY,F
goto DELAY_LOOP1
DECFSZ DELAY_2,F
goto DELAY_LOOP1_NEST
return
DELAY_1S:
MOVLW D'250' ; Setting counter value of 150
MOVWF DELAY_1 ; Moving count value to DELAY
LOOP1: ; Producing the delay
MOVLW D'50' ;
MOVWF DELAY ;
LOOP2: ;
MOVLW D'45' ;
MOVWF DELAY_2 ;
LOOP3:
DECFSZ DELAY_2,F;
GOTO LOOP3
DECFSZ DELAY,F;
GOTO LOOP2 ;
DECFSZ DELAY_1,F ; Decrement, skip next if DELAY=0
GOTO LOOP1 ; Next instruction
RETURN
end