
_interrupt:

;RTCC.mpas,25 :: 		begin
;RTCC.mpas,26 :: 		USB_Interrupt_Proc();
	CALL        _USB_Interrupt_Proc+0, 0
;RTCC.mpas,27 :: 		end;
L_end_interrupt:
L__interrupt22:
	RETFIE      1
; end of _interrupt

_RTCC_WrEn:

;RTCC.mpas,30 :: 		begin
;RTCC.mpas,31 :: 		EECON2 := 0x55;
	MOVLW       85
	MOVWF       EECON2+0 
;RTCC.mpas,32 :: 		EECON2 := 0xAA;
	MOVLW       170
	MOVWF       EECON2+0 
;RTCC.mpas,33 :: 		RTCWREN_bit := 1;
	BSF         RTCWREN_bit+0, 5 
;RTCC.mpas,34 :: 		end;
L_end_RTCC_WrEn:
	RETURN      0
; end of _RTCC_WrEn

_RTCC_Read:

;RTCC.mpas,37 :: 		begin
;RTCC.mpas,38 :: 		RTCCFG := %10000011; //Set RTCPTR to 11
	MOVLW       131
	MOVWF       RTCCFG+0 
;RTCC.mpas,39 :: 		while RTCSYNC_bit = 1 do
L__RTCC_Read4:
	BTFSS       RTCSYNC_bit+0, 4 
	GOTO        L__RTCC_Read5
;RTCC.mpas,41 :: 		bytYear   := Bcd2Dec(RTCVALL);
	MOVF        RTCVALL+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _bytYear+0 
	GOTO        L__RTCC_Read4
L__RTCC_Read5:
;RTCC.mpas,42 :: 		bytMonth  := Bcd2Dec(RTCVALH); //Just to decrement RTCPTR
	MOVF        RTCVALH+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _bytMonth+0 
;RTCC.mpas,43 :: 		bytDay    := Bcd2Dec(RTCVALL);
	MOVF        RTCVALL+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _bytDay+0 
;RTCC.mpas,44 :: 		bytMonth  := Bcd2Dec(RTCVALH);
	MOVF        RTCVALH+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _bytMonth+0 
;RTCC.mpas,45 :: 		bytHour   := Bcd2Dec(RTCVALL);
	MOVF        RTCVALL+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _bytHour+0 
;RTCC.mpas,46 :: 		bytWkDay  := Bcd2Dec(RTCVALH);
	MOVF        RTCVALH+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _bytWkDay+0 
;RTCC.mpas,47 :: 		bytSecond := Bcd2Dec(RTCVALL);
	MOVF        RTCVALL+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _bytSecond+0 
;RTCC.mpas,48 :: 		bytMinute := Bcd2Dec(RTCVALH);
	MOVF        RTCVALH+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _bytMinute+0 
;RTCC.mpas,49 :: 		end;
L_end_RTCC_Read:
	RETURN      0
; end of _RTCC_Read

_RTCC_Write:

;RTCC.mpas,52 :: 		begin
;RTCC.mpas,53 :: 		RTCC_WrEn();
	CALL        _RTCC_WrEn+0, 0
;RTCC.mpas,54 :: 		RTCCFG := %10100011; //Set RTCPTR to 11
	MOVLW       163
	MOVWF       RTCCFG+0 
;RTCC.mpas,55 :: 		RTCVALL := Dec2Bcd(bytYear);
	MOVF        _bytYear+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALL+0 
;RTCC.mpas,56 :: 		RTCVALH := Dec2Bcd(bytMonth); //Just to decrement RTCPTR
	MOVF        _bytMonth+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALH+0 
;RTCC.mpas,57 :: 		RTCVALL := Dec2Bcd(bytDay);
	MOVF        _bytDay+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALL+0 
;RTCC.mpas,58 :: 		RTCVALH := Dec2Bcd(bytMonth);
	MOVF        _bytMonth+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALH+0 
;RTCC.mpas,59 :: 		RTCVALL := Dec2Bcd(bytHour);
	MOVF        _bytHour+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALL+0 
;RTCC.mpas,60 :: 		RTCVALH := Dec2Bcd(bytWkDay);
	MOVF        _bytWkDay+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALH+0 
;RTCC.mpas,61 :: 		RTCVALL := Dec2Bcd(bytSecond);
	MOVF        _bytSecond+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALL+0 
;RTCC.mpas,62 :: 		RTCVALH := Dec2Bcd(bytMinute);
	MOVF        _bytMinute+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALH+0 
;RTCC.mpas,63 :: 		RTCWREN_bit := 0;
	BCF         RTCWREN_bit+0, 5 
;RTCC.mpas,64 :: 		end;
L_end_RTCC_Write:
	RETURN      0
; end of _RTCC_Write

_GenerateDigits:

;RTCC.mpas,67 :: 		begin
;RTCC.mpas,68 :: 		pos^ := (value div 10) + 48;
	MOVFF       FARG_GenerateDigits_value+0, FSR0
	MOVFF       FARG_GenerateDigits_value+1, FSR0H
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	MOVLW       10
	MOVWF       R4 
	CALL        _Div_8x8_U+0, 0
	MOVFF       FARG_GenerateDigits_pos+0, FSR1
	MOVFF       FARG_GenerateDigits_pos+1, FSR1H
	MOVLW       48
	ADDWF       R0, 0 
	MOVWF       POSTINC1+0 
;RTCC.mpas,69 :: 		Inc(pos);
	INFSNZ      FARG_GenerateDigits_pos+0, 1 
	INCF        FARG_GenerateDigits_pos+1, 1 
;RTCC.mpas,70 :: 		pos^ := (value mod 10) + 48;
	MOVFF       FARG_GenerateDigits_value+0, FSR0
	MOVFF       FARG_GenerateDigits_value+1, FSR0H
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	MOVLW       10
	MOVWF       R4 
	CALL        _Div_8x8_U+0, 0
	MOVF        R8, 0 
	MOVWF       R0 
	MOVFF       FARG_GenerateDigits_pos+0, FSR1
	MOVFF       FARG_GenerateDigits_pos+1, FSR1H
	MOVLW       48
	ADDWF       R0, 0 
	MOVWF       POSTINC1+0 
;RTCC.mpas,71 :: 		end;
L_end_GenerateDigits:
	RETURN      0
; end of _GenerateDigits

_GenerateRTCCString:

;RTCC.mpas,75 :: 		begin
;RTCC.mpas,76 :: 		pos := @rtccstring;
	MOVF        FARG_GenerateRTCCString_rtccstring+0, 0 
	MOVWF       GenerateRTCCString_pos+0 
	MOVF        FARG_GenerateRTCCString_rtccstring+1, 0 
	MOVWF       GenerateRTCCString_pos+1 
;RTCC.mpas,77 :: 		rtccstring := '00-00-00 00:00:00';
	MOVF        FARG_GenerateRTCCString_rtccstring+0, 0 
	MOVWF       FSR1 
	MOVF        FARG_GenerateRTCCString_rtccstring+1, 0 
	MOVWF       FSR1H 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       45
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       45
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       32
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       58
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       58
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	MOVLW       48
	MOVWF       POSTINC1+0 
	CLRF        POSTINC1+0 
;RTCC.mpas,78 :: 		GenerateDigits(bytYear, pos);
	MOVLW       _bytYear+0
	MOVWF       FARG_GenerateDigits_value+0 
	MOVLW       hi_addr(_bytYear+0)
	MOVWF       FARG_GenerateDigits_value+1 
	MOVF        GenerateRTCCString_pos+0, 0 
	MOVWF       FARG_GenerateDigits_pos+0 
	MOVF        GenerateRTCCString_pos+1, 0 
	MOVWF       FARG_GenerateDigits_pos+1 
	CALL        _GenerateDigits+0, 0
;RTCC.mpas,79 :: 		pos := pos + 3;
	MOVLW       3
	ADDWF       GenerateRTCCString_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      GenerateRTCCString_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       GenerateRTCCString_pos+0 
	MOVF        R1, 0 
	MOVWF       GenerateRTCCString_pos+1 
;RTCC.mpas,80 :: 		GenerateDigits(bytMonth, pos);
	MOVLW       _bytMonth+0
	MOVWF       FARG_GenerateDigits_value+0 
	MOVLW       hi_addr(_bytMonth+0)
	MOVWF       FARG_GenerateDigits_value+1 
	MOVF        R0, 0 
	MOVWF       FARG_GenerateDigits_pos+0 
	MOVF        R1, 0 
	MOVWF       FARG_GenerateDigits_pos+1 
	CALL        _GenerateDigits+0, 0
;RTCC.mpas,81 :: 		pos := pos + 3;
	MOVLW       3
	ADDWF       GenerateRTCCString_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      GenerateRTCCString_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       GenerateRTCCString_pos+0 
	MOVF        R1, 0 
	MOVWF       GenerateRTCCString_pos+1 
;RTCC.mpas,82 :: 		GenerateDigits(bytDay, pos);
	MOVLW       _bytDay+0
	MOVWF       FARG_GenerateDigits_value+0 
	MOVLW       hi_addr(_bytDay+0)
	MOVWF       FARG_GenerateDigits_value+1 
	MOVF        R0, 0 
	MOVWF       FARG_GenerateDigits_pos+0 
	MOVF        R1, 0 
	MOVWF       FARG_GenerateDigits_pos+1 
	CALL        _GenerateDigits+0, 0
;RTCC.mpas,83 :: 		pos := pos + 3;
	MOVLW       3
	ADDWF       GenerateRTCCString_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      GenerateRTCCString_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       GenerateRTCCString_pos+0 
	MOVF        R1, 0 
	MOVWF       GenerateRTCCString_pos+1 
;RTCC.mpas,84 :: 		GenerateDigits(bytHour, pos);
	MOVLW       _bytHour+0
	MOVWF       FARG_GenerateDigits_value+0 
	MOVLW       hi_addr(_bytHour+0)
	MOVWF       FARG_GenerateDigits_value+1 
	MOVF        R0, 0 
	MOVWF       FARG_GenerateDigits_pos+0 
	MOVF        R1, 0 
	MOVWF       FARG_GenerateDigits_pos+1 
	CALL        _GenerateDigits+0, 0
;RTCC.mpas,85 :: 		pos := pos + 3;
	MOVLW       3
	ADDWF       GenerateRTCCString_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      GenerateRTCCString_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       GenerateRTCCString_pos+0 
	MOVF        R1, 0 
	MOVWF       GenerateRTCCString_pos+1 
;RTCC.mpas,86 :: 		GenerateDigits(bytMinute, pos);
	MOVLW       _bytMinute+0
	MOVWF       FARG_GenerateDigits_value+0 
	MOVLW       hi_addr(_bytMinute+0)
	MOVWF       FARG_GenerateDigits_value+1 
	MOVF        R0, 0 
	MOVWF       FARG_GenerateDigits_pos+0 
	MOVF        R1, 0 
	MOVWF       FARG_GenerateDigits_pos+1 
	CALL        _GenerateDigits+0, 0
;RTCC.mpas,87 :: 		pos := pos + 3;
	MOVLW       3
	ADDWF       GenerateRTCCString_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      GenerateRTCCString_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       GenerateRTCCString_pos+0 
	MOVF        R1, 0 
	MOVWF       GenerateRTCCString_pos+1 
;RTCC.mpas,88 :: 		GenerateDigits(bytSecond, pos);
	MOVLW       _bytSecond+0
	MOVWF       FARG_GenerateDigits_value+0 
	MOVLW       hi_addr(_bytSecond+0)
	MOVWF       FARG_GenerateDigits_value+1 
	MOVF        R0, 0 
	MOVWF       FARG_GenerateDigits_pos+0 
	MOVF        R1, 0 
	MOVWF       FARG_GenerateDigits_pos+1 
	CALL        _GenerateDigits+0, 0
;RTCC.mpas,89 :: 		pos := pos + 3;
	MOVLW       3
	ADDWF       GenerateRTCCString_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      GenerateRTCCString_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       GenerateRTCCString_pos+0 
	MOVF        R1, 0 
	MOVWF       GenerateRTCCString_pos+1 
;RTCC.mpas,90 :: 		pos^ := 0;
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	CLRF        POSTINC1+0 
;RTCC.mpas,91 :: 		end;
L_end_GenerateRTCCString:
	RETURN      0
; end of _GenerateRTCCString

_USB_RTCC:

;RTCC.mpas,94 :: 		begin
;RTCC.mpas,95 :: 		GenerateRTCCString(USBout);
	MOVLW       _USBout+0
	MOVWF       FARG_GenerateRTCCString_rtccstring+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_GenerateRTCCString_rtccstring+1 
	CALL        _GenerateRTCCString+0, 0
;RTCC.mpas,96 :: 		strcat(USBout, chr(13) + chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcat_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcat_s1+1 
	MOVLW       13
	MOVWF       ?LocalText_USB_RTCC+0 
	MOVLW       10
	MOVWF       ?LocalText_USB_RTCC+1 
	MOVLW       0
	MOVWF       ?LocalText_USB_RTCC+2 
	MOVLW       ?LocalText_USB_RTCC+0
	MOVWF       FARG_strcat_s2+0 
	MOVLW       hi_addr(?LocalText_USB_RTCC+0)
	MOVWF       FARG_strcat_s2+1 
	CALL        _strcat+0, 0
;RTCC.mpas,97 :: 		HID_Write(@USBout, 64);
	MOVLW       _USBout+0
	MOVWF       FARG_HID_Write_writebuff+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_HID_Write_writebuff+1 
	MOVLW       64
	MOVWF       FARG_HID_Write_len+0 
	CALL        _HID_Write+0, 0
;RTCC.mpas,98 :: 		end;
L_end_USB_RTCC:
	RETURN      0
; end of _USB_RTCC

_TestRTCC_Write:

;RTCC.mpas,101 :: 		begin
;RTCC.mpas,102 :: 		bytYear := 86;
	MOVLW       86
	MOVWF       _bytYear+0 
;RTCC.mpas,103 :: 		bytMonth := 07;
	MOVLW       7
	MOVWF       _bytMonth+0 
;RTCC.mpas,104 :: 		bytDay := 12;
	MOVLW       12
	MOVWF       _bytDay+0 
;RTCC.mpas,105 :: 		bytHour := 05;
	MOVLW       5
	MOVWF       _bytHour+0 
;RTCC.mpas,106 :: 		bytMinute := 08;
	MOVLW       8
	MOVWF       _bytMinute+0 
;RTCC.mpas,107 :: 		bytSecond := 03;
	MOVLW       3
	MOVWF       _bytSecond+0 
;RTCC.mpas,108 :: 		RTCC_Write();
	CALL        _RTCC_Write+0, 0
;RTCC.mpas,109 :: 		end;
L_end_TestRTCC_Write:
	RETURN      0
; end of _TestRTCC_Write

_main:

;RTCC.mpas,111 :: 		begin
;RTCC.mpas,112 :: 		OSCCON := %01110000; //8MHz
	MOVLW       112
	MOVWF       OSCCON+0 
;RTCC.mpas,113 :: 		PLLEn_bit := 1; //Enable PLL (now 48MHz)
	BSF         PLLEN_bit+0, 6 
;RTCC.mpas,116 :: 		T1OSCEN_bit := 1;
	BSF         T1OSCEN_bit+0, 3 
;RTCC.mpas,117 :: 		RTCC_WrEn();
	CALL        _RTCC_WrEn+0, 0
;RTCC.mpas,118 :: 		RTCEN_bit := 1;
	BSF         RTCEN_bit+0, 7 
;RTCC.mpas,119 :: 		RTCWREN_Bit := 0;
	BCF         RTCWREN_bit+0, 5 
;RTCC.mpas,121 :: 		HID_Enable(@USBin, @USBout);
	MOVLW       _USBin+0
	MOVWF       FARG_HID_Enable_readbuff+0 
	MOVLW       hi_addr(_USBin+0)
	MOVWF       FARG_HID_Enable_readbuff+1 
	MOVLW       _USBout+0
	MOVWF       FARG_HID_Enable_writebuff+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_HID_Enable_writebuff+1 
	CALL        _HID_Enable+0, 0
;RTCC.mpas,122 :: 		USBout := 'Breeze RTCC' + chr(13) + chr(10);
	MOVLW       66
	MOVWF       _USBout+0 
	MOVLW       114
	MOVWF       _USBout+1 
	MOVLW       101
	MOVWF       _USBout+2 
	MOVLW       101
	MOVWF       _USBout+3 
	MOVLW       122
	MOVWF       _USBout+4 
	MOVLW       101
	MOVWF       _USBout+5 
	MOVLW       32
	MOVWF       _USBout+6 
	MOVLW       82
	MOVWF       _USBout+7 
	MOVLW       84
	MOVWF       _USBout+8 
	MOVLW       67
	MOVWF       _USBout+9 
	MOVLW       67
	MOVWF       _USBout+10 
	MOVLW       13
	MOVWF       _USBout+11 
	MOVLW       10
	MOVWF       _USBout+12 
	MOVLW       0
	MOVWF       _USBout+13 
;RTCC.mpas,123 :: 		HID_Write(@USBout, 64);
	MOVLW       _USBout+0
	MOVWF       FARG_HID_Write_writebuff+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_HID_Write_writebuff+1 
	MOVLW       64
	MOVWF       FARG_HID_Write_len+0 
	CALL        _HID_Write+0, 0
;RTCC.mpas,125 :: 		TestRTCC_Write();
	CALL        _TestRTCC_Write+0, 0
;RTCC.mpas,127 :: 		TRISC2_bit := 0;
	BCF         TRISC2_bit+0, 2 
;RTCC.mpas,128 :: 		LATC2_bit := 0;
	BCF         LATC2_bit+0, 2 
;RTCC.mpas,130 :: 		while(1) do begin
L__main15:
;RTCC.mpas,131 :: 		LATC2_bit := 1;
	BSF         LATC2_bit+0, 2 
;RTCC.mpas,132 :: 		RTCC_Read();
	CALL        _RTCC_Read+0, 0
;RTCC.mpas,133 :: 		USB_RTCC();
	CALL        _USB_RTCC+0, 0
;RTCC.mpas,134 :: 		delay_ms(100);
	MOVLW       7
	MOVWF       R11, 0
	MOVLW       23
	MOVWF       R12, 0
	MOVLW       106
	MOVWF       R13, 0
L__main19:
	DECFSZ      R13, 1, 1
	BRA         L__main19
	DECFSZ      R12, 1, 1
	BRA         L__main19
	DECFSZ      R11, 1, 1
	BRA         L__main19
	NOP
;RTCC.mpas,135 :: 		LATC2_bit := 0;
	BCF         LATC2_bit+0, 2 
;RTCC.mpas,136 :: 		delay_ms(900);
	MOVLW       55
	MOVWF       R11, 0
	MOVLW       202
	MOVWF       R12, 0
	MOVLW       211
	MOVWF       R13, 0
L__main20:
	DECFSZ      R13, 1, 1
	BRA         L__main20
	DECFSZ      R12, 1, 1
	BRA         L__main20
	DECFSZ      R11, 1, 1
	BRA         L__main20
;RTCC.mpas,137 :: 		end;
	GOTO        L__main15
;RTCC.mpas,138 :: 		end.
L_end_main:
	GOTO        $+0
; end of _main
