
_RTCC_CalcWkDay:

;RTCC.mbas,24 :: 		dim yr as word
;RTCC.mbas,25 :: 		yr = dtmRTCC.Year + 2000
	MOVF        _dtmRTCC+0, 0 
	MOVWF       RTCC_CalcWkDay_yr+0 
	MOVLW       0
	MOVWF       RTCC_CalcWkDay_yr+1 
	MOVLW       208
	ADDWF       RTCC_CalcWkDay_yr+0, 1 
	MOVLW       7
	ADDWFC      RTCC_CalcWkDay_yr+1, 1 
;RTCC.mbas,26 :: 		if (dtmRTCC.Month < 2) then
	MOVLW       2
	SUBWF       _dtmRTCC+1, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L__RTCC_CalcWkDay2
;RTCC.mbas,27 :: 		dec(yr)
	MOVLW       1
	SUBWF       RTCC_CalcWkDay_yr+0, 1 
	MOVLW       0
	SUBWFB      RTCC_CalcWkDay_yr+1, 1 
L__RTCC_CalcWkDay2:
;RTCC.mbas,29 :: 		bytWkDay = (yr + yr/4 - yr/100 + yr/400 + tbl[dtmRTCC.Month - 1] + dtmRTCC.Day) mod 7
	MOVF        RTCC_CalcWkDay_yr+0, 0 
	MOVWF       R0 
	MOVF        RTCC_CalcWkDay_yr+1, 0 
	MOVWF       R1 
	RRCF        R1, 1 
	RRCF        R0, 1 
	BCF         R1, 7 
	RRCF        R1, 1 
	RRCF        R0, 1 
	BCF         R1, 7 
	MOVF        R0, 0 
	ADDWF       RTCC_CalcWkDay_yr+0, 0 
	MOVWF       FLOC__RTCC_CalcWkDay+0 
	MOVF        R1, 0 
	ADDWFC      RTCC_CalcWkDay_yr+1, 0 
	MOVWF       FLOC__RTCC_CalcWkDay+1 
	MOVLW       100
	MOVWF       R4 
	MOVLW       0
	MOVWF       R5 
	MOVF        RTCC_CalcWkDay_yr+0, 0 
	MOVWF       R0 
	MOVF        RTCC_CalcWkDay_yr+1, 0 
	MOVWF       R1 
	CALL        _Div_16x16_U+0, 0
	MOVF        R0, 0 
	SUBWF       FLOC__RTCC_CalcWkDay+0, 1 
	MOVF        R1, 0 
	SUBWFB      FLOC__RTCC_CalcWkDay+1, 1 
	MOVLW       144
	MOVWF       R4 
	MOVLW       1
	MOVWF       R5 
	MOVF        RTCC_CalcWkDay_yr+0, 0 
	MOVWF       R0 
	MOVF        RTCC_CalcWkDay_yr+1, 0 
	MOVWF       R1 
	CALL        _Div_16x16_U+0, 0
	MOVF        R0, 0 
	ADDWF       FLOC__RTCC_CalcWkDay+0, 0 
	MOVWF       R2 
	MOVF        R1, 0 
	ADDWFC      FLOC__RTCC_CalcWkDay+1, 0 
	MOVWF       R3 
	DECF        _dtmRTCC+1, 0 
	MOVWF       R0 
	MOVLW       RTCC_CalcWkDay_tbl+0
	ADDWF       R0, 0 
	MOVWF       TBLPTRL 
	MOVLW       hi_addr(RTCC_CalcWkDay_tbl+0)
	MOVWF       TBLPTRH 
	MOVLW       0
	ADDWFC      TBLPTRH, 1 
	MOVLW       higher_addr(RTCC_CalcWkDay_tbl+0)
	MOVWF       TBLPTRU 
	MOVLW       0
	ADDWFC      TBLPTRU, 1 
	TBLRD*+
	MOVFF       TABLAT+0, R0
	MOVLW       0
	MOVWF       R1 
	MOVF        R2, 0 
	ADDWF       R0, 1 
	MOVF        R3, 0 
	ADDWFC      R1, 1 
	MOVF        _dtmRTCC+2, 0 
	ADDWF       R0, 1 
	MOVLW       0
	ADDWFC      R1, 1 
	MOVLW       7
	MOVWF       R4 
	MOVLW       0
	MOVWF       R5 
	CALL        _Div_16x16_U+0, 0
	MOVF        R8, 0 
	MOVWF       R0 
	MOVF        R9, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       _bytWkDay+0 
;RTCC.mbas,30 :: 		end sub
L_end_RTCC_CalcWkDay:
	RETURN      0
; end of _RTCC_CalcWkDay

RTCC_RTCC_WrEn:

;RTCC.mbas,32 :: 		sub procedure RTCC_WrEn()  'Enables writing to the RTCC registers
;RTCC.mbas,33 :: 		EECON2 = 0x55
	MOVLW       85
	MOVWF       EECON2+0 
;RTCC.mbas,34 :: 		EECON2 = 0xAA
	MOVLW       170
	MOVWF       EECON2+0 
;RTCC.mbas,35 :: 		RTCWREN_bit = 1
	BSF         RTCWREN_bit+0, BitPos(RTCWREN_bit+0) 
;RTCC.mbas,36 :: 		end sub
L_end_RTCC_WrEn:
	RETURN      0
; end of RTCC_RTCC_WrEn

_RTCC_Init:

;RTCC.mbas,38 :: 		sub procedure RTCC_Init()
;RTCC.mbas,40 :: 		T1OSCEN_bit = 1
	BSF         T1OSCEN_bit+0, BitPos(T1OSCEN_bit+0) 
;RTCC.mbas,41 :: 		RTCC_WrEn()
	CALL        RTCC_RTCC_WrEn+0, 0
;RTCC.mbas,42 :: 		RTCEN_bit = 1
	BSF         RTCEN_bit+0, BitPos(RTCEN_bit+0) 
;RTCC.mbas,43 :: 		RTCWREN_Bit = 0
	BCF         RTCWREN_bit+0, BitPos(RTCWREN_bit+0) 
;RTCC.mbas,44 :: 		end sub
L_end_RTCC_Init:
	RETURN      0
; end of _RTCC_Init

_RTCC_Read:

;RTCC.mbas,46 :: 		sub procedure RTCC_Read()  'Reads from the RTCC
;RTCC.mbas,47 :: 		RTCCFG = %10000011 'Set RTCPTR to 11
	MOVLW       131
	MOVWF       RTCCFG+0 
;RTCC.mbas,48 :: 		while RTCSYNC_bit = 1
L__RTCC_Read8:
	BTFSC       RTCSYNC_bit+0, BitPos(RTCSYNC_bit+0) 
	GOTO        L__RTCC_Read8
;RTCC.mbas,51 :: 		dtmRTCC.Year   = Bcd2Dec(RTCVALL)
	MOVF        RTCVALL+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _dtmRTCC+0 
;RTCC.mbas,52 :: 		dtmRTCC.Month  = Bcd2Dec(RTCVALH) 'Just to decrement RTCPTR
	MOVF        RTCVALH+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _dtmRTCC+1 
;RTCC.mbas,53 :: 		dtmRTCC.Day    = Bcd2Dec(RTCVALL)
	MOVF        RTCVALL+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _dtmRTCC+2 
;RTCC.mbas,54 :: 		dtmRTCC.Month  = Bcd2Dec(RTCVALH)
	MOVF        RTCVALH+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _dtmRTCC+1 
;RTCC.mbas,55 :: 		dtmRTCC.Hour   = Bcd2Dec(RTCVALL)
	MOVF        RTCVALL+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _dtmRTCC+3 
;RTCC.mbas,56 :: 		bytWkDay  = Bcd2Dec(RTCVALH)
	MOVF        RTCVALH+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _bytWkDay+0 
;RTCC.mbas,57 :: 		dtmRTCC.Second = Bcd2Dec(RTCVALL)
	MOVF        RTCVALL+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _dtmRTCC+5 
;RTCC.mbas,58 :: 		dtmRTCC.Minute = Bcd2Dec(RTCVALH)
	MOVF        RTCVALH+0, 0 
	MOVWF       FARG_Bcd2Dec_bcd_num+0 
	CALL        _Bcd2Dec+0, 0
	MOVF        R0, 0 
	MOVWF       _dtmRTCC+4 
;RTCC.mbas,59 :: 		end sub
L_end_RTCC_Read:
	RETURN      0
; end of _RTCC_Read

_RTCC_Write:

;RTCC.mbas,61 :: 		sub procedure RTCC_Write()  'Writes to the RTCC
;RTCC.mbas,62 :: 		RTCC_CalcWkDay()
	CALL        _RTCC_CalcWkDay+0, 0
;RTCC.mbas,63 :: 		RTCC_WrEn()
	CALL        RTCC_RTCC_WrEn+0, 0
;RTCC.mbas,64 :: 		RTCCFG = %10100011 'Set RTCPTR to 11
	MOVLW       163
	MOVWF       RTCCFG+0 
;RTCC.mbas,65 :: 		RTCVALL = Dec2Bcd(dtmRTCC.Year)
	MOVF        _dtmRTCC+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALL+0 
;RTCC.mbas,66 :: 		RTCVALH = Dec2Bcd(dtmRTCC.Month) 'Just to decrement RTCPTR
	MOVF        _dtmRTCC+1, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALH+0 
;RTCC.mbas,67 :: 		RTCVALL = Dec2Bcd(dtmRTCC.Day)
	MOVF        _dtmRTCC+2, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALL+0 
;RTCC.mbas,68 :: 		RTCVALH = Dec2Bcd(dtmRTCC.Month)
	MOVF        _dtmRTCC+1, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALH+0 
;RTCC.mbas,69 :: 		RTCVALL = Dec2Bcd(dtmRTCC.Hour)
	MOVF        _dtmRTCC+3, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALL+0 
;RTCC.mbas,70 :: 		RTCVALH = Dec2Bcd(bytWkDay)
	MOVF        _bytWkDay+0, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALH+0 
;RTCC.mbas,71 :: 		RTCVALL = Dec2Bcd(dtmRTCC.Second)
	MOVF        _dtmRTCC+5, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALL+0 
;RTCC.mbas,72 :: 		RTCVALH = Dec2Bcd(dtmRTCC.Minute)
	MOVF        _dtmRTCC+4, 0 
	MOVWF       FARG_Dec2Bcd_decnum+0 
	CALL        _Dec2Bcd+0, 0
	MOVF        R0, 0 
	MOVWF       RTCVALH+0 
;RTCC.mbas,73 :: 		RTCWREN_bit = 0
	BCF         RTCWREN_bit+0, BitPos(RTCWREN_bit+0) 
;RTCC.mbas,74 :: 		end sub
L_end_RTCC_Write:
	RETURN      0
; end of _RTCC_Write

RTCC_RTCC_GenerateDigits:

;RTCC.mbas,76 :: 		sub procedure RTCC_GenerateDigits(dim value as char, dim pos as ^char)
;RTCC.mbas,77 :: 		pos^ = (value / 10) + 48
	MOVLW       10
	MOVWF       R4 
	MOVF        FARG_RTCC_GenerateDigits_value+0, 0 
	MOVWF       R0 
	CALL        _Div_8x8_U+0, 0
	MOVFF       FARG_RTCC_GenerateDigits_pos+0, FSR1
	MOVFF       FARG_RTCC_GenerateDigits_pos+1, FSR1H
	MOVLW       48
	ADDWF       R0, 0 
	MOVWF       POSTINC1+0 
;RTCC.mbas,78 :: 		Inc(pos)
	INFSNZ      FARG_RTCC_GenerateDigits_pos+0, 1 
	INCF        FARG_RTCC_GenerateDigits_pos+1, 1 
;RTCC.mbas,79 :: 		pos^ = (value mod 10) + 48
	MOVLW       10
	MOVWF       R4 
	MOVF        FARG_RTCC_GenerateDigits_value+0, 0 
	MOVWF       R0 
	CALL        _Div_8x8_U+0, 0
	MOVF        R8, 0 
	MOVWF       R0 
	MOVFF       FARG_RTCC_GenerateDigits_pos+0, FSR1
	MOVFF       FARG_RTCC_GenerateDigits_pos+1, FSR1H
	MOVLW       48
	ADDWF       R0, 0 
	MOVWF       POSTINC1+0 
;RTCC.mbas,80 :: 		end sub
L_end_RTCC_GenerateDigits:
	RETURN      0
; end of RTCC_RTCC_GenerateDigits

_RTCC_GenerateDateStringDMY:

;RTCC.mbas,85 :: 		dim sep as char
;RTCC.mbas,86 :: 		sep = "/"
	MOVLW       47
	MOVWF       RTCC_GenerateDateStringDMY_sep+0 
;RTCC.mbas,87 :: 		pos = @rtccstring
	MOVF        FARG_RTCC_GenerateDateStringDMY_rtccstring+0, 0 
	MOVWF       RTCC_GenerateDateStringDMY_pos+0 
	MOVF        FARG_RTCC_GenerateDateStringDMY_rtccstring+1, 0 
	MOVWF       RTCC_GenerateDateStringDMY_pos+1 
;RTCC.mbas,88 :: 		RTCC_GenerateDigits(dt.Day, pos)
	MOVLW       2
	ADDWF       FARG_RTCC_GenerateDateStringDMY_dt+0, 0 
	MOVWF       FSR0 
	MOVLW       0
	ADDWFC      FARG_RTCC_GenerateDateStringDMY_dt+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_value+0 
	MOVF        FARG_RTCC_GenerateDateStringDMY_rtccstring+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+0 
	MOVF        FARG_RTCC_GenerateDateStringDMY_rtccstring+1, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+1 
	CALL        RTCC_RTCC_GenerateDigits+0, 0
;RTCC.mbas,89 :: 		pos = pos + 2
	MOVLW       2
	ADDWF       RTCC_GenerateDateStringDMY_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      RTCC_GenerateDateStringDMY_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       RTCC_GenerateDateStringDMY_pos+0 
	MOVF        R1, 0 
	MOVWF       RTCC_GenerateDateStringDMY_pos+1 
;RTCC.mbas,90 :: 		pos^ = sep
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	MOVF        RTCC_GenerateDateStringDMY_sep+0, 0 
	MOVWF       POSTINC1+0 
;RTCC.mbas,91 :: 		Inc(pos)
	INFSNZ      RTCC_GenerateDateStringDMY_pos+0, 1 
	INCF        RTCC_GenerateDateStringDMY_pos+1, 1 
;RTCC.mbas,92 :: 		RTCC_GenerateDigits(dt.Month, pos)
	MOVLW       1
	ADDWF       FARG_RTCC_GenerateDateStringDMY_dt+0, 0 
	MOVWF       FSR0 
	MOVLW       0
	ADDWFC      FARG_RTCC_GenerateDateStringDMY_dt+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_value+0 
	MOVF        RTCC_GenerateDateStringDMY_pos+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+0 
	MOVF        RTCC_GenerateDateStringDMY_pos+1, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+1 
	CALL        RTCC_RTCC_GenerateDigits+0, 0
;RTCC.mbas,93 :: 		pos = pos + 2
	MOVLW       2
	ADDWF       RTCC_GenerateDateStringDMY_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      RTCC_GenerateDateStringDMY_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       RTCC_GenerateDateStringDMY_pos+0 
	MOVF        R1, 0 
	MOVWF       RTCC_GenerateDateStringDMY_pos+1 
;RTCC.mbas,94 :: 		pos^ = sep
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	MOVF        RTCC_GenerateDateStringDMY_sep+0, 0 
	MOVWF       POSTINC1+0 
;RTCC.mbas,95 :: 		Inc(pos)
	INFSNZ      RTCC_GenerateDateStringDMY_pos+0, 1 
	INCF        RTCC_GenerateDateStringDMY_pos+1, 1 
;RTCC.mbas,96 :: 		pos^ = "2"
	MOVFF       RTCC_GenerateDateStringDMY_pos+0, FSR1
	MOVFF       RTCC_GenerateDateStringDMY_pos+1, FSR1H
	MOVLW       50
	MOVWF       POSTINC1+0 
;RTCC.mbas,97 :: 		Inc(pos)
	INFSNZ      RTCC_GenerateDateStringDMY_pos+0, 1 
	INCF        RTCC_GenerateDateStringDMY_pos+1, 1 
;RTCC.mbas,98 :: 		pos^ = "0"
	MOVFF       RTCC_GenerateDateStringDMY_pos+0, FSR1
	MOVFF       RTCC_GenerateDateStringDMY_pos+1, FSR1H
	MOVLW       48
	MOVWF       POSTINC1+0 
;RTCC.mbas,99 :: 		Inc(pos)
	INFSNZ      RTCC_GenerateDateStringDMY_pos+0, 1 
	INCF        RTCC_GenerateDateStringDMY_pos+1, 1 
;RTCC.mbas,100 :: 		RTCC_GenerateDigits(dt.Year, pos)
	MOVFF       FARG_RTCC_GenerateDateStringDMY_dt+0, FSR0
	MOVFF       FARG_RTCC_GenerateDateStringDMY_dt+1, FSR0H
	MOVF        POSTINC0+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_value+0 
	MOVF        RTCC_GenerateDateStringDMY_pos+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+0 
	MOVF        RTCC_GenerateDateStringDMY_pos+1, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+1 
	CALL        RTCC_RTCC_GenerateDigits+0, 0
;RTCC.mbas,101 :: 		pos = pos + 2
	MOVLW       2
	ADDWF       RTCC_GenerateDateStringDMY_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      RTCC_GenerateDateStringDMY_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       RTCC_GenerateDateStringDMY_pos+0 
	MOVF        R1, 0 
	MOVWF       RTCC_GenerateDateStringDMY_pos+1 
;RTCC.mbas,102 :: 		pos^ = 0
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	CLRF        POSTINC1+0 
;RTCC.mbas,103 :: 		end sub
L_end_RTCC_GenerateDateStringDMY:
	RETURN      0
; end of _RTCC_GenerateDateStringDMY

_RTCC_GenerateTimeString:

;RTCC.mbas,107 :: 		dim pos as ^char
;RTCC.mbas,108 :: 		pos = @rtccstring
	MOVF        FARG_RTCC_GenerateTimeString_rtccstring+0, 0 
	MOVWF       RTCC_GenerateTimeString_pos+0 
	MOVF        FARG_RTCC_GenerateTimeString_rtccstring+1, 0 
	MOVWF       RTCC_GenerateTimeString_pos+1 
;RTCC.mbas,109 :: 		RTCC_GenerateDigits(dt.Hour, pos)
	MOVLW       3
	ADDWF       FARG_RTCC_GenerateTimeString_dt+0, 0 
	MOVWF       FSR0 
	MOVLW       0
	ADDWFC      FARG_RTCC_GenerateTimeString_dt+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_value+0 
	MOVF        FARG_RTCC_GenerateTimeString_rtccstring+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+0 
	MOVF        FARG_RTCC_GenerateTimeString_rtccstring+1, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+1 
	CALL        RTCC_RTCC_GenerateDigits+0, 0
;RTCC.mbas,110 :: 		pos = pos + 2
	MOVLW       2
	ADDWF       RTCC_GenerateTimeString_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      RTCC_GenerateTimeString_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       RTCC_GenerateTimeString_pos+0 
	MOVF        R1, 0 
	MOVWF       RTCC_GenerateTimeString_pos+1 
;RTCC.mbas,111 :: 		pos^ = ":"
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	MOVLW       58
	MOVWF       POSTINC1+0 
;RTCC.mbas,112 :: 		Inc(pos)
	INFSNZ      RTCC_GenerateTimeString_pos+0, 1 
	INCF        RTCC_GenerateTimeString_pos+1, 1 
;RTCC.mbas,113 :: 		RTCC_GenerateDigits(dt.Minute, pos)
	MOVLW       4
	ADDWF       FARG_RTCC_GenerateTimeString_dt+0, 0 
	MOVWF       FSR0 
	MOVLW       0
	ADDWFC      FARG_RTCC_GenerateTimeString_dt+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_value+0 
	MOVF        RTCC_GenerateTimeString_pos+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+0 
	MOVF        RTCC_GenerateTimeString_pos+1, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+1 
	CALL        RTCC_RTCC_GenerateDigits+0, 0
;RTCC.mbas,114 :: 		if incl_sec then
	MOVF        FARG_RTCC_GenerateTimeString_incl_sec+0, 1 
	BTFSC       STATUS+0, 2 
	GOTO        L__RTCC_GenerateTimeString17
;RTCC.mbas,115 :: 		pos = pos + 2
	MOVLW       2
	ADDWF       RTCC_GenerateTimeString_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      RTCC_GenerateTimeString_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       RTCC_GenerateTimeString_pos+0 
	MOVF        R1, 0 
	MOVWF       RTCC_GenerateTimeString_pos+1 
;RTCC.mbas,116 :: 		pos^ = ":"
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	MOVLW       58
	MOVWF       POSTINC1+0 
;RTCC.mbas,117 :: 		Inc(pos)
	INFSNZ      RTCC_GenerateTimeString_pos+0, 1 
	INCF        RTCC_GenerateTimeString_pos+1, 1 
;RTCC.mbas,118 :: 		RTCC_GenerateDigits(dt.Second, pos)
	MOVLW       5
	ADDWF       FARG_RTCC_GenerateTimeString_dt+0, 0 
	MOVWF       FSR0 
	MOVLW       0
	ADDWFC      FARG_RTCC_GenerateTimeString_dt+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_value+0 
	MOVF        RTCC_GenerateTimeString_pos+0, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+0 
	MOVF        RTCC_GenerateTimeString_pos+1, 0 
	MOVWF       FARG_RTCC_GenerateDigits_pos+1 
	CALL        RTCC_RTCC_GenerateDigits+0, 0
L__RTCC_GenerateTimeString17:
;RTCC.mbas,120 :: 		pos = pos + 2
	MOVLW       2
	ADDWF       RTCC_GenerateTimeString_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      RTCC_GenerateTimeString_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       RTCC_GenerateTimeString_pos+0 
	MOVF        R1, 0 
	MOVWF       RTCC_GenerateTimeString_pos+1 
;RTCC.mbas,121 :: 		pos^ = 0
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	CLRF        POSTINC1+0 
;RTCC.mbas,122 :: 		end sub
L_end_RTCC_GenerateTimeString:
	RETURN      0
; end of _RTCC_GenerateTimeString

_RTCC_GenerateString:

;RTCC.mbas,125 :: 		dim pos as ^char
;RTCC.mbas,126 :: 		RTCC_GenerateDateStringDMY(dt, rtccstring)
	MOVF        FARG_RTCC_GenerateString_dt+0, 0 
	MOVWF       FARG_RTCC_GenerateDateStringDMY_dt+0 
	MOVF        FARG_RTCC_GenerateString_dt+1, 0 
	MOVWF       FARG_RTCC_GenerateDateStringDMY_dt+1 
	MOVF        FARG_RTCC_GenerateString_rtccstring+0, 0 
	MOVWF       FARG_RTCC_GenerateDateStringDMY_rtccstring+0 
	MOVF        FARG_RTCC_GenerateString_rtccstring+1, 0 
	MOVWF       FARG_RTCC_GenerateDateStringDMY_rtccstring+1 
	CALL        _RTCC_GenerateDateStringDMY+0, 0
;RTCC.mbas,127 :: 		pos = @rtccstring + 10
	MOVLW       10
	ADDWF       FARG_RTCC_GenerateString_rtccstring+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      FARG_RTCC_GenerateString_rtccstring+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       RTCC_GenerateString_pos+0 
	MOVF        R1, 0 
	MOVWF       RTCC_GenerateString_pos+1 
;RTCC.mbas,128 :: 		pos^ = " "
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	MOVLW       32
	MOVWF       POSTINC1+0 
;RTCC.mbas,129 :: 		pos = pos + 1
	INFSNZ      RTCC_GenerateString_pos+0, 1 
	INCF        RTCC_GenerateString_pos+1, 1 
;RTCC.mbas,130 :: 		RTCC_GenerateTimeString(dt, pos, 0)
	MOVF        FARG_RTCC_GenerateString_dt+0, 0 
	MOVWF       FARG_RTCC_GenerateTimeString_dt+0 
	MOVF        FARG_RTCC_GenerateString_dt+1, 0 
	MOVWF       FARG_RTCC_GenerateTimeString_dt+1 
	MOVF        RTCC_GenerateString_pos+0, 0 
	MOVWF       FARG_RTCC_GenerateTimeString_rtccstring+0 
	MOVF        RTCC_GenerateString_pos+1, 0 
	MOVWF       FARG_RTCC_GenerateTimeString_rtccstring+1 
	CLRF        FARG_RTCC_GenerateTimeString_incl_sec+0 
	CALL        _RTCC_GenerateTimeString+0, 0
;RTCC.mbas,131 :: 		end sub
L_end_RTCC_GenerateString:
	RETURN      0
; end of _RTCC_GenerateString
