; ; *************************************************************************** ; *** Bubble Software Parallax to PIC Source Converter. Copyright 1999. *** ; *** http://www.picnpoke.com email: sales@picnpoke.com *** ; *************************************************************************** ; ; Device data and reset vector P = pic16c55 #include <16c55.inc> ; processor assembler definitions _CONFIG _xt_osc & _wdt_off & _protect_off reset start Wreg equ d'1' ;you can do this on an SX org 8 NextChar Res d'1' ; Just used to test routine temp Res d'1' ; Temporary variable org 0 start MOVLW 0x47 MOVWF NextChar start_loop MOVF NextChar,w MOVWF temp ;routine starts here BCF status,c ;because on the SX with CARRYX set, carry matters MOVLW 'F' SUBWF temp,w BTFSC status,c GOTO start_Bad MOVLW '0'-1 SUBWF temp,w BTFSS status,c GOTO start_Bad MOVLW '@'+1 SUBWF temp MOVLW '@'-':'+1 ADDWF temp BTFSC status,c GOTO start_BadRestore MOVLW ':'-'0' BTFSS temp,d'7' MOVLW 'A'-'@'+1 ADDWF temp GOTO start_Good start_BadRestore MOVLW ':'-1 ADDWF temp start_Bad NOP GOTO start_Next start_Good NOP start_Next DECFSZ NextChar GOTO start_Loop end end