; Simple Example Program #1 PROCESSOR 16F886 INCLUDE INCLUDE cblock 0x20 char: 1 cp: 1 endc org 0x0 goto main org 0x10 main: ; Set PCLATH to the library segment and leave it until we need to ; jump on this page MOVLW HIGH SerialSetup MOVWF PCLATH CALL SerialSetup CLRF PCLATH Top: CLRF cp Loop: CALL GetChar MOVWF char MOVF char,F BTFSC STATUS,Z GOTO Top CALL Xmit INCF cp,F GOTO Loop GetChar: MOVF cp,W ADDWF PCL,F DT "Congratulations from AWC",0x0D,0 Xmit: MOVLW HIGH SerialTransmit MOVWF PCLATH MOVFW char CALL SerialTransmit CLRF PCLATH RETURN END