C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 1 DOS C166 COMPILER V3.10b, COMPILATION OF MODULE RTC OBJECT MODULE PLACED IN EXT\RTC.OBJ COMPILER INVOKED BY: C:\C166\BIN\C166.EXE EXT\RTC.C66 MOD167 LARGE FLOAT64 SYMBOLS CODE PREPRINT stmt level source 1 /* ----- file RTC.C66 ----- */ 2 3 4 5 /* Use it for interfacing the Real-Time Clock (rtc,RTC) AND the RAM inside */ 6 /* the RTC */ 7 8 9 10 11 #include "MISC.C66" 12 #include "I2C_HARD.C66" 13 #include "I2C_BUS.C66" 14 #include "RTC.H" 15 16 17 typedef struct RTC_REAL_TIME { 18 BCD8 Sec100; /* hundreds of second */ 19 BCD8 Second; 20 BCD8 Minute; 21 BCD8 Hour; /* hour & control */ 22 BCD8 YearDate; /* year(only LSB-bits 0 and 1) & date*/ 23 /* & control */ 24 BCD8 WeekdayMonth; /* month & day of week (sunday=0) */ 25 } RTC_REAL_TIME; 26 27 28 29 typedef struct RTC_ALARM_TIME { 30 BCD8 Sec100; /* hundreds of second */ 31 BCD8 Second; 32 BCD8 Minute; 33 BCD8 Hour; /* hour */ 34 BCD8 YearDate; /* only daymonth-field is used !!! */ 35 BCD8 WeekdayMonth; /* only month-field is used !!! */ 36 } RTC_ALARM_TIME; 37 38 39 40 /****************************************************************************/ 41 42 BYTE RTCSetTime(REAL_TIME *RealTime, BYTE DeviceID) { 43 1 RTC_REAL_TIME Time; 44 1 BYTE TransferByte; 45 1 BYTE Result, Tmp; 46 1 47 1 48 1 49 1 Tmp = BCD2INT((*RealTime).Year) % 4;/* calc type of year (0..3) */ 50 1 51 1 Time.Sec100 = 0x00; /* 100 of sec is set to zero */ 52 1 Time.Second = (*RealTime).Second; 53 1 Time.Minute = (*RealTime).Minute; 54 1 Time.Hour = (*RealTime).Hour; 55 1 Time.YearDate = (*RealTime).Date | (Tmp << 6); 56 1 Time.WeekdayMonth = (*RealTime).Month | ((*RealTime).Weekday << 5); 57 1 58 1 TransferByte = 0x84; /* new value for control register to */ 59 1 /* stop RTC & prepare setting of time*/ C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 2 60 1 if ((Result = RTCPutRAM(&TransferByte, DeviceID, 0x00, 1)) != 61 1 RTC_SUCCESSFUL) /* write control register to RTC */ 62 1 return(Result); 63 1 64 1 if ((Result = RTCPutRAM((BYTE*) &Time, DeviceID, 0x01, sizeof(Time))) != 65 1 RTC_SUCCESSFUL) /* write time to RTC */ 66 1 return(Result); 67 1 68 1 TransferByte = 0x00; /* value for alarm control register */ 69 1 if ((Result = RTCPutRAM(&TransferByte, DeviceID, 0x08, 1)) != 70 1 RTC_SUCCESSFUL) 71 1 /* write alarm control register */ 72 1 return(Result); 73 1 74 1 TransferByte = 0x04; /* new value for control register to */ 75 1 /* start RTC & enable alarm */ 76 1 if ((Result = RTCPutRAM(&TransferByte, DeviceID, 0x00, 1)) != 77 1 RTC_SUCCESSFUL) 78 1 /* write control register to RTC */ 79 1 return(Result); 80 1 81 1 if ((Result = RTCPutRAM((BYTE *) &((*RealTime).Year), DeviceID, 0x10, 2)) != 82 1 RTC_SUCCESSFUL) /* write additional Year information */ 83 1 return(Result); 84 1 85 1 if ((Result = RTCPutRAM(&Tmp, DeviceID, 0x12, 1)) != RTC_SUCCESSFUL) 86 1 return(Result); /* write additional Year information */ 87 1 88 1 return(RTC_SUCCESSFUL); /* successful operation */ 89 1 } 90 91 /****************************************************************************/ 92 93 BYTE RTCGetTime(REAL_TIME *RealTime, BYTE DeviceID) { 94 1 RTC_REAL_TIME Time; 95 1 BYTE TransferByte; 96 1 BYTE Result; 97 1 BYTE Tmp; 98 1 int i; 99 1 100 1 101 1 102 1 if ((Result = RTCGetRAM(&TransferByte, DeviceID, 0x00, 1)) != 103 1 RTC_SUCCESSFUL) 104 1 /* get control register */ 105 1 return(Result); 106 1 107 1 if(!(TransferByte & 0x04)) 108 1 return(RTC_NOT_INITIALIZED); /* rtc was not initialized ! */ 109 1 110 1 if ((RTCGetRAM((BYTE*) &Time, DeviceID, 0x01, sizeof(Time))) != 111 1 RTC_SUCCESSFUL) 112 1 /* read time from RTC */ 113 1 return(Result); 114 1 115 1 if ((RTCGetRAM((BYTE*) &((*RealTime).Year), DeviceID, 0x10, 2)) != 116 1 RTC_SUCCESSFUL) 117 1 /* read year from RTC */ 118 1 return(Result); 119 1 120 1 if ((RTCGetRAM((BYTE*) &Tmp, DeviceID, 0x12, 1)) != RTC_SUCCESSFUL) 121 1 return(Result); /* read additional year information */ 122 1 123 1 if ((i = (((int) (Time.YearDate >> 6)) - ((int) Tmp)))) { /* other year? */ 124 2 Tmp = Time.YearDate >> 6; 125 2 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 3 126 2 if (i < 0) 127 2 i += 4; 128 2 129 2 (*RealTime).Year = INT2BCD(BCD2INT((*RealTime).Year) + i); 130 2 131 2 if ((RTCPutRAM((BYTE*) &((*RealTime).Year), DeviceID, 0x10, 2)) != 132 2 RTC_SUCCESSFUL) 133 2 /* write new year to RTC */ 134 2 return(Result); 135 2 136 2 if ((RTCPutRAM((BYTE*) &Tmp, DeviceID, 0x12, 1)) != RTC_SUCCESSFUL) 137 2 return(Result); /* write additional year information */ 138 2 } 139 1 140 1 (*RealTime).Weekday = ((Time.WeekdayMonth & 0xE0) >> 5) & 0x07; 141 1 (*RealTime).Month = Time.WeekdayMonth & 0x1F; 142 1 (*RealTime).Date = Time.YearDate & 0x3F; 143 1 (*RealTime).Hour = Time.Hour; 144 1 (*RealTime).Minute = Time.Minute; 145 1 (*RealTime).Second = Time.Second; 146 1 147 1 return(RTC_SUCCESSFUL); 148 1 } 149 150 /****************************************************************************/ 151 152 BYTE RTCSetAlarm(REAL_TIME *AlarmTime, BYTE DeviceID) { 153 1 RTC_ALARM_TIME Time; 154 1 BYTE TransferByte; 155 1 BYTE Result; 156 1 157 1 158 1 159 1 if ((Result = RTCGetRAM(&TransferByte, DeviceID, 0x00, 1)) != 160 1 RTC_SUCCESSFUL) 161 1 return(Result); 162 1 163 1 if(!(TransferByte & 0x04)) 164 1 return(RTC_NOT_INITIALIZED); /* rtc was not initialized ! */ 165 1 166 1 Time.Sec100 = 0x00; /* setting sec100 is not useful */ 167 1 Time.Second = (*AlarmTime).Second; 168 1 Time.Minute = (*AlarmTime).Minute; 169 1 Time.Hour = (*AlarmTime).Hour; 170 1 Time.YearDate = (*AlarmTime).Date; /* Year is ignored by RTC */ 171 1 Time.WeekdayMonth = (*AlarmTime).Month; /* Weekday is ignored by RTC */ 172 1 173 1 if ((Result = RTCPutRAM((BYTE*)&Time, DeviceID, 0x09, sizeof(Time))) != 174 1 RTC_SUCCESSFUL) /* write alarm time into RTC */ 175 1 return(Result); 176 1 177 1 TransferByte = 0xB0; /* set alarm control */ 178 1 if ((Result = RTCPutRAM(&TransferByte, DeviceID, 0x08, 1)) != 179 1 RTC_SUCCESSFUL) /* write alarm control to RTC */ 180 1 return(Result); 181 1 182 1 TransferByte = 0x04; /* set control register */ 183 1 if ((Result = RTCPutRAM(&TransferByte, DeviceID, 0x00, 1)) != 184 1 RTC_SUCCESSFUL) 185 1 /* RTC starts detecting alarm intrs */ 186 1 return(Result); 187 1 188 1 return(RTC_SUCCESSFUL); 189 1 } 190 191 /****************************************************************************/ C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 4 192 193 BYTE RTCGetAlarm(REAL_TIME *AlarmTime, BYTE DeviceID) { 194 1 RTC_ALARM_TIME Time; 195 1 BYTE TransferByte; 196 1 BYTE Result; 197 1 BYTE Tmp; 198 1 int i; 199 1 BCD8 YearDate; 200 1 201 1 202 1 203 1 if ((Result = RTCGetRAM(&TransferByte, DeviceID, 0x00, 1)) != 204 1 RTC_SUCCESSFUL) 205 1 /* get control register */ 206 1 return(Result); 207 1 208 1 if(!(TransferByte & 0x04)) 209 1 return(RTC_NOT_INITIALIZED); /* rtc was not initialized ! */ 210 1 211 1 if ((RTCGetRAM((BYTE*) &Time, DeviceID, 0x09, sizeof(Time))) != 212 1 RTC_SUCCESSFUL) 213 1 /* read alarm time from RTC */ 214 1 return(Result); 215 1 216 1 if ((RTCGetRAM((BYTE*) &((*AlarmTime).Year), DeviceID, 0x10, 2)) != 217 1 RTC_SUCCESSFUL) 218 1 /* read year from RTC */ 219 1 return(Result); 220 1 221 1 if ((RTCGetRAM((BYTE*) &Tmp, DeviceID, 0x12, 1)) != RTC_SUCCESSFUL) 222 1 return(Result); /* read additional year information */ 223 1 224 1 if ((RTCGetRAM((BYTE*) &YearDate, DeviceID, 0x05, 1)) != RTC_SUCCESSFUL) 225 1 return(Result); /* read YearDate field of real time */ 226 1 227 1 if ((i = (((int) (YearDate >> 6)) - ((int) Tmp)))) { /* other year? */ 228 2 Tmp = YearDate >> 6; 229 2 230 2 if (i < 0) 231 2 i += 4; 232 2 233 2 (*AlarmTime).Year = INT2BCD(BCD2INT((*AlarmTime).Year) + i); 234 2 235 2 if ((RTCPutRAM((BYTE*) &((*AlarmTime).Year), DeviceID, 0x10, 2)) != 236 2 RTC_SUCCESSFUL) 237 2 /* write new year to RTC */ 238 2 return(Result); 239 2 240 2 if ((RTCPutRAM((BYTE*) &Tmp, DeviceID, 0x12, 1)) != RTC_SUCCESSFUL) 241 2 return(Result); /* write additional year information */ 242 2 } 243 1 244 1 (*AlarmTime).Year = 0x0000; /* Year is ignored by RTC */ 245 1 (*AlarmTime).Weekday = 0x00; /* Weekday is ignored by RTC */ 246 1 (*AlarmTime).Month = Time.WeekdayMonth & 0x1F; 247 1 (*AlarmTime).Date = Time.YearDate & 0x3F; 248 1 (*AlarmTime).Hour = Time.Hour; 249 1 (*AlarmTime).Minute = Time.Minute; 250 1 (*AlarmTime).Second = Time.Second; 251 1 252 1 return(RTC_SUCCESSFUL); 253 1 } 254 255 /****************************************************************************/ 256 257 BYTE RTCGetAlarmStatus(BYTE *AlarmStatus, BYTE DeviceID) { C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 5 258 1 BYTE TransferByte; /* state of control-register in RTC */ 259 1 BYTE Result; 260 1 261 1 262 1 263 1 if ((Result = RTCGetRAM(&TransferByte, DeviceID, 0x00, 1)) != 264 1 RTC_SUCCESSFUL) 265 1 /* read control register from RTC */ 266 1 return(Result); 267 1 268 1 if(!(TransferByte & 0x04)) 269 1 return(RTC_NOT_INITIALIZED); /* rtc was not initialized ! */ 270 1 271 1 if(!(TransferByte & 0x02)) /* return state of alarm flag */ 272 1 *AlarmStatus = 0x00; 273 1 else { 274 2 *AlarmStatus = 0x01; 275 2 276 2 TransferByte = 0x00; 277 2 if ((Result = RTCPutRAM(&TransferByte, DeviceID, 0x08, 1)) != 278 2 RTC_SUCCESSFUL) /* stop further alarms */ 279 2 return(Result); 280 2 281 2 TransferByte = 0x04; 282 2 if ((Result = RTCPutRAM(&TransferByte, DeviceID, 0x00, 1)) != 283 2 RTC_SUCCESSFUL) /* reset alarm-flag */ 284 2 return(Result); 285 2 } 286 1 287 1 return(RTC_SUCCESSFUL); 288 1 } 289 290 /****************************************************************************/ 291 292 BYTE RTCPutRAM(BYTE *SourcePtr, BYTE DeviceID, BYTE DestAddr, WORD Size) { 293 1 294 1 295 1 296 1 BYTE Result; 297 1 298 1 299 1 300 1 I2CInit(); 301 1 302 1 if ((Result = I2CWrite(SourcePtr, DeviceID, DestAddr, Size)) != 303 1 I2C_SUCCESSFUL) 304 1 return(RTC_WRITE_ERROR); 305 1 306 1 return(RTC_SUCCESSFUL); 307 1 } 308 309 /****************************************************************************/ 310 311 BYTE RTCGetRAM(BYTE *DestPtr, BYTE DeviceID, BYTE SourceAddr, WORD Size) { 312 1 313 1 314 1 315 1 I2CInit(); 316 1 if (I2CRead(DestPtr, DeviceID, SourceAddr, Size) != I2C_SUCCESSFUL) 317 1 return(RTC_READ_ERROR); 318 1 319 1 return(RTC_SUCCESSFUL); 320 1 } 321 322 /****************************************************************************/ 323 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 6 324 /* ----- end RTC.C66 ----- */ C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 7 ASSEMBLY LISTING OF GENERATED OBJECT CODE ; FUNCTION BCD2INT (BEGIN RMASK = @0x4070) ; SOURCE LINE # 16 ;---- Variable 'BCDValue' assigned to Register 'R8' ---- ; SOURCE LINE # 20 0000 F068 MOV R6,R8 0002 66F60F00 AND R6,#0FH ;---- Variable 'Result' assigned to Register 'R6' ---- ; SOURCE LINE # 21 0006 F058 MOV R5,R8 0008 66F5F000 AND R5,#0F0H 000C 7C45 SHR R5,#04H 000E F045 MOV R4,R5 0010 5C24 SHL R4,#02H 0012 0045 ADD R4,R5 0014 5C14 SHL R4,#01H 0016 0064 ADD R6,R4 ; SOURCE LINE # 22 0018 F058 MOV R5,R8 001A 66F5000F AND R5,#0F00H 001E 7C85 SHR R5,#08H 0020 F045 MOV R4,R5 0022 5C24 SHL R4,#02H 0024 2045 SUB R4,R5 0026 5C34 SHL R4,#03H 0028 0045 ADD R4,R5 002A 5C24 SHL R4,#02H 002C 0064 ADD R6,R4 ; SOURCE LINE # 23 002E F058 MOV R5,R8 0030 66F500F0 AND R5,#0F000H 0034 7CC5 SHR R5,#0CH 0036 F045 MOV R4,R5 0038 5C54 SHL R4,#05H 003A 2045 SUB R4,R5 003C 5C24 SHL R4,#02H 003E 0045 ADD R4,R5 0040 5C34 SHL R4,#03H 0042 0064 ADD R6,R4 ; SOURCE LINE # 24 0044 F046 MOV R4,R6 ; SOURCE LINE # 25 0046 DB00 RETS ; FUNCTION BCD2INT (END RMASK = @0x4070) ; FUNCTION INT2BCD (BEGIN RMASK = @0x6170) ; SOURCE LINE # 30 ;---- Variable 'INTValue' assigned to Register 'R8' ---- ; SOURCE LINE # 35 0048 E0A4 MOV R4,#0AH 004A F6F80EFE MOV MDL,R8 004E 5B44 DIVU R4 0050 F2F60CFE MOV R6,MDH 0054 F2F50EFE MOV R5,MDL ;---- Variable 'Result' assigned to Register 'R6' ---- ; SOURCE LINE # 36 0058 E0A5 MOV R5,#0AH 005A F6F80EFE MOV MDL,R8 005E 4B55 DIV R5 0060 F2F80EFE MOV R8,MDL ; SOURCE LINE # 37 0064 F6F80EFE MOV MDL,R8 0068 5B44 DIVU R4 006A F2F40CFE MOV R4,MDH C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 8 006E F2F50EFE MOV R5,MDL 0072 5C44 SHL R4,#04H 0074 7064 OR R6,R4 ; SOURCE LINE # 38 0076 E0A5 MOV R5,#0AH 0078 F6F80EFE MOV MDL,R8 007C 4B55 DIV R5 007E F2F80EFE MOV R8,MDL ; SOURCE LINE # 39 0082 E0A4 MOV R4,#0AH 0084 F6F80EFE MOV MDL,R8 0088 5B44 DIVU R4 008A F2F40CFE MOV R4,MDH 008E F2F50EFE MOV R5,MDL 0092 5C84 SHL R4,#08H 0094 7064 OR R6,R4 ; SOURCE LINE # 40 0096 E0A5 MOV R5,#0AH 0098 F6F80EFE MOV MDL,R8 009C 4B55 DIV R5 009E F2F80EFE MOV R8,MDL ; SOURCE LINE # 41 00A2 E0A4 MOV R4,#0AH 00A4 F6F80EFE MOV MDL,R8 00A8 5B44 DIVU R4 00AA F2F40CFE MOV R4,MDH 00AE F2F50EFE MOV R5,MDL 00B2 5CC4 SHL R4,#0CH 00B4 7064 OR R6,R4 ; SOURCE LINE # 42 00B6 F046 MOV R4,R6 ; SOURCE LINE # 43 00B8 DB00 RETS ; FUNCTION INT2BCD (END RMASK = @0x6170) ; FUNCTION I2CDelay (BEGIN RMASK = @0x4020) ; SOURCE LINE # 22 ; SOURCE LINE # 27 00BA E10A MOVB RL5,#00H ;---- Variable 'Count' assigned to Register 'RL5' ---- 00BC ?C0003: 00BC 09A1 ADDB RL5,#01H 00BE 47FA1900 CMPB RL5,#019H 00C2 8DFC JMPR cc_ULT,?C0003 00C4 ?C0004: ; SOURCE LINE # 28 00C4 DB00 RETS ; FUNCTION I2CDelay (END RMASK = @0x4020) ; FUNCTION I2CPutSCL (BEGIN RMASK = @0x4010) ; SOURCE LINE # 33 ;---- Variable 'State' assigned to Register 'R8' ---- ; SOURCE LINE # 37 00C6 F048 MOV R4,R8 00C8 4980 CMPB RL4,#00H 00CA 3D05 JMPR cc_NZ,?C0008 ; SOURCE LINE # 38 00CC 66E0FDFF AND P2,#0FFFDH ; SOURCE LINE # 39 00D0 76E10200 OR DP2,#02H ; SOURCE LINE # 43 00D4 DB00 RETS 00D6 ?C0008: ; SOURCE LINE # 45 00D6 66E1FDFF AND DP2,#0FFFDH ; SOURCE LINE # 48 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 9 00DA 76E00200 OR P2,#02H ; SOURCE LINE # 49 00DE ?C0009: ; SOURCE LINE # 50 00DE DB00 RETS ; FUNCTION I2CPutSCL (END RMASK = @0x4010) ; FUNCTION I2CGetSCL (BEGIN RMASK = @0x4010) ; SOURCE LINE # 57 ; SOURCE LINE # 61 00E0 66E1FDFF AND DP2,#0FFFDH ; SOURCE LINE # 63 00E4 F2F4C0FF MOV R4,P2 00E8 6842 AND R4,#02H 00EA 2D02 JMPR cc_Z,?C0010 ; SOURCE LINE # 64 00EC E118 MOVB RL4,#01H 00EE DB00 RETS 00F0 ?C0010: ; SOURCE LINE # 66 00F0 E108 MOVB RL4,#00H ; SOURCE LINE # 67 00F2 ?C0011: 00F2 DB00 RETS ; FUNCTION I2CGetSCL (END RMASK = @0x4010) ; FUNCTION I2CPutSDA (BEGIN RMASK = @0x4010) ; SOURCE LINE # 72 ;---- Variable 'State' assigned to Register 'R8' ---- ; SOURCE LINE # 76 00F4 F048 MOV R4,R8 00F6 4980 CMPB RL4,#00H 00F8 3D05 JMPR cc_NZ,?C0013 ; SOURCE LINE # 77 00FA 66E0FBFF AND P2,#0FFFBH ; SOURCE LINE # 78 00FE 76E10400 OR DP2,#04H ; SOURCE LINE # 82 0102 DB00 RETS 0104 ?C0013: ; SOURCE LINE # 84 0104 66E1FBFF AND DP2,#0FFFBH ; SOURCE LINE # 87 0108 76E00400 OR P2,#04H ; SOURCE LINE # 88 010C ?C0014: ; SOURCE LINE # 89 010C DB00 RETS ; FUNCTION I2CPutSDA (END RMASK = @0x4010) ; FUNCTION I2CGetSDA (BEGIN RMASK = @0x4010) ; SOURCE LINE # 95 ; SOURCE LINE # 99 010E 66E1FBFF AND DP2,#0FFFBH ; SOURCE LINE # 101 0112 F2F4C0FF MOV R4,P2 0116 6844 AND R4,#04H 0118 2D02 JMPR cc_Z,?C0015 ; SOURCE LINE # 102 011A E118 MOVB RL4,#01H 011C DB00 RETS 011E ?C0015: ; SOURCE LINE # 104 011E E108 MOVB RL4,#00H ; SOURCE LINE # 105 0120 ?C0016: C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 10 0120 DB00 RETS ; FUNCTION I2CGetSDA (END RMASK = @0x4010) ; FUNCTION I2CInit (BEGIN RMASK = @0x0130) ; SOURCE LINE # 16 ; SOURCE LINE # 22 0122 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 23 0126 E008 MOV R8,#00H 0128 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 26 012C DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 27 0130 E008 MOV R8,#00H 0132 DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 28 0136 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 29 013A E018 MOV R8,#01H 013C DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 30 0140 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 31 0144 E008 MOV R8,#00H 0146 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 32 014A DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 33 014E E018 MOV R8,#01H 0150 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 34 0154 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 35 0158 E008 MOV R8,#00H 015A DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 36 015E DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 37 0162 E018 MOV R8,#01H 0164 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 41 0168 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 42 016C E018 MOV R8,#01H 016E DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 43 0172 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 44 0176 E018 MOV R8,#01H 0178 DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 45 017C DB00 RETS ; FUNCTION I2CInit (END RMASK = @0x0130) ; FUNCTION I2CWrite (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 54 017E ECFD PUSH R13 0180 ECFE PUSH R14 0182 ECFF PUSH R15 0184 F0DC MOV R13,R12 ;---- Variable 'Size' assigned to Register 'R13' ---- 0186 88B0 MOV [-R0],R11 0188 88A0 MOV [-R0],R10 018A F0E8 MOV R14,R8 018C F0F9 MOV R15,R9 ;---- Variable 'SourcePtr' assigned to Register 'R14/R15' ---- C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 11 018E 2802 SUB R0,#02H ; SOURCE LINE # 59 0190 DA000000 R CALLS SEG (I2CStart),I2CStart ; SOURCE LINE # 60 0194 F4800200 MOVB RL4,[R0+#02H] ; DeviceID 0198 67F8FE00 ANDB RL4,#0FEH 019C C088 MOVBZ R8,RL4 019E DA000000 R CALLS SEG (I2CWriteByte),I2CWriteByte ; SOURCE LINE # 62 01A2 DA000000 R CALLS SEG (I2CReceiveAck),I2CReceiveAck 01A6 B980 MOVB [R0],RL4 ; Result 01A8 4980 CMPB RL4,#00H 01AA 2D04 JMPR cc_Z,?C0018 ; SOURCE LINE # 64 01AC DA000000 R CALLS SEG (I2CStop),I2CStop ; SOURCE LINE # 65 01B0 A980 MOVB RL4,[R0] ; Result 01B2 0D24 JMPR cc_UC,?C0019 ; SOURCE LINE # 66 01B4 ?C0018: ; SOURCE LINE # 68 01B4 F4800400 MOVB RL4,[R0+#04H] ; DestAddr 01B8 C088 MOVBZ R8,RL4 01BA DA000000 R CALLS SEG (I2CWriteByte),I2CWriteByte ; SOURCE LINE # 70 01BE DA000000 R CALLS SEG (I2CReceiveAck),I2CReceiveAck 01C2 B980 MOVB [R0],RL4 ; Result 01C4 4980 CMPB RL4,#00H 01C6 2D04 JMPR cc_Z,?C0024 ; SOURCE LINE # 71 01C8 DA000000 R CALLS SEG (I2CStop),I2CStop ; SOURCE LINE # 72 01CC A980 MOVB RL4,[R0] ; Result 01CE 0D16 JMPR cc_UC,?C0019 ; SOURCE LINE # 73 ; SOURCE LINE # 75 01D0 ?C0024: 01D0 0D0E JMPR cc_UC,?C0021 01D2 ?C0023: ; SOURCE LINE # 76 01D2 DC4F EXTP R15,#01H 01D4 998E MOVB RL4,[R14+] 01D6 C088 MOVBZ R8,RL4 01D8 DA000000 R CALLS SEG (I2CWriteByte),I2CWriteByte ; SOURCE LINE # 78 01DC DA000000 R CALLS SEG (I2CReceiveAck),I2CReceiveAck 01E0 B980 MOVB [R0],RL4 ; Result 01E2 4980 CMPB RL4,#00H 01E4 2D04 JMPR cc_Z,?C0021 ; SOURCE LINE # 79 01E6 DA000000 R CALLS SEG (I2CStop),I2CStop ; SOURCE LINE # 80 01EA A980 MOVB RL4,[R0] ; Result 01EC 0D07 JMPR cc_UC,?C0019 ; SOURCE LINE # 81 01EE ?C0021: 01EE F05D MOV R5,R13 01F0 28D1 SUB R13,#01H 01F2 4850 CMP R5,#00H 01F4 3DEE JMPR cc_NZ,?C0023 01F6 ?C0022: ; SOURCE LINE # 84 01F6 DA000000 R CALLS SEG (I2CStop),I2CStop ; SOURCE LINE # 85 01FA E108 MOVB RL4,#00H ; SOURCE LINE # 86 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 12 01FC ?C0019: 01FC 0806 ADD R0,#06H 01FE FCFF POP R15 0200 FCFE POP R14 0202 FCFD POP R13 0204 DB00 RETS ; FUNCTION I2CWrite (END RMASK = @0x7FFF) ; FUNCTION I2CRead (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 95 0206 ECFD PUSH R13 0208 ECFE PUSH R14 020A ECFF PUSH R15 020C F0DC MOV R13,R12 ;---- Variable 'Size' assigned to Register 'R13' ---- 020E F0FB MOV R15,R11 ;---- Variable 'SourceAddr' assigned to Register 'R15' ---- 0210 F0EA MOV R14,R10 ;---- Variable 'DeviceID' assigned to Register 'R14' ---- 0212 8890 MOV [-R0],R9 0214 8880 MOV [-R0],R8 0216 2802 SUB R0,#02H ; SOURCE LINE # 100 0218 DA000000 R CALLS SEG (I2CStart),I2CStart ; SOURCE LINE # 101 021C F04E MOV R4,R14 021E 67F8FE00 ANDB RL4,#0FEH 0222 C088 MOVBZ R8,RL4 0224 DA000000 R CALLS SEG (I2CWriteByte),I2CWriteByte ; SOURCE LINE # 103 0228 DA000000 R CALLS SEG (I2CReceiveAck),I2CReceiveAck 022C B980 MOVB [R0],RL4 ; Result 022E 4980 CMPB RL4,#00H 0230 2D04 JMPR cc_Z,?C0026 ; SOURCE LINE # 105 0232 DA000000 R CALLS SEG (I2CStop),I2CStop ; SOURCE LINE # 106 0236 A980 MOVB RL4,[R0] ; Result 0238 0D35 JMPR cc_UC,?C0027 ; SOURCE LINE # 107 023A ?C0026: ; SOURCE LINE # 109 023A F04F MOV R4,R15 023C C088 MOVBZ R8,RL4 023E DA000000 R CALLS SEG (I2CWriteByte),I2CWriteByte ; SOURCE LINE # 111 0242 DA000000 R CALLS SEG (I2CReceiveAck),I2CReceiveAck 0246 B980 MOVB [R0],RL4 ; Result 0248 4980 CMPB RL4,#00H 024A 2D04 JMPR cc_Z,?C0028 ; SOURCE LINE # 112 024C DA000000 R CALLS SEG (I2CStop),I2CStop ; SOURCE LINE # 113 0250 A980 MOVB RL4,[R0] ; Result 0252 0D28 JMPR cc_UC,?C0027 ; SOURCE LINE # 114 0254 ?C0028: ; SOURCE LINE # 116 0254 DA000000 R CALLS SEG (I2CStart),I2CStart ; SOURCE LINE # 117 0258 F04E MOV R4,R14 025A 7981 ORB RL4,#01H 025C C088 MOVBZ R8,RL4 025E DA000000 R CALLS SEG (I2CWriteByte),I2CWriteByte ; SOURCE LINE # 119 0262 DA000000 R CALLS SEG (I2CReceiveAck),I2CReceiveAck C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 13 0266 B980 MOVB [R0],RL4 ; Result 0268 4980 CMPB RL4,#00H 026A 2D04 JMPR cc_Z,?C0033 ; SOURCE LINE # 120 026C DA000000 R CALLS SEG (I2CStop),I2CStop ; SOURCE LINE # 121 0270 A980 MOVB RL4,[R0] ; Result 0272 0D18 JMPR cc_UC,?C0027 ; SOURCE LINE # 122 ; SOURCE LINE # 124 0274 ?C0033: 0274 0D10 JMPR cc_UC,?C0030 0276 ?C0032: ; SOURCE LINE # 125 0276 DA000000 R CALLS SEG (I2CReadByte),I2CReadByte 027A D4900400 MOV R9,[R0+#04H] ; DestPtr+2 027E D4800200 MOV R8,[R0+#02H] ; DestPtr 0282 F068 MOV R6,R8 0284 0861 ADD R6,#01H 0286 C4600200 MOV [R0+#02H],R6 ; DestPtr 028A DC49 EXTP R9,#01H 028C B988 MOVB [R8],RL4 ; SOURCE LINE # 127 028E 48D0 CMP R13,#00H 0290 2D02 JMPR cc_Z,?C0030 ; SOURCE LINE # 128 0292 DA000000 R CALLS SEG (I2CSendAck),I2CSendAck ; SOURCE LINE # 129 0296 ?C0030: 0296 F05D MOV R5,R13 0298 28D1 SUB R13,#01H 029A 4850 CMP R5,#00H 029C 3DEC JMPR cc_NZ,?C0032 029E ?C0031: ; SOURCE LINE # 131 029E DA000000 R CALLS SEG (I2CStop),I2CStop ; SOURCE LINE # 132 02A2 E108 MOVB RL4,#00H ; SOURCE LINE # 133 02A4 ?C0027: 02A4 0806 ADD R0,#06H 02A6 FCFF POP R15 02A8 FCFE POP R14 02AA FCFD POP R13 02AC DB00 RETS ; FUNCTION I2CRead (END RMASK = @0x7FFF) ; FUNCTION I2CStart (BEGIN RMASK = @0x0130) ; SOURCE LINE # 138 ; SOURCE LINE # 142 02AE DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 143 02B2 E018 MOV R8,#01H 02B4 DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 144 02B8 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 145 02BC E018 MOV R8,#01H 02BE DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 146 02C2 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 147 02C6 E008 MOV R8,#00H 02C8 DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 148 02CC DA000000 R CALLS SEG (I2CDelay),I2CDelay C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 14 ; SOURCE LINE # 149 02D0 E008 MOV R8,#00H 02D2 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 150 02D6 DB00 RETS ; FUNCTION I2CStart (END RMASK = @0x0130) ; FUNCTION I2CStop (BEGIN RMASK = @0x0130) ; SOURCE LINE # 155 ; SOURCE LINE # 159 02D8 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 160 02DC E008 MOV R8,#00H 02DE DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 161 02E2 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 162 02E6 E008 MOV R8,#00H 02E8 DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 163 02EC DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 164 02F0 E018 MOV R8,#01H 02F2 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 165 02F6 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 166 02FA E018 MOV R8,#01H 02FC DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 167 0300 DB00 RETS ; FUNCTION I2CStop (END RMASK = @0x0130) ; FUNCTION I2CSendAck (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 172 ; SOURCE LINE # 176 0302 E008 MOV R8,#00H 0304 DA000000 R CALLS SEG (I2CSendBit),I2CSendBit ; SOURCE LINE # 177 0308 DB00 RETS ; FUNCTION I2CSendAck (END RMASK = @0x7FFF) ; FUNCTION I2CReceiveAck (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 182 ; SOURCE LINE # 186 030A DA000000 R CALLS SEG (I2CReceiveBit),I2CReceiveBit 030E 4980 CMPB RL4,#00H 0310 3D02 JMPR cc_NZ,?C0035 ; SOURCE LINE # 187 0312 E108 MOVB RL4,#00H 0314 DB00 RETS 0316 ?C0035: ; SOURCE LINE # 189 0316 E7F8FE00 MOVB RL4,#0FEH ; SOURCE LINE # 190 031A ?C0036: 031A DB00 RETS ; FUNCTION I2CReceiveAck (END RMASK = @0x7FFF) ; FUNCTION I2CSendBit (BEGIN RMASK = @0x4170) ; SOURCE LINE # 195 031C F068 MOV R6,R8 ;---- Variable 'State' assigned to Register 'RL6' ---- ; SOURCE LINE # 199 031E DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 200 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 15 0322 E008 MOV R8,#00H 0324 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 201 0328 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 202 032C C0C8 MOVBZ R8,RL6 032E DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 203 0332 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 204 0336 E018 MOV R8,#01H 0338 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 206 033C DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 208 0340 ?C0038: 0340 DA000000 R CALLS SEG (I2CGetSCL),I2CGetSCL 0344 4980 CMPB RL4,#00H 0346 2DFC JMPR cc_Z,?C0038 0348 ?C0039: ; SOURCE LINE # 210 0348 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 211 034C E008 MOV R8,#00H 034E DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 213 0352 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 214 0356 E018 MOV R8,#01H 0358 DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 215 035C DB00 RETS ; FUNCTION I2CSendBit (END RMASK = @0x4170) ; FUNCTION I2CReceiveBit (BEGIN RMASK = @0x4170) ; SOURCE LINE # 221 ; SOURCE LINE # 226 035E DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 227 0362 E008 MOV R8,#00H 0364 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 228 0368 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 229 036C E018 MOV R8,#01H 036E DA000000 R CALLS SEG (I2CPutSDA),I2CPutSDA ; SOURCE LINE # 230 0372 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 231 0376 E018 MOV R8,#01H 0378 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 233 037C DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 235 0380 ?C0042: 0380 DA000000 R CALLS SEG (I2CGetSCL),I2CGetSCL 0384 4980 CMPB RL4,#00H 0386 2DFC JMPR cc_Z,?C0042 0388 ?C0043: ; SOURCE LINE # 237 0388 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 238 038C DA000000 R CALLS SEG (I2CGetSDA),I2CGetSDA 0390 F1C8 MOVB RL6,RL4 ;---- Variable 'State' assigned to Register 'RL6' ---- ; SOURCE LINE # 239 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 16 0392 E008 MOV R8,#00H 0394 DA000000 R CALLS SEG (I2CPutSCL),I2CPutSCL ; SOURCE LINE # 241 0398 DA000000 R CALLS SEG (I2CDelay),I2CDelay ; SOURCE LINE # 242 039C F18C MOVB RL4,RL6 ; SOURCE LINE # 243 039E DB00 RETS ; FUNCTION I2CReceiveBit (END RMASK = @0x4170) ; FUNCTION I2CWriteByte (BEGIN RMASK = @0x41F2) ; SOURCE LINE # 248 03A0 F078 MOV R7,R8 ;---- Variable 'TransferData' assigned to Register 'RL7' ---- ; SOURCE LINE # 253 03A2 E102 MOVB RL1,#00H ;---- Variable 'Loop' assigned to Register 'RL1' ---- 03A4 ?C0050: ; SOURCE LINE # 254 03A4 F18E MOVB RL4,RL7 03A6 67F88000 ANDB RL4,#080H 03AA 47F88000 CMPB RL4,#080H 03AE 3D02 JMPR cc_NZ,?C0052 03B0 E018 MOV R8,#01H 03B2 0D01 JMPR cc_UC,?C0053 03B4 ?C0052: 03B4 E008 MOV R8,#00H 03B6 ?C0053: 03B6 DA000000 R CALLS SEG (I2CSendBit),I2CSendBit ; SOURCE LINE # 255 03BA C0E4 MOVBZ R4,RL7 03BC 5C14 SHL R4,#01H 03BE F1E8 MOVB RL7,RL4 ; SOURCE LINE # 256 03C0 0921 ADDB RL1,#01H 03C2 4927 CMPB RL1,#07H 03C4 FDEF JMPR cc_ULE,?C0050 03C6 ?C0048: ; SOURCE LINE # 257 03C6 DB00 RETS ; FUNCTION I2CWriteByte (END RMASK = @0x41F2) ; FUNCTION I2CReadByte (BEGIN RMASK = @0x41F2) ; SOURCE LINE # 262 ; SOURCE LINE # 267 03C8 E10E MOVB RL7,#00H ;---- Variable 'Value' assigned to Register 'RL7' ---- ; SOURCE LINE # 269 03CA E102 MOVB RL1,#00H ;---- Variable 'Loop' assigned to Register 'RL1' ---- 03CC ?C0057: ; SOURCE LINE # 270 03CC C0E4 MOVBZ R4,RL7 03CE 5C14 SHL R4,#01H 03D0 F1E8 MOVB RL7,RL4 ; SOURCE LINE # 271 03D2 DA000000 R CALLS SEG (I2CReceiveBit),I2CReceiveBit 03D6 71E8 ORB RL7,RL4 ; SOURCE LINE # 272 03D8 0921 ADDB RL1,#01H 03DA 4927 CMPB RL1,#07H 03DC FDF7 JMPR cc_ULE,?C0057 03DE ?C0055: ; SOURCE LINE # 274 03DE F18E MOVB RL4,RL7 ; SOURCE LINE # 275 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 17 03E0 DB00 RETS ; FUNCTION I2CReadByte (END RMASK = @0x41F2) ; FUNCTION RTCSetTime (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 42 03E2 ECFD PUSH R13 03E4 ECFE PUSH R14 03E6 ECFF PUSH R15 03E8 F0DA MOV R13,R10 ;---- Variable 'DeviceID' assigned to Register 'R13' ---- 03EA F0E8 MOV R14,R8 03EC F0F9 MOV R15,R9 ;---- Variable 'RealTime' assigned to Register 'R14/R15' ---- 03EE 06F0F4FF ADD R0,#0FFF4H ; SOURCE LINE # 49 03F2 DC49 EXTP R9,#01H 03F4 D4880200 MOV R8,[R8+#POF(02H)] 03F8 DA000000 R CALLS SEG (BCD2INT),BCD2INT 03FC 6843 AND R4,#03H 03FE E4800A00 MOVB [R0+#0AH],RL4 ; Tmp ; SOURCE LINE # 51 0402 E108 MOVB RL4,#00H 0404 B980 MOVB [R0],RL4 ; Time ; SOURCE LINE # 52 0406 DC4F EXTP R15,#01H 0408 F48E0800 MOVB RL4,[R14+#POF(08H)] 040C E4800100 MOVB [R0+#01H],RL4 ; Time+1 ; SOURCE LINE # 53 0410 DC4F EXTP R15,#01H 0412 F48E0700 MOVB RL4,[R14+#POF(07H)] 0416 E4800200 MOVB [R0+#02H],RL4 ; Time+2 ; SOURCE LINE # 54 041A DC4F EXTP R15,#01H 041C F48E0600 MOVB RL4,[R14+#POF(06H)] 0420 E4800300 MOVB [R0+#03H],RL4 ; Time+3 ; SOURCE LINE # 55 0424 F4800A00 MOVB RL4,[R0+#0AH] ; Tmp 0428 C086 MOVBZ R6,RL4 042A 5C66 SHL R6,#06H 042C DC4F EXTP R15,#01H 042E F48E0500 MOVB RL4,[R14+#POF(05H)] 0432 C084 MOVBZ R4,RL4 0434 7046 OR R4,R6 0436 E4800400 MOVB [R0+#04H],RL4 ; Time+4 ; SOURCE LINE # 56 043A DC4F EXTP R15,#01H 043C A98E MOVB RL4,[R14] 043E C086 MOVBZ R6,RL4 0440 5C56 SHL R6,#05H 0442 DC4F EXTP R15,#01H 0444 F48E0400 MOVB RL4,[R14+#POF(04H)] 0448 C084 MOVBZ R4,RL4 044A 7046 OR R4,R6 044C E4800500 MOVB [R0+#05H],RL4 ; Time+5 ; SOURCE LINE # 58 0450 E7F88400 MOVB RL4,#084H 0454 E4800600 MOVB [R0+#06H],RL4 ; TransferByte ; SOURCE LINE # 60 0458 E01C MOV R12,#01H 045A E00B MOV R11,#00H 045C F04D MOV R4,R13 045E C08A MOVBZ R10,RL4 0460 E068 MOV R8,#06H ; TransferByte 0462 0080 ADD R8,R0 ; TransferByte 0464 66F8FF3F AND R8,#03FFFH 0468 F2F904FE MOV R9,DPP2 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 18 046C DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 0470 E4800800 MOVB [R0+#08H],RL4 ; Result 0474 4980 CMPB RL4,#00H 0476 2D03 JMPR cc_Z,?C0060 ; SOURCE LINE # 62 0478 F4800800 MOVB RL4,[R0+#08H] ; Result 047C 0D64 JMPR cc_UC,?C0061 047E ?C0060: ; SOURCE LINE # 64 047E E06C MOV R12,#06H 0480 E01B MOV R11,#01H 0482 F04D MOV R4,R13 0484 C08A MOVBZ R10,RL4 0486 F080 MOV R8,R0 0488 66F8FF3F AND R8,#03FFFH 048C F2F904FE MOV R9,DPP2 0490 DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 0494 E4800800 MOVB [R0+#08H],RL4 ; Result 0498 4980 CMPB RL4,#00H 049A 2D03 JMPR cc_Z,?C0062 ; SOURCE LINE # 66 049C F4800800 MOVB RL4,[R0+#08H] ; Result 04A0 0D52 JMPR cc_UC,?C0061 04A2 ?C0062: ; SOURCE LINE # 68 04A2 E108 MOVB RL4,#00H 04A4 E4800600 MOVB [R0+#06H],RL4 ; TransferByte ; SOURCE LINE # 69 04A8 E01C MOV R12,#01H 04AA E08B MOV R11,#08H 04AC F04D MOV R4,R13 04AE C08A MOVBZ R10,RL4 04B0 E068 MOV R8,#06H ; TransferByte 04B2 0080 ADD R8,R0 ; TransferByte 04B4 66F8FF3F AND R8,#03FFFH 04B8 F2F904FE MOV R9,DPP2 04BC DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 04C0 E4800800 MOVB [R0+#08H],RL4 ; Result 04C4 4980 CMPB RL4,#00H 04C6 2D03 JMPR cc_Z,?C0063 ; SOURCE LINE # 72 04C8 F4800800 MOVB RL4,[R0+#08H] ; Result 04CC 0D3C JMPR cc_UC,?C0061 04CE ?C0063: ; SOURCE LINE # 74 04CE E148 MOVB RL4,#04H 04D0 E4800600 MOVB [R0+#06H],RL4 ; TransferByte ; SOURCE LINE # 76 04D4 E01C MOV R12,#01H 04D6 E00B MOV R11,#00H 04D8 F04D MOV R4,R13 04DA C08A MOVBZ R10,RL4 04DC E068 MOV R8,#06H ; TransferByte 04DE 0080 ADD R8,R0 ; TransferByte 04E0 66F8FF3F AND R8,#03FFFH 04E4 F2F904FE MOV R9,DPP2 04E8 DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 04EC E4800800 MOVB [R0+#08H],RL4 ; Result 04F0 4980 CMPB RL4,#00H 04F2 2D03 JMPR cc_Z,?C0064 ; SOURCE LINE # 79 04F4 F4800800 MOVB RL4,[R0+#08H] ; Result 04F8 0D26 JMPR cc_UC,?C0061 04FA ?C0064: ; SOURCE LINE # 81 04FA E02C MOV R12,#02H C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 19 04FC E6FB1000 MOV R11,#010H 0500 F04D MOV R4,R13 0502 C08A MOVBZ R10,RL4 0504 F08E MOV R8,R14 0506 0882 ADD R8,#02H 0508 F09F MOV R9,R15 050A DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 050E E4800800 MOVB [R0+#08H],RL4 ; Result 0512 4980 CMPB RL4,#00H 0514 2D03 JMPR cc_Z,?C0065 ; SOURCE LINE # 83 0516 F4800800 MOVB RL4,[R0+#08H] ; Result 051A 0D15 JMPR cc_UC,?C0061 051C ?C0065: ; SOURCE LINE # 85 051C E01C MOV R12,#01H 051E E6FB1200 MOV R11,#012H 0522 F04D MOV R4,R13 0524 C08A MOVBZ R10,RL4 0526 E0A8 MOV R8,#0AH ; Tmp 0528 0080 ADD R8,R0 ; Tmp 052A 66F8FF3F AND R8,#03FFFH 052E F2F904FE MOV R9,DPP2 0532 DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 0536 E4800800 MOVB [R0+#08H],RL4 ; Result 053A 4980 CMPB RL4,#00H 053C 2D03 JMPR cc_Z,?C0066 ; SOURCE LINE # 86 053E F4800800 MOVB RL4,[R0+#08H] ; Result 0542 0D01 JMPR cc_UC,?C0061 0544 ?C0066: ; SOURCE LINE # 88 0544 E108 MOVB RL4,#00H ; SOURCE LINE # 89 0546 ?C0061: 0546 06F00C00 ADD R0,#0CH 054A FCFF POP R15 054C FCFE POP R14 054E FCFD POP R13 0550 DB00 RETS ; FUNCTION RTCSetTime (END RMASK = @0x7FFF) ; FUNCTION RTCGetTime (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 93 0552 ECFD PUSH R13 0554 ECFE PUSH R14 0556 ECFF PUSH R15 0558 F0DA MOV R13,R10 ;---- Variable 'DeviceID' assigned to Register 'R13' ---- 055A F0E8 MOV R14,R8 055C F0F9 MOV R15,R9 ;---- Variable 'RealTime' assigned to Register 'R14/R15' ---- 055E 06F0F4FF ADD R0,#0FFF4H ; SOURCE LINE # 102 0562 E01C MOV R12,#01H 0564 E00B MOV R11,#00H 0566 F04A MOV R4,R10 0568 C08A MOVBZ R10,RL4 056A E068 MOV R8,#06H ; TransferByte 056C 0080 ADD R8,R0 ; TransferByte 056E 66F8FF3F AND R8,#03FFFH 0572 F2F904FE MOV R9,DPP2 0576 DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 057A E4800800 MOVB [R0+#08H],RL4 ; Result 057E 4980 CMPB RL4,#00H 0580 2D04 JMPR cc_Z,?C0067 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 20 ; SOURCE LINE # 105 0582 F4800800 MOVB RL4,[R0+#08H] ; Result 0586 EA00CA06 R JMPA cc_UC,?C0068 058A ?C0067: ; SOURCE LINE # 107 058A F4800600 MOVB RL4,[R0+#06H] ; TransferByte 058E 6984 ANDB RL4,#04H 0590 C084 MOVBZ R4,RL4 0592 3D04 JMPR cc_NZ,?C0069 ; SOURCE LINE # 108 0594 E7F8FD00 MOVB RL4,#0FDH 0598 EA00CA06 R JMPA cc_UC,?C0068 059C ?C0069: ; SOURCE LINE # 110 059C E06C MOV R12,#06H 059E E01B MOV R11,#01H 05A0 F04D MOV R4,R13 05A2 C08A MOVBZ R10,RL4 05A4 F080 MOV R8,R0 05A6 66F8FF3F AND R8,#03FFFH 05AA F2F904FE MOV R9,DPP2 05AE DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 05B2 4980 CMPB RL4,#00H 05B4 2D04 JMPR cc_Z,?C0070 ; SOURCE LINE # 113 05B6 F4800800 MOVB RL4,[R0+#08H] ; Result 05BA EA00CA06 R JMPA cc_UC,?C0068 05BE ?C0070: ; SOURCE LINE # 115 05BE E02C MOV R12,#02H 05C0 E6FB1000 MOV R11,#010H 05C4 F04D MOV R4,R13 05C6 C08A MOVBZ R10,RL4 05C8 F08E MOV R8,R14 05CA 0882 ADD R8,#02H 05CC F09F MOV R9,R15 05CE DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 05D2 4980 CMPB RL4,#00H 05D4 2D03 JMPR cc_Z,?C0071 ; SOURCE LINE # 118 05D6 F4800800 MOVB RL4,[R0+#08H] ; Result 05DA 0D77 JMPR cc_UC,?C0068 05DC ?C0071: ; SOURCE LINE # 120 05DC E01C MOV R12,#01H 05DE E6FB1200 MOV R11,#012H 05E2 F04D MOV R4,R13 05E4 C08A MOVBZ R10,RL4 05E6 E0A8 MOV R8,#0AH ; Tmp 05E8 0080 ADD R8,R0 ; Tmp 05EA 66F8FF3F AND R8,#03FFFH 05EE F2F904FE MOV R9,DPP2 05F2 DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 05F6 4980 CMPB RL4,#00H 05F8 2D03 JMPR cc_Z,?C0072 ; SOURCE LINE # 121 05FA F4800800 MOVB RL4,[R0+#08H] ; Result 05FE 0D65 JMPR cc_UC,?C0068 0600 ?C0072: ; SOURCE LINE # 123 0600 F4C00400 MOVB RL6,[R0+#04H] ; Time+4 0604 C0C1 MOVBZ R1,RL6 0606 7C61 SHR R1,#06H 0608 C027 MOVBZ R7,RL1 060A F4A00A00 MOVB RL5,[R0+#0AH] ; Tmp 060E C0A5 MOVBZ R5,RL5 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 21 0610 2075 SUB R7,R5 ;---- Variable 'i' assigned to Register 'R7' ---- 0612 4870 CMP R7,#00H 0614 2D32 JMPR cc_Z,?C0073 ; SOURCE LINE # 124 0616 E4200A00 MOVB [R0+#0AH],RL1 ; Tmp ; SOURCE LINE # 126 061A 4870 CMP R7,#00H 061C DD01 JMPR cc_SGE,?C0074 ; SOURCE LINE # 127 061E 0874 ADD R7,#04H 0620 ?C0074: ; SOURCE LINE # 129 0620 DC4F EXTP R15,#01H 0622 D48E0200 MOV R8,[R14+#POF(02H)] 0626 DA000000 R CALLS SEG (BCD2INT),BCD2INT 062A F084 MOV R8,R4 062C 0087 ADD R8,R7 062E DA000000 R CALLS SEG (INT2BCD),INT2BCD 0632 DC4F EXTP R15,#01H 0634 C44E0200 MOV [R14+#POF(02H)],R4 ; SOURCE LINE # 131 0638 E02C MOV R12,#02H 063A E6FB1000 MOV R11,#010H 063E F04D MOV R4,R13 0640 C08A MOVBZ R10,RL4 0642 F08E MOV R8,R14 0644 0882 ADD R8,#02H 0646 F09F MOV R9,R15 0648 DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 064C 4980 CMPB RL4,#00H 064E 2D03 JMPR cc_Z,?C0075 ; SOURCE LINE # 134 0650 F4800800 MOVB RL4,[R0+#08H] ; Result 0654 0D3A JMPR cc_UC,?C0068 0656 ?C0075: ; SOURCE LINE # 136 0656 E01C MOV R12,#01H 0658 E6FB1200 MOV R11,#012H 065C F04D MOV R4,R13 065E C08A MOVBZ R10,RL4 0660 E0A8 MOV R8,#0AH ; Tmp 0662 0080 ADD R8,R0 ; Tmp 0664 66F8FF3F AND R8,#03FFFH 0668 F2F904FE MOV R9,DPP2 066C DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 0670 4980 CMPB RL4,#00H 0672 2D03 JMPR cc_Z,?C0073 ; SOURCE LINE # 137 0674 F4800800 MOVB RL4,[R0+#08H] ; Result 0678 0D28 JMPR cc_UC,?C0068 ; SOURCE LINE # 138 067A ?C0073: ; SOURCE LINE # 140 067A F4800500 MOVB RL4,[R0+#05H] ; Time+5 067E 67F8E000 ANDB RL4,#0E0H 0682 C084 MOVBZ R4,RL4 0684 BC54 ASHR R4,#05H 0686 6847 AND R4,#07H 0688 F1C8 MOVB RL6,RL4 068A DC4F EXTP R15,#01H 068C B9CE MOVB [R14],RL6 ; SOURCE LINE # 141 068E F4C00500 MOVB RL6,[R0+#05H] ; Time+5 0692 67FC1F00 ANDB RL6,#01FH 0696 DC4F EXTP R15,#01H C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 22 0698 E4CE0400 MOVB [R14+#POF(04H)],RL6 ; SOURCE LINE # 142 069C F4C00400 MOVB RL6,[R0+#04H] ; Time+4 06A0 67FC3F00 ANDB RL6,#03FH 06A4 DC4F EXTP R15,#01H 06A6 E4CE0500 MOVB [R14+#POF(05H)],RL6 ; SOURCE LINE # 143 06AA F4C00300 MOVB RL6,[R0+#03H] ; Time+3 06AE DC4F EXTP R15,#01H 06B0 E4CE0600 MOVB [R14+#POF(06H)],RL6 ; SOURCE LINE # 144 06B4 F4C00200 MOVB RL6,[R0+#02H] ; Time+2 06B8 DC4F EXTP R15,#01H 06BA E4CE0700 MOVB [R14+#POF(07H)],RL6 ; SOURCE LINE # 145 06BE F4C00100 MOVB RL6,[R0+#01H] ; Time+1 06C2 DC4F EXTP R15,#01H 06C4 E4CE0800 MOVB [R14+#POF(08H)],RL6 ; SOURCE LINE # 147 06C8 E108 MOVB RL4,#00H ; SOURCE LINE # 148 06CA ?C0068: 06CA 06F00C00 ADD R0,#0CH 06CE FCFF POP R15 06D0 FCFE POP R14 06D2 FCFD POP R13 06D4 DB00 RETS ; FUNCTION RTCGetTime (END RMASK = @0x7FFF) ; FUNCTION RTCSetAlarm (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 152 06D6 ECFD PUSH R13 06D8 ECFE PUSH R14 06DA ECFF PUSH R15 06DC F0DA MOV R13,R10 ;---- Variable 'DeviceID' assigned to Register 'R13' ---- 06DE F0E8 MOV R14,R8 06E0 F0F9 MOV R15,R9 ;---- Variable 'AlarmTime' assigned to Register 'R14/R15' ---- 06E2 06F0F6FF ADD R0,#0FFF6H ; SOURCE LINE # 159 06E6 E01C MOV R12,#01H 06E8 E00B MOV R11,#00H 06EA F04A MOV R4,R10 06EC C08A MOVBZ R10,RL4 06EE E068 MOV R8,#06H ; TransferByte 06F0 0080 ADD R8,R0 ; TransferByte 06F2 66F8FF3F AND R8,#03FFFH 06F6 F2F904FE MOV R9,DPP2 06FA DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 06FE E4800800 MOVB [R0+#08H],RL4 ; Result 0702 4980 CMPB RL4,#00H 0704 2D03 JMPR cc_Z,?C0077 ; SOURCE LINE # 161 0706 F4800800 MOVB RL4,[R0+#08H] ; Result 070A 0D63 JMPR cc_UC,?C0078 070C ?C0077: ; SOURCE LINE # 163 070C F4800600 MOVB RL4,[R0+#06H] ; TransferByte 0710 6984 ANDB RL4,#04H 0712 C084 MOVBZ R4,RL4 0714 3D03 JMPR cc_NZ,?C0079 ; SOURCE LINE # 164 0716 E7F8FD00 MOVB RL4,#0FDH 071A 0D5B JMPR cc_UC,?C0078 071C ?C0079: C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 23 ; SOURCE LINE # 166 071C E108 MOVB RL4,#00H 071E B980 MOVB [R0],RL4 ; Time ; SOURCE LINE # 167 0720 DC4F EXTP R15,#01H 0722 F48E0800 MOVB RL4,[R14+#POF(08H)] 0726 E4800100 MOVB [R0+#01H],RL4 ; Time+1 ; SOURCE LINE # 168 072A DC4F EXTP R15,#01H 072C F48E0700 MOVB RL4,[R14+#POF(07H)] 0730 E4800200 MOVB [R0+#02H],RL4 ; Time+2 ; SOURCE LINE # 169 0734 DC4F EXTP R15,#01H 0736 F48E0600 MOVB RL4,[R14+#POF(06H)] 073A E4800300 MOVB [R0+#03H],RL4 ; Time+3 ; SOURCE LINE # 170 073E DC4F EXTP R15,#01H 0740 F48E0500 MOVB RL4,[R14+#POF(05H)] 0744 E4800400 MOVB [R0+#04H],RL4 ; Time+4 ; SOURCE LINE # 171 0748 DC4F EXTP R15,#01H 074A F48E0400 MOVB RL4,[R14+#POF(04H)] 074E E4800500 MOVB [R0+#05H],RL4 ; Time+5 ; SOURCE LINE # 173 0752 E06C MOV R12,#06H 0754 E09B MOV R11,#09H 0756 F04D MOV R4,R13 0758 C08A MOVBZ R10,RL4 075A F080 MOV R8,R0 075C 66F8FF3F AND R8,#03FFFH 0760 F2F904FE MOV R9,DPP2 0764 DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 0768 E4800800 MOVB [R0+#08H],RL4 ; Result 076C 4980 CMPB RL4,#00H 076E 2D03 JMPR cc_Z,?C0080 ; SOURCE LINE # 175 0770 F4800800 MOVB RL4,[R0+#08H] ; Result 0774 0D2E JMPR cc_UC,?C0078 0776 ?C0080: ; SOURCE LINE # 177 0776 E7F8B000 MOVB RL4,#0B0H 077A E4800600 MOVB [R0+#06H],RL4 ; TransferByte ; SOURCE LINE # 178 077E E01C MOV R12,#01H 0780 E08B MOV R11,#08H 0782 F04D MOV R4,R13 0784 C08A MOVBZ R10,RL4 0786 E068 MOV R8,#06H ; TransferByte 0788 0080 ADD R8,R0 ; TransferByte 078A 66F8FF3F AND R8,#03FFFH 078E F2F904FE MOV R9,DPP2 0792 DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 0796 E4800800 MOVB [R0+#08H],RL4 ; Result 079A 4980 CMPB RL4,#00H 079C 2D03 JMPR cc_Z,?C0081 ; SOURCE LINE # 180 079E F4800800 MOVB RL4,[R0+#08H] ; Result 07A2 0D17 JMPR cc_UC,?C0078 07A4 ?C0081: ; SOURCE LINE # 182 07A4 E148 MOVB RL4,#04H 07A6 E4800600 MOVB [R0+#06H],RL4 ; TransferByte ; SOURCE LINE # 183 07AA E01C MOV R12,#01H 07AC E00B MOV R11,#00H 07AE F04D MOV R4,R13 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 24 07B0 C08A MOVBZ R10,RL4 07B2 E068 MOV R8,#06H ; TransferByte 07B4 0080 ADD R8,R0 ; TransferByte 07B6 66F8FF3F AND R8,#03FFFH 07BA F2F904FE MOV R9,DPP2 07BE DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 07C2 E4800800 MOVB [R0+#08H],RL4 ; Result 07C6 4980 CMPB RL4,#00H 07C8 2D03 JMPR cc_Z,?C0082 ; SOURCE LINE # 186 07CA F4800800 MOVB RL4,[R0+#08H] ; Result 07CE 0D01 JMPR cc_UC,?C0078 07D0 ?C0082: ; SOURCE LINE # 188 07D0 E108 MOVB RL4,#00H ; SOURCE LINE # 189 07D2 ?C0078: 07D2 06F00A00 ADD R0,#0AH 07D6 FCFF POP R15 07D8 FCFE POP R14 07DA FCFD POP R13 07DC DB00 RETS ; FUNCTION RTCSetAlarm (END RMASK = @0x7FFF) ; FUNCTION RTCGetAlarm (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 193 07DE ECFD PUSH R13 07E0 ECFE PUSH R14 07E2 ECFF PUSH R15 07E4 F0DA MOV R13,R10 ;---- Variable 'DeviceID' assigned to Register 'R13' ---- 07E6 F0E8 MOV R14,R8 07E8 F0F9 MOV R15,R9 ;---- Variable 'AlarmTime' assigned to Register 'R14/R15' ---- 07EA 06F0F2FF ADD R0,#0FFF2H ; SOURCE LINE # 203 07EE E01C MOV R12,#01H 07F0 E00B MOV R11,#00H 07F2 F04A MOV R4,R10 07F4 C08A MOVBZ R10,RL4 07F6 E068 MOV R8,#06H ; TransferByte 07F8 0080 ADD R8,R0 ; TransferByte 07FA 66F8FF3F AND R8,#03FFFH 07FE F2F904FE MOV R9,DPP2 0802 DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 0806 E4800800 MOVB [R0+#08H],RL4 ; Result 080A 4980 CMPB RL4,#00H 080C 2D04 JMPR cc_Z,?C0083 ; SOURCE LINE # 206 080E F4800800 MOVB RL4,[R0+#08H] ; Result 0812 EA007009 R JMPA cc_UC,?C0084 0816 ?C0083: ; SOURCE LINE # 208 0816 F4800600 MOVB RL4,[R0+#06H] ; TransferByte 081A 6984 ANDB RL4,#04H 081C C084 MOVBZ R4,RL4 081E 3D04 JMPR cc_NZ,?C0085 ; SOURCE LINE # 209 0820 E7F8FD00 MOVB RL4,#0FDH 0824 EA007009 R JMPA cc_UC,?C0084 0828 ?C0085: ; SOURCE LINE # 211 0828 E06C MOV R12,#06H 082A E09B MOV R11,#09H 082C F04D MOV R4,R13 082E C08A MOVBZ R10,RL4 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 25 0830 F080 MOV R8,R0 0832 66F8FF3F AND R8,#03FFFH 0836 F2F904FE MOV R9,DPP2 083A DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 083E 4980 CMPB RL4,#00H 0840 2D04 JMPR cc_Z,?C0086 ; SOURCE LINE # 214 0842 F4800800 MOVB RL4,[R0+#08H] ; Result 0846 EA007009 R JMPA cc_UC,?C0084 084A ?C0086: ; SOURCE LINE # 216 084A E02C MOV R12,#02H 084C E6FB1000 MOV R11,#010H 0850 F04D MOV R4,R13 0852 C08A MOVBZ R10,RL4 0854 F08E MOV R8,R14 0856 0882 ADD R8,#02H 0858 F09F MOV R9,R15 085A DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 085E 4980 CMPB RL4,#00H 0860 2D04 JMPR cc_Z,?C0087 ; SOURCE LINE # 219 0862 F4800800 MOVB RL4,[R0+#08H] ; Result 0866 EA007009 R JMPA cc_UC,?C0084 086A ?C0087: ; SOURCE LINE # 221 086A E01C MOV R12,#01H 086C E6FB1200 MOV R11,#012H 0870 F04D MOV R4,R13 0872 C08A MOVBZ R10,RL4 0874 E0A8 MOV R8,#0AH ; Tmp 0876 0080 ADD R8,R0 ; Tmp 0878 66F8FF3F AND R8,#03FFFH 087C F2F904FE MOV R9,DPP2 0880 DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 0884 4980 CMPB RL4,#00H 0886 2D03 JMPR cc_Z,?C0088 ; SOURCE LINE # 222 0888 F4800800 MOVB RL4,[R0+#08H] ; Result 088C 0D71 JMPR cc_UC,?C0084 088E ?C0088: ; SOURCE LINE # 224 088E E01C MOV R12,#01H 0890 E05B MOV R11,#05H 0892 F04D MOV R4,R13 0894 C08A MOVBZ R10,RL4 0896 E0C8 MOV R8,#0CH ; YearDate 0898 0080 ADD R8,R0 ; YearDate 089A 66F8FF3F AND R8,#03FFFH 089E F2F904FE MOV R9,DPP2 08A2 DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 08A6 4980 CMPB RL4,#00H 08A8 2D03 JMPR cc_Z,?C0089 ; SOURCE LINE # 225 08AA F4800800 MOVB RL4,[R0+#08H] ; Result 08AE 0D60 JMPR cc_UC,?C0084 08B0 ?C0089: ; SOURCE LINE # 227 08B0 F4C00C00 MOVB RL6,[R0+#0CH] ; YearDate 08B4 C0C1 MOVBZ R1,RL6 08B6 7C61 SHR R1,#06H 08B8 C027 MOVBZ R7,RL1 08BA F4A00A00 MOVB RL5,[R0+#0AH] ; Tmp 08BE C0A5 MOVBZ R5,RL5 08C0 2075 SUB R7,R5 ;---- Variable 'i' assigned to Register 'R7' ---- C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 26 08C2 4870 CMP R7,#00H 08C4 2D32 JMPR cc_Z,?C0090 ; SOURCE LINE # 228 08C6 E4200A00 MOVB [R0+#0AH],RL1 ; Tmp ; SOURCE LINE # 230 08CA 4870 CMP R7,#00H 08CC DD01 JMPR cc_SGE,?C0091 ; SOURCE LINE # 231 08CE 0874 ADD R7,#04H 08D0 ?C0091: ; SOURCE LINE # 233 08D0 DC4F EXTP R15,#01H 08D2 D48E0200 MOV R8,[R14+#POF(02H)] 08D6 DA000000 R CALLS SEG (BCD2INT),BCD2INT 08DA F084 MOV R8,R4 08DC 0087 ADD R8,R7 08DE DA000000 R CALLS SEG (INT2BCD),INT2BCD 08E2 DC4F EXTP R15,#01H 08E4 C44E0200 MOV [R14+#POF(02H)],R4 ; SOURCE LINE # 235 08E8 E02C MOV R12,#02H 08EA E6FB1000 MOV R11,#010H 08EE F04D MOV R4,R13 08F0 C08A MOVBZ R10,RL4 08F2 F08E MOV R8,R14 08F4 0882 ADD R8,#02H 08F6 F09F MOV R9,R15 08F8 DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 08FC 4980 CMPB RL4,#00H 08FE 2D03 JMPR cc_Z,?C0092 ; SOURCE LINE # 238 0900 F4800800 MOVB RL4,[R0+#08H] ; Result 0904 0D35 JMPR cc_UC,?C0084 0906 ?C0092: ; SOURCE LINE # 240 0906 E01C MOV R12,#01H 0908 E6FB1200 MOV R11,#012H 090C F04D MOV R4,R13 090E C08A MOVBZ R10,RL4 0910 E0A8 MOV R8,#0AH ; Tmp 0912 0080 ADD R8,R0 ; Tmp 0914 66F8FF3F AND R8,#03FFFH 0918 F2F904FE MOV R9,DPP2 091C DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 0920 4980 CMPB RL4,#00H 0922 2D03 JMPR cc_Z,?C0090 ; SOURCE LINE # 241 0924 F4800800 MOVB RL4,[R0+#08H] ; Result 0928 0D23 JMPR cc_UC,?C0084 ; SOURCE LINE # 242 092A ?C0090: ; SOURCE LINE # 244 092A E006 MOV R6,#00H 092C DC5F EXTP R15,#02H 092E C46E0200 MOV [R14+#POF(02H)],R6 ; SOURCE LINE # 245 0932 B9CE MOVB [R14],RL6 ; SOURCE LINE # 246 0934 F4C00500 MOVB RL6,[R0+#05H] ; Time+5 0938 67FC1F00 ANDB RL6,#01FH 093C DC4F EXTP R15,#01H 093E E4CE0400 MOVB [R14+#POF(04H)],RL6 ; SOURCE LINE # 247 0942 F4C00400 MOVB RL6,[R0+#04H] ; Time+4 0946 67FC3F00 ANDB RL6,#03FH 094A DC4F EXTP R15,#01H C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 27 094C E4CE0500 MOVB [R14+#POF(05H)],RL6 ; SOURCE LINE # 248 0950 F4C00300 MOVB RL6,[R0+#03H] ; Time+3 0954 DC4F EXTP R15,#01H 0956 E4CE0600 MOVB [R14+#POF(06H)],RL6 ; SOURCE LINE # 249 095A F4C00200 MOVB RL6,[R0+#02H] ; Time+2 095E DC4F EXTP R15,#01H 0960 E4CE0700 MOVB [R14+#POF(07H)],RL6 ; SOURCE LINE # 250 0964 F4C00100 MOVB RL6,[R0+#01H] ; Time+1 0968 DC4F EXTP R15,#01H 096A E4CE0800 MOVB [R14+#POF(08H)],RL6 ; SOURCE LINE # 252 096E E108 MOVB RL4,#00H ; SOURCE LINE # 253 0970 ?C0084: 0970 06F00E00 ADD R0,#0EH 0974 FCFF POP R15 0976 FCFE POP R14 0978 FCFD POP R13 097A DB00 RETS ; FUNCTION RTCGetAlarm (END RMASK = @0x7FFF) ; FUNCTION RTCGetAlarmStatus (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 257 097C ECFD PUSH R13 097E ECFE PUSH R14 0980 ECFF PUSH R15 0982 F0DA MOV R13,R10 ;---- Variable 'DeviceID' assigned to Register 'R13' ---- 0984 F0E8 MOV R14,R8 0986 F0F9 MOV R15,R9 ;---- Variable 'AlarmStatus' assigned to Register 'R14/R15' ---- 0988 2804 SUB R0,#04H ; SOURCE LINE # 263 098A E01C MOV R12,#01H 098C E00B MOV R11,#00H 098E F04A MOV R4,R10 0990 C08A MOVBZ R10,RL4 0992 F080 MOV R8,R0 0994 66F8FF3F AND R8,#03FFFH 0998 F2F904FE MOV R9,DPP2 099C DA000000 R CALLS SEG (RTCGetRAM),RTCGetRAM 09A0 E4800200 MOVB [R0+#02H],RL4 ; Result 09A4 4980 CMPB RL4,#00H 09A6 2D03 JMPR cc_Z,?C0094 ; SOURCE LINE # 266 09A8 F4800200 MOVB RL4,[R0+#02H] ; Result 09AC 0D3B JMPR cc_UC,?C0095 09AE ?C0094: ; SOURCE LINE # 268 09AE A9A0 MOVB RL5,[R0] ; TransferByte 09B0 F18A MOVB RL4,RL5 09B2 6984 ANDB RL4,#04H 09B4 C084 MOVBZ R4,RL4 09B6 3D03 JMPR cc_NZ,?C0096 ; SOURCE LINE # 269 09B8 E7F8FD00 MOVB RL4,#0FDH 09BC 0D33 JMPR cc_UC,?C0095 09BE ?C0096: ; SOURCE LINE # 271 09BE 69A2 ANDB RL5,#02H 09C0 C0A4 MOVBZ R4,RL5 09C2 3D04 JMPR cc_NZ,?C0097 ; SOURCE LINE # 272 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 28 09C4 E10C MOVB RL6,#00H 09C6 DC4F EXTP R15,#01H 09C8 B9CE MOVB [R14],RL6 09CA 0D2B JMPR cc_UC,?C0098 09CC ?C0097: ; SOURCE LINE # 274 09CC E11C MOVB RL6,#01H 09CE DC4F EXTP R15,#01H 09D0 B9CE MOVB [R14],RL6 ; SOURCE LINE # 276 09D2 E108 MOVB RL4,#00H 09D4 B980 MOVB [R0],RL4 ; TransferByte ; SOURCE LINE # 277 09D6 E01C MOV R12,#01H 09D8 E08B MOV R11,#08H 09DA F04D MOV R4,R13 09DC C08A MOVBZ R10,RL4 09DE F080 MOV R8,R0 09E0 66F8FF3F AND R8,#03FFFH 09E4 F2F904FE MOV R9,DPP2 09E8 DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 09EC E4800200 MOVB [R0+#02H],RL4 ; Result 09F0 4980 CMPB RL4,#00H 09F2 2D03 JMPR cc_Z,?C0099 ; SOURCE LINE # 279 09F4 F4800200 MOVB RL4,[R0+#02H] ; Result 09F8 0D15 JMPR cc_UC,?C0095 09FA ?C0099: ; SOURCE LINE # 281 09FA E148 MOVB RL4,#04H 09FC B980 MOVB [R0],RL4 ; TransferByte ; SOURCE LINE # 282 09FE E01C MOV R12,#01H 0A00 E00B MOV R11,#00H 0A02 F04D MOV R4,R13 0A04 C08A MOVBZ R10,RL4 0A06 F080 MOV R8,R0 0A08 66F8FF3F AND R8,#03FFFH 0A0C F2F904FE MOV R9,DPP2 0A10 DA000000 R CALLS SEG (RTCPutRAM),RTCPutRAM 0A14 E4800200 MOVB [R0+#02H],RL4 ; Result 0A18 4980 CMPB RL4,#00H 0A1A 2D03 JMPR cc_Z,?C0098 ; SOURCE LINE # 284 0A1C F4800200 MOVB RL4,[R0+#02H] ; Result 0A20 0D01 JMPR cc_UC,?C0095 ; SOURCE LINE # 285 0A22 ?C0098: ; SOURCE LINE # 287 0A22 E108 MOVB RL4,#00H ; SOURCE LINE # 288 0A24 ?C0095: 0A24 0804 ADD R0,#04H 0A26 FCFF POP R15 0A28 FCFE POP R14 0A2A FCFD POP R13 0A2C DB00 RETS ; FUNCTION RTCGetAlarmStatus (END RMASK = @0x7FFF) ; FUNCTION RTCPutRAM (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 292 0A2E F06C MOV R6,R12 ;---- Variable 'Size' assigned to Register 'R6' ---- ;---- Variable 'DestAddr' assigned to Register 'R11' ---- ;---- Variable 'DeviceID' assigned to Register 'R10' ---- 0A30 F028 MOV R2,R8 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 29 0A32 F039 MOV R3,R9 ;---- Variable 'SourcePtr' assigned to Register 'R2/R3' ---- ; SOURCE LINE # 300 0A34 DA000000 R CALLS SEG (I2CInit),I2CInit ; SOURCE LINE # 302 0A38 F0C6 MOV R12,R6 0A3A F04B MOV R4,R11 0A3C C08B MOVBZ R11,RL4 0A3E F04A MOV R4,R10 0A40 C08A MOVBZ R10,RL4 0A42 F093 MOV R9,R3 0A44 F082 MOV R8,R2 0A46 DA000000 R CALLS SEG (I2CWrite),I2CWrite 0A4A 4980 CMPB RL4,#00H 0A4C 2D03 JMPR cc_Z,?C0101 ; SOURCE LINE # 304 0A4E E7F8FE00 MOVB RL4,#0FEH 0A52 DB00 RETS 0A54 ?C0101: ; SOURCE LINE # 306 0A54 E108 MOVB RL4,#00H ; SOURCE LINE # 307 0A56 ?C0102: 0A56 DB00 RETS ; FUNCTION RTCPutRAM (END RMASK = @0x7FFF) ; FUNCTION RTCGetRAM (BEGIN RMASK = @0x7FFF) ; SOURCE LINE # 311 0A58 F06C MOV R6,R12 ;---- Variable 'Size' assigned to Register 'R6' ---- ;---- Variable 'SourceAddr' assigned to Register 'R11' ---- ;---- Variable 'DeviceID' assigned to Register 'R10' ---- 0A5A F028 MOV R2,R8 0A5C F039 MOV R3,R9 ;---- Variable 'DestPtr' assigned to Register 'R2/R3' ---- ; SOURCE LINE # 315 0A5E DA000000 R CALLS SEG (I2CInit),I2CInit ; SOURCE LINE # 316 0A62 F0C6 MOV R12,R6 0A64 F04B MOV R4,R11 0A66 C08B MOVBZ R11,RL4 0A68 F04A MOV R4,R10 0A6A C08A MOVBZ R10,RL4 0A6C F093 MOV R9,R3 0A6E F082 MOV R8,R2 0A70 DA000000 R CALLS SEG (I2CRead),I2CRead 0A74 4980 CMPB RL4,#00H 0A76 2D03 JMPR cc_Z,?C0103 ; SOURCE LINE # 317 0A78 E7F8FF00 MOVB RL4,#0FFH 0A7C DB00 RETS 0A7E ?C0103: ; SOURCE LINE # 319 0A7E E108 MOVB RL4,#00H ; SOURCE LINE # 320 0A80 ?C0104: 0A80 DB00 RETS ; FUNCTION RTCGetRAM (END RMASK = @0x7FFF) C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 30 NAME CLASS SPACE TYPE OFFSET SIZE ---------------------------------------------------------------------------- RTC_ALARM_TIME . . . . . . . . . . . . --tag-- struct ----- 6 Sec100 . . . . . . . . . . . . . . . member uchar 0H 1 Second . . . . . . . . . . . . . . . member uchar 1H 1 Minute . . . . . . . . . . . . . . . member uchar 2H 1 Hour . . . . . . . . . . . . . . . . member uchar 3H 1 YearDate . . . . . . . . . . . . . . member uchar 4H 1 WeekdayMonth . . . . . . . . . . . . member uchar 5H 1 RTC_ALARM_TIME . . . . . . . . . . . . typedef struct ----- 6 Sec100 . . . . . . . . . . . . . . . member uchar 0H 1 Second . . . . . . . . . . . . . . . member uchar 1H 1 Minute . . . . . . . . . . . . . . . member uchar 2H 1 Hour . . . . . . . . . . . . . . . . member uchar 3H 1 YearDate . . . . . . . . . . . . . . member uchar 4H 1 WeekdayMonth . . . . . . . . . . . . member uchar 5H 1 REAL_TIME. . . . . . . . . . . . . . . --tag-- struct ----- 10 Weekday. . . . . . . . . . . . . . . member uchar 0H 1 . . . . . . . . . . . . . . . . member uchar 1H 1 Year . . . . . . . . . . . . . . . . member uint 2H 2 Month. . . . . . . . . . . . . . . . member uchar 4H 1 Date . . . . . . . . . . . . . . . . member uchar 5H 1 Hour . . . . . . . . . . . . . . . . member uchar 6H 1 Minute . . . . . . . . . . . . . . . member uchar 7H 1 Second . . . . . . . . . . . . . . . member uchar 8H 1 REAL_TIME. . . . . . . . . . . . . . . typedef struct ----- 10 Weekday. . . . . . . . . . . . . . . member uchar 0H 1 . . . . . . . . . . . . . . . . member uchar 1H 1 Year . . . . . . . . . . . . . . . . member uint 2H 2 Month. . . . . . . . . . . . . . . . member uchar 4H 1 Date . . . . . . . . . . . . . . . . member uchar 5H 1 Hour . . . . . . . . . . . . . . . . member uchar 6H 1 Minute . . . . . . . . . . . . . . . member uchar 7H 1 Second . . . . . . . . . . . . . . . member uchar 8H 1 RTC_REAL_TIME. . . . . . . . . . . . . --tag-- struct ----- 6 Sec100 . . . . . . . . . . . . . . . member uchar 0H 1 Second . . . . . . . . . . . . . . . member uchar 1H 1 Minute . . . . . . . . . . . . . . . member uchar 2H 1 Hour . . . . . . . . . . . . . . . . member uchar 3H 1 YearDate . . . . . . . . . . . . . . member uchar 4H 1 WeekdayMonth . . . . . . . . . . . . member uchar 5H 1 RTC_REAL_TIME. . . . . . . . . . . . . typedef struct ----- 6 Sec100 . . . . . . . . . . . . . . . member uchar 0H 1 Second . . . . . . . . . . . . . . . member uchar 1H 1 Minute . . . . . . . . . . . . . . . member uchar 2H 1 Hour . . . . . . . . . . . . . . . . member uchar 3H 1 YearDate . . . . . . . . . . . . . . member uchar 4H 1 WeekdayMonth . . . . . . . . . . . . member uchar 5H 1 CC19IC . . . . . . . . . . . . . . . . sfr uint F166H 2 CC28IC . . . . . . . . . . . . . . . . sfr uint F178H 2 BUSCON1. . . . . . . . . . . . . . . . sfr uint FF14H 2 CC18IC . . . . . . . . . . . . . . . . sfr uint F164H 2 CC27IC . . . . . . . . . . . . . . . . sfr uint F176H 2 BUSCON0. . . . . . . . . . . . . . . . sfr uint FF0CH 2 CC17IC . . . . . . . . . . . . . . . . sfr uint F162H 2 CC26IC . . . . . . . . . . . . . . . . sfr uint F174H 2 CC16IC . . . . . . . . . . . . . . . . sfr uint F160H 2 CC25IC . . . . . . . . . . . . . . . . sfr uint F172H 2 PSW. . . . . . . . . . . . . . . . . . sfr uint FF10H 2 CC15IC . . . . . . . . . . . . . . . . sfr uint FF96H 2 CC24IC . . . . . . . . . . . . . . . . sfr uint F170H 2 CC14IC . . . . . . . . . . . . . . . . sfr uint FF94H 2 CC23IC . . . . . . . . . . . . . . . . sfr uint F16EH 2 CC13IC . . . . . . . . . . . . . . . . sfr uint FF92H 2 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 31 CC22IC . . . . . . . . . . . . . . . . sfr uint F16CH 2 CC31IC . . . . . . . . . . . . . . . . sfr uint F194H 2 CC12IC . . . . . . . . . . . . . . . . sfr uint FF90H 2 CC21IC . . . . . . . . . . . . . . . . sfr uint F16AH 2 CC30IC . . . . . . . . . . . . . . . . sfr uint F18CH 2 CC11IC . . . . . . . . . . . . . . . . sfr uint FF8EH 2 CC20IC . . . . . . . . . . . . . . . . sfr uint F168H 2 CC10IC . . . . . . . . . . . . . . . . sfr uint FF8CH 2 CC29 . . . . . . . . . . . . . . . . . sfr uint FE7AH 2 CC19 . . . . . . . . . . . . . . . . . sfr uint FE66H 2 CC28 . . . . . . . . . . . . . . . . . sfr uint FE78H 2 T8REL. . . . . . . . . . . . . . . . . sfr uint F056H 2 CC18 . . . . . . . . . . . . . . . . . sfr uint FE64H 2 CC27 . . . . . . . . . . . . . . . . . sfr uint FE76H 2 T7REL. . . . . . . . . . . . . . . . . sfr uint F054H 2 WDT. . . . . . . . . . . . . . . . . . sfr uint FEAEH 2 CC17 . . . . . . . . . . . . . . . . . sfr uint FE62H 2 CC26 . . . . . . . . . . . . . . . . . sfr uint FE74H 2 CC16 . . . . . . . . . . . . . . . . . sfr uint FE60H 2 CC25 . . . . . . . . . . . . . . . . . sfr uint FE72H 2 CC15 . . . . . . . . . . . . . . . . . sfr uint FE9EH 2 CC24 . . . . . . . . . . . . . . . . . sfr uint FE70H 2 TFR. . . . . . . . . . . . . . . . . . sfr uint FFACH 2 CC14 . . . . . . . . . . . . . . . . . sfr uint FE9CH 2 CC23 . . . . . . . . . . . . . . . . . sfr uint FE6EH 2 T6CON. . . . . . . . . . . . . . . . . sfr uint FF48H 2 CC13 . . . . . . . . . . . . . . . . . sfr uint FE9AH 2 CC22 . . . . . . . . . . . . . . . . . sfr uint FE6CH 2 CC31 . . . . . . . . . . . . . . . . . sfr uint FE7EH 2 T5CON. . . . . . . . . . . . . . . . . sfr uint FF46H 2 CC12 . . . . . . . . . . . . . . . . . sfr uint FE98H 2 CC21 . . . . . . . . . . . . . . . . . sfr uint FE6AH 2 CC30 . . . . . . . . . . . . . . . . . sfr uint FE7CH 2 T1REL. . . . . . . . . . . . . . . . . sfr uint FE56H 2 T4CON. . . . . . . . . . . . . . . . . sfr uint FF44H 2 CC11 . . . . . . . . . . . . . . . . . sfr uint FE96H 2 CC20 . . . . . . . . . . . . . . . . . sfr uint FE68H 2 T0REL. . . . . . . . . . . . . . . . . sfr uint FE54H 2 T3CON. . . . . . . . . . . . . . . . . sfr uint FF42H 2 XP3IC. . . . . . . . . . . . . . . . . sfr uint F19EH 2 CC10 . . . . . . . . . . . . . . . . . sfr uint FE94H 2 T2CON. . . . . . . . . . . . . . . . . sfr uint FF40H 2 XP2IC. . . . . . . . . . . . . . . . . sfr uint F196H 2 ADCON. . . . . . . . . . . . . . . . . sfr uint FFA0H 2 CSP. . . . . . . . . . . . . . . . . . sfr uint FE08H 2 XP1IC. . . . . . . . . . . . . . . . . sfr uint F18EH 2 XP0IC. . . . . . . . . . . . . . . . . sfr uint F186H 2 S0CON. . . . . . . . . . . . . . . . . sfr uint FFB0H 2 S0TIC. . . . . . . . . . . . . . . . . sfr uint FF6CH 2 S0RIC. . . . . . . . . . . . . . . . . sfr uint FF6EH 2 SYSCON . . . . . . . . . . . . . . . . sfr uint FF12H 2 ADDAT. . . . . . . . . . . . . . . . . sfr uint FEA0H 2 MDL. . . . . . . . . . . . . . . . . . sfr uint FE0EH 2 PW3. . . . . . . . . . . . . . . . . . sfr uint FE36H 2 MDH. . . . . . . . . . . . . . . . . . sfr uint FE0CH 2 PW2. . . . . . . . . . . . . . . . . . sfr uint FE34H 2 PW1. . . . . . . . . . . . . . . . . . sfr uint FE32H 2 ADEIC. . . . . . . . . . . . . . . . . sfr uint FF9AH 2 PW0. . . . . . . . . . . . . . . . . . sfr uint FE30H 2 PT3. . . . . . . . . . . . . . . . . . sfr uint F036H 2 PT2. . . . . . . . . . . . . . . . . . sfr uint F034H 2 ADCIC. . . . . . . . . . . . . . . . . sfr uint FF98H 2 S0EIC. . . . . . . . . . . . . . . . . sfr uint FF70H 2 PT1. . . . . . . . . . . . . . . . . . sfr uint F032H 2 MDC. . . . . . . . . . . . . . . . . . sfr uint FF0EH 2 PT0. . . . . . . . . . . . . . . . . . sfr uint F030H 2 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 32 PECC7. . . . . . . . . . . . . . . . . sfr uint FECEH 2 PP3. . . . . . . . . . . . . . . . . . sfr uint F03EH 2 PECC6. . . . . . . . . . . . . . . . . sfr uint FECCH 2 PP2. . . . . . . . . . . . . . . . . . sfr uint F03CH 2 PECC5. . . . . . . . . . . . . . . . . sfr uint FECAH 2 WDTCON . . . . . . . . . . . . . . . . sfr uint FFAEH 2 PP1. . . . . . . . . . . . . . . . . . sfr uint F03AH 2 PECC4. . . . . . . . . . . . . . . . . sfr uint FEC8H 2 PP0. . . . . . . . . . . . . . . . . . sfr uint F038H 2 PECC3. . . . . . . . . . . . . . . . . sfr uint FEC6H 2 PECC2. . . . . . . . . . . . . . . . . sfr uint FEC4H 2 PECC1. . . . . . . . . . . . . . . . . sfr uint FEC2H 2 P1L. . . . . . . . . . . . . . . . . . sfr uint FF04H 2 CC9IC. . . . . . . . . . . . . . . . . sfr uint FF8AH 2 PECC0. . . . . . . . . . . . . . . . . sfr uint FEC0H 2 DP8. . . . . . . . . . . . . . . . . . sfr uint FFD6H 2 P0L. . . . . . . . . . . . . . . . . . sfr uint FF00H 2 CC8IC. . . . . . . . . . . . . . . . . sfr uint FF88H 2 DP7. . . . . . . . . . . . . . . . . . sfr uint FFD2H 2 SSCTIC . . . . . . . . . . . . . . . . sfr uint FF72H 2 SSCCON . . . . . . . . . . . . . . . . sfr uint FFB2H 2 CC7IC. . . . . . . . . . . . . . . . . sfr uint FF86H 2 DP6. . . . . . . . . . . . . . . . . . sfr uint FFCEH 2 CC6IC. . . . . . . . . . . . . . . . . sfr uint FF84H 2 P1H. . . . . . . . . . . . . . . . . . sfr uint FF06H 2 SSCRIC . . . . . . . . . . . . . . . . sfr uint FF74H 2 CC5IC. . . . . . . . . . . . . . . . . sfr uint FF82H 2 EXICON . . . . . . . . . . . . . . . . sfr uint F1C0H 2 DP4. . . . . . . . . . . . . . . . . . sfr uint FFCAH 2 P0H. . . . . . . . . . . . . . . . . . sfr uint FF02H 2 CC4IC. . . . . . . . . . . . . . . . . sfr uint FF80H 2 DP3. . . . . . . . . . . . . . . . . . sfr uint FFC6H 2 CC3IC. . . . . . . . . . . . . . . . . sfr uint FF7EH 2 DP2. . . . . . . . . . . . . . . . . . sfr uint FFC2H 2 CC2IC. . . . . . . . . . . . . . . . . sfr uint FF7CH 2 CC1IC. . . . . . . . . . . . . . . . . sfr uint FF7AH 2 CC0IC. . . . . . . . . . . . . . . . . sfr uint FF78H 2 CC9. . . . . . . . . . . . . . . . . . sfr uint FE92H 2 CC8. . . . . . . . . . . . . . . . . . sfr uint FE90H 2 CC7. . . . . . . . . . . . . . . . . . sfr uint FE8EH 2 CC6. . . . . . . . . . . . . . . . . . sfr uint FE8CH 2 SSCEIC . . . . . . . . . . . . . . . . sfr uint FF76H 2 CC5. . . . . . . . . . . . . . . . . . sfr uint FE8AH 2 CC4. . . . . . . . . . . . . . . . . . sfr uint FE88H 2 CC3. . . . . . . . . . . . . . . . . . sfr uint FE86H 2 CAPREL . . . . . . . . . . . . . . . . sfr uint FE4AH 2 CC2. . . . . . . . . . . . . . . . . . sfr uint FE84H 2 CC1. . . . . . . . . . . . . . . . . . sfr uint FE82H 2 CC0. . . . . . . . . . . . . . . . . . sfr uint FE80H 2 ONES . . . . . . . . . . . . . . . . . sfr uint FF1EH 2 ADDRSEL4 . . . . . . . . . . . . . . . sfr uint FE1EH 2 S0TBUF . . . . . . . . . . . . . . . . sfr uint FEB0H 2 ADDRSEL3 . . . . . . . . . . . . . . . sfr uint FE1CH 2 ADDRSEL2 . . . . . . . . . . . . . . . sfr uint FE1AH 2 S0RBUF . . . . . . . . . . . . . . . . sfr uint FEB2H 2 ADDRSEL1 . . . . . . . . . . . . . . . sfr uint FE18H 2 ISNC . . . . . . . . . . . . . . . . . sfr uint F1DEH 2 S0TBIC . . . . . . . . . . . . . . . . sfr uint F19CH 2 T78CON . . . . . . . . . . . . . . . . sfr uint FF20H 2 SP . . . . . . . . . . . . . . . . . . sfr uint FE12H 2 CRIC . . . . . . . . . . . . . . . . . sfr uint FF6AH 2 ODP8 . . . . . . . . . . . . . . . . . sfr uint F1D6H 2 ODP7 . . . . . . . . . . . . . . . . . sfr uint F1D2H 2 RP0H . . . . . . . . . . . . . . . . . sfr uint F108H 2 ODP6 . . . . . . . . . . . . . . . . . sfr uint F1CEH 2 T8IC . . . . . . . . . . . . . . . . . sfr uint F17CH 2 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 33 STKOV. . . . . . . . . . . . . . . . . sfr uint FE14H 2 T7IC . . . . . . . . . . . . . . . . . sfr uint F17AH 2 DPP3 . . . . . . . . . . . . . . . . . sfr uint FE06H 2 T01CON . . . . . . . . . . . . . . . . sfr uint FF50H 2 DPP2 . . . . . . . . . . . . . . . . . sfr uint FE04H 2 STKUN. . . . . . . . . . . . . . . . . sfr uint FE16H 2 ODP3 . . . . . . . . . . . . . . . . . sfr uint F1C6H 2 T6IC . . . . . . . . . . . . . . . . . sfr uint FF68H 2 DPP1 . . . . . . . . . . . . . . . . . sfr uint FE02H 2 ODP2 . . . . . . . . . . . . . . . . . sfr uint F1C2H 2 T5IC . . . . . . . . . . . . . . . . . sfr uint FF66H 2 DPP0 . . . . . . . . . . . . . . . . . sfr uint FE00H 2 ZEROS. . . . . . . . . . . . . . . . . sfr uint FF1CH 2 T4IC . . . . . . . . . . . . . . . . . sfr uint FF64H 2 T3IC . . . . . . . . . . . . . . . . . sfr uint FF62H 2 CP . . . . . . . . . . . . . . . . . . sfr uint FE10H 2 T2IC . . . . . . . . . . . . . . . . . sfr uint FF60H 2 ADDAT2 . . . . . . . . . . . . . . . . sfr uint F0A0H 2 T1IC . . . . . . . . . . . . . . . . . sfr uint FF9EH 2 DP1L . . . . . . . . . . . . . . . . . sfr uint F104H 2 T0IC . . . . . . . . . . . . . . . . . sfr uint FF9CH 2 DP0L . . . . . . . . . . . . . . . . . sfr uint F100H 2 DP1H . . . . . . . . . . . . . . . . . sfr uint F106H 2 DP0H . . . . . . . . . . . . . . . . . sfr uint F102H 2 S0BG . . . . . . . . . . . . . . . . . sfr uint FEB4H 2 T8 . . . . . . . . . . . . . . . . . . sfr uint F052H 2 CCM7 . . . . . . . . . . . . . . . . . sfr uint FF28H 2 T7 . . . . . . . . . . . . . . . . . . sfr uint F050H 2 CCM6 . . . . . . . . . . . . . . . . . sfr uint FF26H 2 T6 . . . . . . . . . . . . . . . . . . sfr uint FE48H 2 CCM5 . . . . . . . . . . . . . . . . . sfr uint FF24H 2 T5 . . . . . . . . . . . . . . . . . . sfr uint FE46H 2 CCM4 . . . . . . . . . . . . . . . . . sfr uint FF22H 2 P8 . . . . . . . . . . . . . . . . . . sfr uint FFD4H 2 T4 . . . . . . . . . . . . . . . . . . sfr uint FE44H 2 PWMCON1. . . . . . . . . . . . . . . . sfr uint FF32H 2 CCM3 . . . . . . . . . . . . . . . . . sfr uint FF58H 2 P7 . . . . . . . . . . . . . . . . . . sfr uint FFD0H 2 T3 . . . . . . . . . . . . . . . . . . sfr uint FE42H 2 PWMCON0. . . . . . . . . . . . . . . . sfr uint FF30H 2 CCM2 . . . . . . . . . . . . . . . . . sfr uint FF56H 2 P6 . . . . . . . . . . . . . . . . . . sfr uint FFCCH 2 T2 . . . . . . . . . . . . . . . . . . sfr uint FE40H 2 CCM1 . . . . . . . . . . . . . . . . . sfr uint FF54H 2 T1 . . . . . . . . . . . . . . . . . . sfr uint FE52H 2 P5 . . . . . . . . . . . . . . . . . . sfr uint FFA2H 2 CCM0 . . . . . . . . . . . . . . . . . sfr uint FF52H 2 T0 . . . . . . . . . . . . . . . . . . sfr uint FE50H 2 P4 . . . . . . . . . . . . . . . . . . sfr uint FFC8H 2 P3 . . . . . . . . . . . . . . . . . . sfr uint FFC4H 2 P2 . . . . . . . . . . . . . . . . . . sfr uint FFC0H 2 PWMIC. . . . . . . . . . . . . . . . . sfr uint F17EH 2 BUSCON4. . . . . . . . . . . . . . . . sfr uint FF1AH 2 SSCTB. . . . . . . . . . . . . . . . . sfr uint F0B0H 2 BUSCON3. . . . . . . . . . . . . . . . sfr uint FF18H 2 CC29IC . . . . . . . . . . . . . . . . sfr uint F184H 2 BUSCON2. . . . . . . . . . . . . . . . sfr uint FF16H 2 SSCRB. . . . . . . . . . . . . . . . . sfr uint F0B2H 2 SSCBR. . . . . . . . . . . . . . . . . sfr uint F0B4H 2 RTCGetAlarm. . . . . . . . . . . . . . public FCODE funct ----- AlarmTime. . . . . . . . . . . . . . --reg-- ptr ----- 4 DeviceID . . . . . . . . . . . . . . --reg-- uchar ----- 1 Time . . . . . . . . . . . . . . . . auto struct 0H 6 TransferByte . . . . . . . . . . . . auto uchar 6H 1 Result . . . . . . . . . . . . . . . auto uchar 8H 1 Tmp. . . . . . . . . . . . . . . . . auto uchar AH 1 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 34 i. . . . . . . . . . . . . . . . . . --reg-- int ----- 2 YearDate . . . . . . . . . . . . . . auto uchar CH 1 RTCGetRAM. . . . . . . . . . . . . . . public FCODE funct ----- DestPtr. . . . . . . . . . . . . . . --reg-- ptr ----- 4 DeviceID . . . . . . . . . . . . . . --reg-- uchar ----- 1 SourceAddr . . . . . . . . . . . . . --reg-- uchar ----- 1 Size . . . . . . . . . . . . . . . . --reg-- uint ----- 2 I2CSendBit . . . . . . . . . . . . . . public FCODE funct ----- State. . . . . . . . . . . . . . . . --reg-- uchar ----- 1 BCD2INT. . . . . . . . . . . . . . . . public FCODE funct ----- BCDValue . . . . . . . . . . . . . . --reg-- uint ----- 2 Result . . . . . . . . . . . . . . . --reg-- int ----- 2 INT2BCD. . . . . . . . . . . . . . . . public FCODE funct ----- INTValue . . . . . . . . . . . . . . --reg-- int ----- 2 Result . . . . . . . . . . . . . . . --reg-- uint ----- 2 I2CStop. . . . . . . . . . . . . . . . public FCODE funct ----- I2CWriteByte . . . . . . . . . . . . . public FCODE funct ----- TransferData . . . . . . . . . . . . --reg-- uchar ----- 1 Loop . . . . . . . . . . . . . . . . --reg-- uchar ----- 1 I2CPutSCL. . . . . . . . . . . . . . . public FCODE funct ----- State. . . . . . . . . . . . . . . . --reg-- uchar ----- 1 I2CSendAck . . . . . . . . . . . . . . public FCODE funct ----- I2CInit. . . . . . . . . . . . . . . . public FCODE funct ----- I2CReadByte. . . . . . . . . . . . . . public FCODE funct ----- Value. . . . . . . . . . . . . . . . --reg-- uchar ----- 1 Loop . . . . . . . . . . . . . . . . --reg-- uchar ----- 1 I2CPutSDA. . . . . . . . . . . . . . . public FCODE funct ----- State. . . . . . . . . . . . . . . . --reg-- uchar ----- 1 I2CStart . . . . . . . . . . . . . . . public FCODE funct ----- I2CWrite . . . . . . . . . . . . . . . public FCODE funct ----- SourcePtr. . . . . . . . . . . . . . --reg-- ptr ----- 4 DeviceID . . . . . . . . . . . . . . param uchar 2H 1 DestAddr . . . . . . . . . . . . . . param uchar 4H 1 Size . . . . . . . . . . . . . . . . --reg-- uint ----- 2 Result . . . . . . . . . . . . . . . auto uchar 0H 1 I2CGetSCL. . . . . . . . . . . . . . . public FCODE funct ----- I2CRead. . . . . . . . . . . . . . . . public FCODE funct ----- DestPtr. . . . . . . . . . . . . . . param ptr 2H 4 DeviceID . . . . . . . . . . . . . . --reg-- uchar ----- 1 SourceAddr . . . . . . . . . . . . . --reg-- uchar ----- 1 Size . . . . . . . . . . . . . . . . --reg-- uint ----- 2 Result . . . . . . . . . . . . . . . auto uchar 0H 1 I2CGetSDA. . . . . . . . . . . . . . . public FCODE funct ----- I2CDelay . . . . . . . . . . . . . . . public FCODE funct ----- Count. . . . . . . . . . . . . . . . --reg-- uchar ----- 1 RTCSetTime . . . . . . . . . . . . . . public FCODE funct ----- RealTime . . . . . . . . . . . . . . --reg-- ptr ----- 4 DeviceID . . . . . . . . . . . . . . --reg-- uchar ----- 1 Time . . . . . . . . . . . . . . . . auto struct 0H 6 TransferByte . . . . . . . . . . . . auto uchar 6H 1 Result . . . . . . . . . . . . . . . auto uchar 8H 1 Tmp. . . . . . . . . . . . . . . . . auto uchar AH 1 I2CReceiveBit. . . . . . . . . . . . . public FCODE funct ----- State. . . . . . . . . . . . . . . . --reg-- uchar ----- 1 RTCGetTime . . . . . . . . . . . . . . public FCODE funct ----- RealTime . . . . . . . . . . . . . . --reg-- ptr ----- 4 DeviceID . . . . . . . . . . . . . . --reg-- uchar ----- 1 Time . . . . . . . . . . . . . . . . auto struct 0H 6 TransferByte . . . . . . . . . . . . auto uchar 6H 1 Result . . . . . . . . . . . . . . . auto uchar 8H 1 Tmp. . . . . . . . . . . . . . . . . auto uchar AH 1 i. . . . . . . . . . . . . . . . . . --reg-- int ----- 2 I2CReceiveAck. . . . . . . . . . . . . public FCODE funct ----- RTCSetAlarm. . . . . . . . . . . . . . public FCODE funct ----- AlarmTime. . . . . . . . . . . . . . --reg-- ptr ----- 4 DeviceID . . . . . . . . . . . . . . --reg-- uchar ----- 1 C166 COMPILER V3.10b, RTC 28/08/03 20:15:49 PAGE 35 Time . . . . . . . . . . . . . . . . auto struct 0H 6 TransferByte . . . . . . . . . . . . auto uchar 6H 1 Result . . . . . . . . . . . . . . . auto uchar 8H 1 RTCPutRAM. . . . . . . . . . . . . . . public FCODE funct ----- SourcePtr. . . . . . . . . . . . . . --reg-- ptr ----- 4 DeviceID . . . . . . . . . . . . . . --reg-- uchar ----- 1 DestAddr . . . . . . . . . . . . . . --reg-- uchar ----- 1 Size . . . . . . . . . . . . . . . . --reg-- uint ----- 2 Result . . . . . . . . . . . . . . . auto uchar 0H 1 RTCGetAlarmStatus. . . . . . . . . . . public FCODE funct ----- AlarmStatus. . . . . . . . . . . . . --reg-- ptr ----- 4 DeviceID . . . . . . . . . . . . . . --reg-- uchar ----- 1 TransferByte . . . . . . . . . . . . auto uchar 0H 1 Result . . . . . . . . . . . . . . . auto uchar 2H 1 MODULE INFORMATION: INITIALIZED UNINITIALIZED CODE SIZE = 2690 -------- NEAR-CONST SIZE = -------- -------- FAR-CONST SIZE = -------- -------- HUGE-CONST SIZE = -------- -------- XHUGE-CONST SIZE = -------- -------- NEAR-DATA SIZE = -------- -------- FAR-DATA SIZE = -------- -------- XHUGE-DATA SIZE = -------- -------- IDATA-DATA SIZE = -------- -------- SDATA-DATA SIZE = -------- -------- BDATA-DATA SIZE = -------- -------- HUGE-DATA SIZE = -------- -------- BIT SIZE = -------- -------- INIT'L SIZE = -------- -------- END OF MODULE INFORMATION. C166 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)