
_RTCC_GenerateDigits:

;RTCC.c,7 :: 		void RTCC_GenerateDigits(char value, char *pos) {
;RTCC.c,8 :: 		*pos = (value / 10) + 48;
	ZE	W10, W0
	MOV	#10, W2
	REPEAT	#17
	DIV.S	W0, W2
	MOV	W0, W1
	MOV	#48, W0
	ADD	W1, W0, W0
	MOV.B	W0, [W11]
;RTCC.c,9 :: 		pos++;
	ADD	W11, #1, W0
	MOV	W0, W11
;RTCC.c,10 :: 		*pos = (value % 10) + 48;
	ZE	W10, W0
	MOV	#10, W2
	REPEAT	#17
	DIV.S	W0, W2
	MOV	#48, W0
	ADD	W1, W0, W0
	MOV.B	W0, [W11]
;RTCC.c,11 :: 		}
L_end_RTCC_GenerateDigits:
	RETURN
; end of _RTCC_GenerateDigits

_RTCC_GenerateDateStringYMD:

;RTCC.c,13 :: 		void RTCC_GenerateDateStringYMD(TDateTime *dt, char *rtccstring) {
;RTCC.c,16 :: 		char sep = '-';
	PUSH	W10
	PUSH	W11
; sep start address is: 6 (W3)
	MOV.B	#45, W3
;RTCC.c,17 :: 		pos = rtccstring;
; pos start address is: 8 (W4)
	MOV	W11, W4
;RTCC.c,18 :: 		RTCC_GenerateDigits((*dt).Year, pos);
	MOV.B	[W10], W0
	PUSH	W10
	MOV.B	W0, W10
	CALL	_RTCC_GenerateDigits
	POP	W10
;RTCC.c,19 :: 		pos += 2; *pos = sep; pos++;
	ADD	W4, #2, W0
; pos end address is: 8 (W4)
; pos start address is: 4 (W2)
	MOV	W0, W2
	MOV.B	W3, [W0]
	ADD	W2, #1, W1
; pos end address is: 4 (W2)
; pos start address is: 8 (W4)
	MOV	W1, W4
;RTCC.c,20 :: 		RTCC_GenerateDigits((*dt).Month, pos);
	ADD	W10, #1, W0
	PUSH	W10
	MOV	W1, W11
	MOV.B	[W0], W10
	CALL	_RTCC_GenerateDigits
	POP	W10
;RTCC.c,21 :: 		pos += 2; *pos = sep; pos++;
	ADD	W4, #2, W0
; pos end address is: 8 (W4)
; pos start address is: 4 (W2)
	MOV	W0, W2
	MOV.B	W3, [W0]
; sep end address is: 6 (W3)
	ADD	W2, #1, W1
; pos end address is: 4 (W2)
; pos start address is: 6 (W3)
	MOV	W1, W3
;RTCC.c,22 :: 		RTCC_GenerateDigits((*dt).Day, pos);
	ADD	W10, #2, W0
	MOV	W1, W11
	MOV.B	[W0], W10
	CALL	_RTCC_GenerateDigits
;RTCC.c,23 :: 		pos += 2;
	ADD	W3, #2, W1
; pos end address is: 6 (W3)
;RTCC.c,24 :: 		*pos = 0;
	CLR	W0
	MOV.B	W0, [W1]
;RTCC.c,25 :: 		}
L_end_RTCC_GenerateDateStringYMD:
	POP	W11
	POP	W10
	RETURN
; end of _RTCC_GenerateDateStringYMD

_RTCC_GenerateDateStringDMY:

;RTCC.c,27 :: 		void RTCC_GenerateDateStringDMY(TDateTime *dt, char *rtccstring) {
;RTCC.c,30 :: 		char sep = '/';
	PUSH	W10
	PUSH	W11
; sep start address is: 6 (W3)
	MOV.B	#47, W3
;RTCC.c,31 :: 		pos = rtccstring;
; pos start address is: 8 (W4)
	MOV	W11, W4
;RTCC.c,32 :: 		RTCC_GenerateDigits((*dt).Day, pos);
	ADD	W10, #2, W0
	PUSH	W10
	MOV.B	[W0], W10
	CALL	_RTCC_GenerateDigits
	POP	W10
;RTCC.c,33 :: 		pos += 2; *pos = sep; pos++;
	ADD	W4, #2, W0
; pos end address is: 8 (W4)
; pos start address is: 4 (W2)
	MOV	W0, W2
	MOV.B	W3, [W0]
	ADD	W2, #1, W1
; pos end address is: 4 (W2)
; pos start address is: 8 (W4)
	MOV	W1, W4
;RTCC.c,34 :: 		RTCC_GenerateDigits((*dt).Month, pos);
	ADD	W10, #1, W0
	PUSH	W10
	MOV	W1, W11
	MOV.B	[W0], W10
	CALL	_RTCC_GenerateDigits
	POP	W10
;RTCC.c,35 :: 		pos += 2; *pos = sep; pos++;
	ADD	W4, #2, W0
; pos end address is: 8 (W4)
; pos start address is: 4 (W2)
	MOV	W0, W2
	MOV.B	W3, [W0]
; sep end address is: 6 (W3)
	ADD	W2, #1, W1
	MOV	W1, W2
;RTCC.c,36 :: 		*pos = '2'; pos++;
	MOV.B	#50, W0
	MOV.B	W0, [W1]
	ADD	W2, #1, W1
	MOV	W1, W2
;RTCC.c,37 :: 		*pos = '0'; pos++;
	MOV.B	#48, W0
	MOV.B	W0, [W1]
	ADD	W2, #1, W1
; pos end address is: 4 (W2)
; pos start address is: 6 (W3)
	MOV	W1, W3
;RTCC.c,38 :: 		RTCC_GenerateDigits((*dt).Year, pos);
	MOV.B	[W10], W0
	MOV	W1, W11
	MOV.B	W0, W10
	CALL	_RTCC_GenerateDigits
;RTCC.c,39 :: 		pos += 2;
	ADD	W3, #2, W1
; pos end address is: 6 (W3)
;RTCC.c,40 :: 		*pos = 0;
	CLR	W0
	MOV.B	W0, [W1]
;RTCC.c,41 :: 		}
L_end_RTCC_GenerateDateStringDMY:
	POP	W11
	POP	W10
	RETURN
; end of _RTCC_GenerateDateStringDMY

_RTCC_GenerateTimeString:

;RTCC.c,43 :: 		void RTCC_GenerateTimeString(TDateTime *dt, char *rtccstring, char incl_sec) {
;RTCC.c,46 :: 		pos = rtccstring;
	PUSH	W10
	PUSH	W11
; pos start address is: 6 (W3)
	MOV	W11, W3
;RTCC.c,47 :: 		RTCC_GenerateDigits((*dt).Hour, pos);
	ADD	W10, #3, W0
	PUSH	W10
	MOV.B	[W0], W10
	CALL	_RTCC_GenerateDigits
	POP	W10
;RTCC.c,48 :: 		pos += 2; *pos = ':'; pos++;
	ADD	W3, #2, W1
; pos end address is: 6 (W3)
; pos start address is: 4 (W2)
	MOV	W1, W2
	MOV.B	#58, W0
	MOV.B	W0, [W1]
	ADD	W2, #1, W1
; pos end address is: 4 (W2)
; pos start address is: 6 (W3)
	MOV	W1, W3
;RTCC.c,49 :: 		RTCC_GenerateDigits((*dt).Minute, pos);
	ADD	W10, #4, W0
	PUSH	W10
	MOV	W1, W11
	MOV.B	[W0], W10
	CALL	_RTCC_GenerateDigits
	POP	W10
;RTCC.c,50 :: 		if (incl_sec) {
	CP0.B	W12
	BRA NZ	L__RTCC_GenerateTimeString6
	GOTO	L__RTCC_GenerateTimeString1
L__RTCC_GenerateTimeString6:
;RTCC.c,51 :: 		pos += 2; *pos = ':'; pos++;
	ADD	W3, #2, W1
; pos end address is: 6 (W3)
; pos start address is: 4 (W2)
	MOV	W1, W2
	MOV.B	#58, W0
	MOV.B	W0, [W1]
	ADD	W2, #1, W1
	MOV	W1, W2
;RTCC.c,52 :: 		RTCC_GenerateDigits((*dt).Second, pos);
	ADD	W10, #5, W0
	PUSH	W2
	MOV	W1, W11
	MOV.B	[W0], W10
	CALL	_RTCC_GenerateDigits
; pos end address is: 4 (W2)
	POP	W2
	MOV	W2, W0
;RTCC.c,53 :: 		}
	GOTO	L_RTCC_GenerateTimeString0
L__RTCC_GenerateTimeString1:
;RTCC.c,50 :: 		if (incl_sec) {
	MOV	W3, W0
;RTCC.c,53 :: 		}
L_RTCC_GenerateTimeString0:
;RTCC.c,54 :: 		pos += 2;
; pos start address is: 0 (W0)
	ADD	W0, #2, W1
; pos end address is: 0 (W0)
;RTCC.c,55 :: 		*pos = 0;
	CLR	W0
	MOV.B	W0, [W1]
;RTCC.c,56 :: 		}
L_end_RTCC_GenerateTimeString:
	POP	W11
	POP	W10
	RETURN
; end of _RTCC_GenerateTimeString

_RTCC_GenerateString:

;RTCC.c,58 :: 		void RTCC_GenerateString(TDateTime *dt, char *rtccstring) {
;RTCC.c,59 :: 		RTCC_GenerateDateStringDMY(dt, rtccstring);
	PUSH	W11
	PUSH	W12
	PUSH	W11
	CALL	_RTCC_GenerateDateStringDMY
	POP	W11
;RTCC.c,60 :: 		rtccstring[10] = ' ';
	ADD	W11, #10, W1
	MOV.B	#32, W0
	MOV.B	W0, [W1]
;RTCC.c,61 :: 		RTCC_GenerateTimeString(dt, rtccstring + 11, 0);
	ADD	W11, #11, W0
	CLR	W12
	MOV	W0, W11
	CALL	_RTCC_GenerateTimeString
;RTCC.c,62 :: 		}
L_end_RTCC_GenerateString:
	POP	W12
	POP	W11
	RETURN
; end of _RTCC_GenerateString
