A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 1 DOS MACRO ASSEMBLER A166 V3.10 OBJECT MODULE PLACED IN ..\RAM\INC\INT.OBJ ASSEMBLER INVOKED BY: C:\C166\BIN\A166.EXE ..\RAM\INC\INT.SRC CASE MOD167 SEGMENTED SET(LARGE) LOC OBJ LINE SOURCE 1 $NOMACRO 2 $SEGMENTED CASE MOD167 3 ; 4 ; '..\RAM\INC\INT.SRC' GENERATED FROM INPUT FILE '..\RAM\INC\INT.C' 5 ; COMPILER INVOKED BY: 6 ; C:\C166\BIN\C166.EXE ..\RAM\INC\INT.C MOD167 NOINIT LARGE FLOAT64 SYMBOLS CODE PRE PRINT SRC 7 ; 8 $MODINF (55) 9 NAME INT 10 11 CC19IC DEFR 0F166H 12 CC28IC DEFR 0F178H 13 BUSCON1 DEFR 0FF14H 14 CC18IC DEFR 0F164H 15 CC27IC DEFR 0F176H 16 BUSCON0 DEFR 0FF0CH 17 CC17IC DEFR 0F162H 18 CC26IC DEFR 0F174H 19 CC16IC DEFR 0F160H 20 CC25IC DEFR 0F172H 21 PSW DEFR 0FF10H 22 CC15IC DEFR 0FF96H 23 CC24IC DEFR 0F170H 24 CC14IC DEFR 0FF94H 25 CC23IC DEFR 0F16EH 26 CC13IC DEFR 0FF92H 27 CC22IC DEFR 0F16CH 28 CC31IC DEFR 0F194H 29 CC12IC DEFR 0FF90H 30 CC21IC DEFR 0F16AH 31 CC30IC DEFR 0F18CH 32 CC11IC DEFR 0FF8EH 33 CC20IC DEFR 0F168H 34 CC10IC DEFR 0FF8CH 35 TFR DEFR 0FFACH 36 T6CON DEFR 0FF48H 37 T5CON DEFR 0FF46H 38 T4CON DEFR 0FF44H 39 T3CON DEFR 0FF42H 40 XP3IC DEFR 0F19EH 41 T2CON DEFR 0FF40H 42 XP2IC DEFR 0F196H 43 ADCON DEFR 0FFA0H 44 XP1IC DEFR 0F18EH 45 XP0IC DEFR 0F186H 46 S0CON DEFR 0FFB0H 47 S0TIC DEFR 0FF6CH 48 S0RIC DEFR 0FF6EH 49 SYSCON DEFR 0FF12H 50 ADEIC DEFR 0FF9AH 51 ADCIC DEFR 0FF98H 52 S0EIC DEFR 0FF70H 53 MDC DEFR 0FF0EH 54 WDTCON DEFR 0FFAEH 55 CC9IC DEFR 0FF8AH 56 DP8 DEFR 0FFD6H 57 CC8IC DEFR 0FF88H 58 DP7 DEFR 0FFD2H A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 2 59 SSCTIC DEFR 0FF72H 60 SSCCON DEFR 0FFB2H 61 CC7IC DEFR 0FF86H 62 CC6IC DEFR 0FF84H 63 SSCRIC DEFR 0FF74H 64 CC5IC DEFR 0FF82H 65 CC4IC DEFR 0FF80H 66 DP3 DEFR 0FFC6H 67 CC3IC DEFR 0FF7EH 68 DP2 DEFR 0FFC2H 69 CC2IC DEFR 0FF7CH 70 CC1IC DEFR 0FF7AH 71 CC0IC DEFR 0FF78H 72 SSCEIC DEFR 0FF76H 73 S0TBUF DEFR 0FEB0H 74 S0RBUF DEFR 0FEB2H 75 ISNC DEFR 0F1DEH 76 S0TBIC DEFR 0F19CH 77 T78CON DEFR 0FF20H 78 CRIC DEFR 0FF6AH 79 T8IC DEFR 0F17CH 80 T7IC DEFR 0F17AH 81 T01CON DEFR 0FF50H 82 T6IC DEFR 0FF68H 83 T5IC DEFR 0FF66H 84 T4IC DEFR 0FF64H 85 T3IC DEFR 0FF62H 86 T2IC DEFR 0FF60H 87 T1IC DEFR 0FF9EH 88 T0IC DEFR 0FF9CH 89 S0BG DEFR 0FEB4H 90 CCM7 DEFR 0FF28H 91 CCM6 DEFR 0FF26H 92 CCM5 DEFR 0FF24H 93 CCM4 DEFR 0FF22H 94 T4 DEFR 0FE44H 95 PWMCON1 DEFR 0FF32H 96 CCM3 DEFR 0FF58H 97 T3 DEFR 0FE42H 98 PWMCON0 DEFR 0FF30H 99 CCM2 DEFR 0FF56H 100 CCM1 DEFR 0FF54H 101 P5 DEFR 0FFA2H 102 CCM0 DEFR 0FF52H 103 P3 DEFR 0FFC4H 104 P2 DEFR 0FFC0H 105 PWMIC DEFR 0F17EH 106 BUSCON4 DEFR 0FF1AH 107 BUSCON3 DEFR 0FF18H 108 CC29IC DEFR 0F184H 109 BUSCON2 DEFR 0FF16H 110 DTxD BIT DP3.10 111 DRxD BIT DP3.11 112 TxD BIT P3.10 113 114 NDATA DGROUP ?ND?INT 115 SDATA DGROUP ?ID?INT,SYSTEM 116 117 ASSUME DPP2 : NDATA 118 ASSUME DPP3 : SDATA 119 120 ?ND?INT SECTION DATA WORD 'NDATA' 000000 121 seroutflag DSW 1 122 PUBLIC seroutflag 000002 123 serinflag DSW 1 124 PUBLIC serinflag A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 3 000004 125 seroutbufct DSW 1 126 PUBLIC seroutbufct 000006 127 serinbufct DSW 1 128 PUBLIC serinbufct 129 ?ND?INT ENDS 130 131 ?FD?INT SECTION DATA WORD 'FDATA' 000000 132 seroutbuf DSB 132 133 PUBLIC seroutbuf 000084 134 serinbuf DSB 132 135 PUBLIC serinbuf 136 ?FD?INT ENDS 137 138 ?ID?INT SECTION DATA WORD 'IDATA' 000000 139 TIMER10 DSW 1 140 PUBLIC TIMER10 000002 141 DAY DSW 1 142 PUBLIC DAY 000004 143 MINUTE DSW 1 144 PUBLIC MINUTE 000006 145 HOUR DSW 1 146 PUBLIC HOUR 000008 147 SECOND DSW 1 148 PUBLIC SECOND 00000A 149 THISMDAYS DSW 1 150 PUBLIC THISMDAYS 00000C 151 YEAR DSW 1 152 PUBLIC YEAR 00000E 153 MSECOND DSW 1 154 PUBLIC MSECOND 000010 155 MONTH DSW 1 156 PUBLIC MONTH 157 ?ID?INT ENDS 158 159 160 REGDEF R0 - R15 161 bankSORIC REGBANK R0 - R15 162 bankSOTIC REGBANK R0 - R15 163 TIMER_BANK REGBANK R0 - R15 164 165 166 ?PR?INT SECTION CODE WORD 'FCODE' 167 ; line 1: 168 ; line 2: #ifndef _int_c_ 169 ; line 3: #define _int_c_ 170 ; line 4: 171 ; line 5: #include "int.h" 172 ; line 6: 173 ; line 7: #pragma SRC 174 ; line 8: 175 ; line 9: 176 ; line 10: volatile int idata YEAR; 177 ; line 11: volatile int idata MONTH; 178 ; line 12: volatile int idata DAY; 179 ; line 13: volatile int idata HOUR; 180 ; line 14: volatile int idata MINUTE; 181 ; line 15: volatile int idata SECOND; 182 ; line 16: volatile int idata MSECOND; 183 ; line 17: 184 ; line 18: volatile int idata TIMER10; 185 ; line 19: volatile int idata THISMDAYS; 186 ; line 20: 187 ; line 21: 188 ; line 22: 189 ; line 23: void init_serial(unsigned int baud) 190 A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 4 191 init_serial PROC FAR 192 PUBLIC init_serial 193 ; FUNCTION init_serial (BEGIN RMASK = @0x8000) 194 ;---- Variable 'baud' assigned to Register 'R8' ---- 195 ; line 24: { 196 ; line 25: TxD = 1; 000000 AFE2 197 BSET TxD 198 ; line 26: DTxD = 1; 000002 AFE3 199 BSET DTxD 200 ; line 27: DRxD = 0; 000004 BEE3 201 BCLR DRxD 202 ; line 28: 203 ; line 29: S0RIC = 0x0a; 000006 E6B70A00 204 MOV S0RIC,#10 205 ; line 30: S0TIC = 0x0b; 00000A E6B60B00 206 MOV S0TIC,#11 207 ; line 31: 208 ; line 32: serinbufct = 0; 00000E F68E0600 R 209 MOV WORD serinbufct,ZEROS 210 ; line 33: serinflag = 0; 000012 F68E0200 R 211 MOV WORD serinflag,ZEROS 212 ; line 34: seroutbufct = 0; 000016 F68E0400 R 213 MOV WORD seroutbufct,ZEROS 214 ; line 35: seroutflag = 0; 00001A F68E0000 R 215 MOV WORD seroutflag,ZEROS 216 ; line 36: 217 ; line 37: S0BG = baud; 00001E F6F8B4FE 218 MOV S0BG,R8 219 ; line 38: S0CON = 0x8011; 000022 E6D81180 220 MOV S0CON,#32785 221 ; line 39: } 000026 DB00 222 RETS 223 ; FUNCTION init_serial (END RMASK = @0x8000) 224 init_serial ENDP 225 ; line 40: 226 ; line 41: 227 ; line 42: void deinit_serial( void ) 228 229 deinit_serial PROC FAR 230 PUBLIC deinit_serial 231 ; FUNCTION deinit_serial (BEGIN RMASK = @0x8000) 232 ; line 43: { 233 ; line 44: S0RIC = 0x0a; 000028 E6B70A00 234 MOV S0RIC,#10 235 ; line 45: S0TIC = 0x0b; 00002C E6B60B00 236 MOV S0TIC,#11 237 ; line 46: S0CON = 0; 000030 E6D80000 238 MOV S0CON,#0 239 ; line 47: serinflag = 0; 000034 F68E0200 R 240 MOV WORD serinflag,ZEROS 241 ; line 48: seroutflag = 0; 000038 F68E0000 R 242 MOV WORD seroutflag,ZEROS 243 ; line 49: } 00003C DB00 244 RETS 245 ; FUNCTION deinit_serial (END RMASK = @0x8000) 246 deinit_serial ENDP 247 ; line 50: 248 ; line 51: 249 ; line 52: void serial_receive( int wait ) 250 251 serial_receive PROC FAR 252 PUBLIC serial_receive 253 ; FUNCTION serial_receive (BEGIN RMASK = @0x0010) 254 ;---- Variable 'wait' assigned to Register 'R8' ---- 255 ; line 53: { 256 ; line 54: A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 5 257 ; line 55: while( serinflag == 1 ) { 258 ; line 56: ; 259 ; line 57: } 260 ?C0001: 00003E F2F40200 R 261 MOV R4,WORD serinflag 000042 4841 262 CMP R4,#1 000044 2DFC 263 JMP cc_Z,?C0001 264 ?C0002: 265 ; line 58: 266 ; line 59: serinbufct = 0; 000046 F68E0600 R 267 MOV WORD serinbufct,ZEROS 268 ; line 60: serinflag = 1; 00004A E014 269 MOV R4,#1 00004C F6F40200 R 270 MOV WORD serinflag,R4 271 ; line 61: S0RIC = 0x4a; 000050 E6B74A00 272 MOV S0RIC,#74 273 ; line 62: 274 ; line 63: if( wait ){ 000054 4880 275 CMP R8,#0 000056 2D04 276 JMP cc_Z,?C0005 277 ; line 64: while( serinflag < 2 ){ 278 ?C0009: 279 ; line 65: ; 280 ; line 66: } 281 ?C0006: 000058 F2F40200 R 282 MOV R4,WORD serinflag 00005C 4842 283 CMP R4,#2 00005E 8DFC 284 JMP cc_ULT,?C0006 285 ?C0007: 286 ; line 67: } 287 ?C0005: 000060 DB00 288 RETS 289 ; FUNCTION serial_receive (END RMASK = @0x0010) 290 serial_receive ENDP 291 ; line 68: } 292 ; line 69: 293 ; line 70: 294 ; line 71: void serial_transmit( int wait ) 295 296 serial_transmit PROC FAR 297 PUBLIC serial_transmit 298 ; FUNCTION serial_transmit (BEGIN RMASK = @0x0010) 299 ;---- Variable 'wait' assigned to Register 'R8' ---- 300 ; line 72: { 301 ; line 73: 302 ; line 74: while( seroutflag == 1 ) { 303 ; line 75: ; 304 ; line 76: } 305 ?C0010: 000062 F2F40000 R 306 MOV R4,WORD seroutflag 000066 4841 307 CMP R4,#1 000068 2DFC 308 JMP cc_Z,?C0010 309 ?C0011: 310 ; line 77: 311 ; line 78: seroutbufct = 0; 00006A F68E0400 R 312 MOV WORD seroutbufct,ZEROS 313 ; line 79: seroutflag = 1; 00006E E014 314 MOV R4,#1 000070 F6F40000 R 315 MOV WORD seroutflag,R4 316 ; line 80: 317 ; line 81: S0TIC = 0x4b; 000074 E6B64B00 318 MOV S0TIC,#75 319 ; line 82: S0TBUF = seroutbuf[0]; 000078 D7400000 R 320 EXTP #PAG (seroutbuf),#1 00007C F3F80000 R 321 MOVB RL4,POF (seroutbuf) 000080 C084 322 MOVBZ R4,RL4 A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 6 000082 F6F4B0FE 323 MOV S0TBUF,R4 324 ; line 83: 325 ; line 84: if( wait ){ 000086 4880 326 CMP R8,#0 000088 2D04 327 JMP cc_Z,?C0014 328 ; line 85: while( seroutflag < 2 ){ 329 ?C0018: 330 ; line 86: ; 331 ; line 87: } 332 ?C0015: 00008A F2F40000 R 333 MOV R4,WORD seroutflag 00008E 4842 334 CMP R4,#2 000090 8DFC 335 JMP cc_ULT,?C0015 336 ?C0016: 337 ; line 88: } 338 ?C0014: 000092 DB00 339 RETS 340 ; FUNCTION serial_transmit (END RMASK = @0x0010) 341 serial_transmit ENDP 342 ; line 89: } 343 ; line 90: 344 ; line 91: 345 ; line 92: 346 ; line 93: 347 ; line 94: 348 ; line 95: unsigned char serinbuf[ SERIALMAXLENGTH + 2 ]; 349 ; line 96: unsigned int serinbufct; 350 ; line 97: unsigned int serinflag; 351 ; line 98: void ser_receive_int (void) interrupt SERIAL_RECEIVE_INT = 0x2B using bankSORIC { 352 353 ser_receive_int PROC INTERRUPT SERIAL_RECEIVE_INT = 43 USING bankSORIC 354 GLOBAL ser_receive_int 355 ; FUNCTION ser_receive_int (BEGIN RMASK = @0x0070) 000094 C6030300 356 SCXT DPP3,#3 000098 CC00 357 NOP 00009A F6F00000 R 358 MOV bankSORIC,R0 00009E C6080000 R 359 SCXT CP,#bankSORIC 0000A2 CC00 360 NOP 361 ; line 99: 362 ; line 100: serinbuf[serinbufct] = S0RBUF; 0000A4 F2F4B2FE 363 MOV R4,S0RBUF 0000A8 F1A8 364 MOVB RL5,RL4 0000AA F2F60600 R 365 MOV R6,WORD serinbufct 0000AE D7500000 R 366 EXTP #PAG (serinbuf),#2 0000B2 E4A60000 R 367 MOVB [R6+#POF(serinbuf)],RL5 368 ; line 101: 369 ; line 102: if( ( serinbuf[serinbufct] < 0x20 ) || ( serinbufct >= SERIALMAXLENGTH ) ){ 0000B6 F4860000 R 370 MOVB RL4,[R6+#POF(serinbuf)] 0000BA 47F82000 371 CMPB RL4,#32 0000BE 8D03 372 JMP cc_ULT,?C0020 0000C0 46F68200 373 CMP R6,#130 0000C4 8D0D 374 JMP cc_ULT,?C0019 375 ?C0020: 376 ; line 103: S0RIC = 0x0a; 0000C6 E6B70A00 377 MOV S0RIC,#10 378 ; line 104: serinbuf[serinbufct] = 0; 0000CA E10A 379 MOVB RL5,#0 0000CC D7400000 R 380 EXTP #PAG (serinbuf),#1 0000D0 E4A60000 R 381 MOVB [R6+#POF(serinbuf)],RL5 382 ; line 105: serinbufct++; 0000D4 248F0600 R 383 SUB serinbufct,ONES 384 ; line 106: serinflag = 2; 0000D8 E024 385 MOV R4,#2 0000DA F6F40200 R 386 MOV WORD serinflag,R4 387 ; line 107: } 0000DE 0D05 388 JMP cc_UC,?C0021 A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 7 389 ?C0019: 390 ; line 108: else { 391 ; line 109: serinbufct++; 0000E0 248F0600 R 392 SUB serinbufct,ONES 393 ; line 110: serinflag = 1; 0000E4 E014 394 MOV R4,#1 0000E6 F6F40200 R 395 MOV WORD serinflag,R4 396 ; line 111: } 397 ?C0021: 398 ; line 112: 399 ; line 113: } 0000EA FC08 400 POP CP 0000EC FC03 401 POP DPP3 0000EE FB88 402 RETI 403 ; FUNCTION ser_receive_int (END RMASK = @0x0070) 404 ser_receive_int ENDP 405 ; line 114: 406 ; line 115: 407 ; line 116: 408 ; line 117: unsigned char seroutbuf[ SERIALMAXLENGTH + 2 ]; 409 ; line 118: unsigned int seroutbufct; 410 ; line 119: unsigned int seroutflag; 411 ; line 120: void ser_transmit_int (void) interrupt SERIAL_TRANSMIT_INT = 0x2A using bankSO TIC { 412 413 ser_transmit_int PROC INTERRUPT SERIAL_TRANSMIT_INT = 42 USING bankSOTIC 414 GLOBAL ser_transmit_int 415 ; FUNCTION ser_transmit_int (BEGIN RMASK = @0x0030) 0000F0 C6030300 416 SCXT DPP3,#3 0000F4 CC00 417 NOP 0000F6 F6F00000 R 418 MOV bankSOTIC,R0 0000FA C6080000 R 419 SCXT CP,#bankSOTIC 0000FE CC00 420 NOP 421 ; line 121: 422 ; line 122: if( ( seroutbuf[seroutbufct] < 0x20 ) || ( seroutbufct >= SERIALMAXLENGTH ) ){ 000100 F2F50400 R 423 MOV R5,WORD seroutbufct 000104 D7400000 R 424 EXTP #PAG (seroutbuf),#1 000108 F4850000 R 425 MOVB RL4,[R5+#POF(seroutbuf)] 00010C 47F82000 426 CMPB RL4,#32 000110 8D03 427 JMP cc_ULT,?C0023 000112 46F58200 428 CMP R5,#130 000116 8D06 429 JMP cc_ULT,?C0022 430 ?C0023: 431 ; line 123: S0TIC = 0x0b; 000118 E6B60B00 432 MOV S0TIC,#11 433 ; line 124: seroutflag = 2; 00011C E024 434 MOV R4,#2 00011E F6F40000 R 435 MOV WORD seroutflag,R4 436 ; line 125: } 000122 0D0E 437 JMP cc_UC,?C0024 438 ?C0022: 439 ; line 126: else { 440 ; line 127: seroutbufct++; 000124 248F0400 R 441 SUB seroutbufct,ONES 442 ; line 128: seroutflag = 1; 000128 E014 443 MOV R4,#1 00012A F6F40000 R 444 MOV WORD seroutflag,R4 445 ; line 129: S0TBUF = seroutbuf[seroutbufct]; 00012E F2F40400 R 446 MOV R4,WORD seroutbufct 000132 D7400000 R 447 EXTP #PAG (seroutbuf),#1 000136 F4840000 R 448 MOVB RL4,[R4+#POF(seroutbuf)] 00013A C084 449 MOVBZ R4,RL4 00013C F6F4B0FE 450 MOV S0TBUF,R4 451 ; line 130: } 452 ?C0024: A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 8 453 ; line 131: 454 ; line 132: } 000140 FC08 455 POP CP 000142 FC03 456 POP DPP3 000144 FB88 457 RETI 458 ; FUNCTION ser_transmit_int (END RMASK = @0x0030) 459 ser_transmit_int ENDP 460 ; line 133: 461 ; line 134: 462 ; line 135: 463 ; line 136: void initTimerInt( void ) { 464 465 initTimerInt PROC FAR 466 PUBLIC initTimerInt 467 ; FUNCTION initTimerInt (BEGIN RMASK = @0x8000) 468 ; line 137: 469 ; line 138: T3IC = TIMERINTOFF; 000146 E6B1A700 470 MOV T3IC,#167 471 ; line 139: T3CON = TIMERSTOP; 00014A E6A10104 472 MOV T3CON,#1025 473 ; line 140: T4CON = TIMERSET; 00014E E6A22700 474 MOV T4CON,#39 475 ; line 141: T4 = TIMERRELOAD; 000152 E62283FF 476 MOV T4,#65411 477 ; line 142: T3 = TIMERRELOAD; 000156 E62183FF 478 MOV T3,#65411 479 ; line 143: 480 ; line 144: } 00015A DB00 481 RETS 482 ; FUNCTION initTimerInt (END RMASK = @0x8000) 483 initTimerInt ENDP 484 ; line 145: 485 ; line 146: 486 ; line 147: void startTimerInt( void ) { 487 488 startTimerInt PROC FAR 489 PUBLIC startTimerInt 490 ; FUNCTION startTimerInt (BEGIN RMASK = @0x8000) 491 ; line 148: 492 ; line 149: TIMER10 = 0; 00015C F68E0000 R 493 MOV WORD TIMER10,ZEROS 494 ; line 150: T3 = TIMERRELOAD; 000160 E62183FF 495 MOV T3,#65411 496 ; line 151: T4 = TIMERRELOAD; 000164 E62283FF 497 MOV T4,#65411 498 ; line 152: T3CON = TIMERSTART; 000168 E6A14104 499 MOV T3CON,#1089 500 ; line 153: T3IC = TIMERINTON; 00016C E6B1E700 501 MOV T3IC,#231 502 ; line 154: } 000170 DB00 503 RETS 504 ; FUNCTION startTimerInt (END RMASK = @0x8000) 505 startTimerInt ENDP 506 ; line 155: 507 ; line 156: 508 ; line 157: 509 ; line 158: 510 ; line 159: void stopTimerInt( void ) { 511 512 stopTimerInt PROC FAR 513 PUBLIC stopTimerInt 514 ; FUNCTION stopTimerInt (BEGIN RMASK = @0x8000) 515 ; line 160: 516 ; line 161: T3IC = TIMERINTOFF; 000172 E6B1A700 517 MOV T3IC,#167 518 ; line 162: T3CON = TIMERSTOP; A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 9 000176 E6A10104 519 MOV T3CON,#1025 520 ; line 163: } 00017A DB00 521 RETS 522 ; FUNCTION stopTimerInt (END RMASK = @0x8000) 523 stopTimerInt ENDP 524 ; line 164: 525 ; line 165: 526 ; line 166: 527 ; line 167: #pragma ASM 528 ; line 168: 529 ; line 169: ;P2 DEFR 0FFC0H 530 ;P2 DEFR 0FFC0H 531 ; line 170: P7 DEFR 0FFD0H 532 P7 DEFR 0FFD0H 533 ; line 171: P8 DEFR 0FFD4H 534 P8 DEFR 0FFD4H 535 ; line 172: 536 ; line 173: #pragma ENDASM 537 ; line 174: 538 ; line 175: 539 ; line 176: 540 ; line 177: //interrupt every 1/10000 second 541 ; line 178: void timer_int (void) interrupt TIMER_INT = 0x23 using TIMER_BANK { 542 543 timer_int PROC INTERRUPT TIMER_INT = 35 USING TIMER_BANK 544 GLOBAL timer_int 545 ; FUNCTION timer_int (BEGIN RMASK = @0x0010) 00017C C6030300 546 SCXT DPP3,#3 000180 CC00 547 NOP 000182 F6F00000 R 548 MOV TIMER_BANK,R0 000186 C6080000 R 549 SCXT CP,#TIMER_BANK 00018A CC00 550 NOP 551 ; line 179: 552 ; line 180: TIMER10++; 00018C 248F0000 R 553 SUB TIMER10,ONES 554 ; line 181: 555 ; line 182: if( TIMER10 >= 10 ){ 000190 F2F40000 R 556 MOV R4,WORD TIMER10 000194 46F40A00 557 CMP R4,#10 000198 CD3C 558 JMP cc_SLT,?C0025 559 ; line 183: 560 ; line 184: TIMER10 = 0; 00019A F68E0000 R 561 MOV WORD TIMER10,ZEROS 562 ; line 185: MSECOND++; 00019E 248F0E00 R 563 SUB MSECOND,ONES 564 ; line 186: 565 ; line 187: if( MSECOND >= 1000 ){ 0001A2 F2F40E00 R 566 MOV R4,WORD MSECOND 0001A6 46F4E803 567 CMP R4,#1000 0001AA CD33 568 JMP cc_SLT,?C0025 569 ; line 188: 570 ; line 189: MSECOND = 0; 0001AC F68E0E00 R 571 MOV WORD MSECOND,ZEROS 572 ; line 190: SECOND++; 0001B0 248F0800 R 573 SUB SECOND,ONES 574 ; line 191: 575 ; line 192: if( SECOND >= 60 ){ 0001B4 F2F40800 R 576 MOV R4,WORD SECOND 0001B8 46F43C00 577 CMP R4,#60 0001BC CD2A 578 JMP cc_SLT,?C0025 579 ; line 193: 580 ; line 194: SECOND = 0; 0001BE F68E0800 R 581 MOV WORD SECOND,ZEROS 582 ; line 195: MINUTE++; 0001C2 248F0400 R 583 SUB MINUTE,ONES 584 ; line 196: A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 10 585 ; line 197: if( MINUTE >= 60 ){ 0001C6 F2F40400 R 586 MOV R4,WORD MINUTE 0001CA 46F43C00 587 CMP R4,#60 0001CE CD21 588 JMP cc_SLT,?C0025 589 ; line 198: 590 ; line 199: MINUTE = 0; 0001D0 F68E0400 R 591 MOV WORD MINUTE,ZEROS 592 ; line 200: HOUR++; 0001D4 248F0600 R 593 SUB HOUR,ONES 594 ; line 201: 595 ; line 202: if( HOUR >= 24 ){ 0001D8 F2F40600 R 596 MOV R4,WORD HOUR 0001DC 46F41800 597 CMP R4,#24 0001E0 CD18 598 JMP cc_SLT,?C0025 599 ; line 203: 600 ; line 204: HOUR = 0; 0001E2 F68E0600 R 601 MOV WORD HOUR,ZEROS 602 ; line 205: DAY++; 0001E6 248F0200 R 603 SUB DAY,ONES 604 ; line 206: 605 ; line 207: if( DAY > THISMDAYS ) { 0001EA F2F40A00 R 606 MOV R4,WORD THISMDAYS 0001EE 42F40200 R 607 CMP R4,WORD DAY 0001F2 DD0F 608 JMP cc_SGE,?C0025 609 ; line 208: 610 ; line 209: DAY = 1; 0001F4 E014 611 MOV R4,#1 0001F6 F6F40200 R 612 MOV WORD DAY,R4 613 ; line 210: MONTH++; 0001FA 248F1000 R 614 SUB MONTH,ONES 615 ; line 211: 616 ; line 212: if( MONTH > 12 ){ 0001FE F2F41000 R 617 MOV R4,WORD MONTH 000202 46F40C00 618 CMP R4,#12 000206 BD05 619 JMP cc_SLE,?C0025 620 ; line 213: 621 ; line 214: MONTH = 1; 000208 E014 622 MOV R4,#1 00020A F6F41000 R 623 MOV WORD MONTH,R4 624 ; line 215: YEAR++; 00020E 248F0C00 R 625 SUB YEAR,ONES 626 ; line 216: } 627 ; line 217: } 628 ; line 218: } 629 ; line 219: } 630 ; line 220: } 631 ; line 221: } 632 ; line 222: } 633 ?C0025: 634 ; line 223: 635 ; line 224: 636 ; line 225: /// so updating of date/time is down 637 ; line 226: /// here we do the other work 638 ; line 227: /// 639 ; line 228: /// 640 ; line 229: 641 ; line 230: 642 ; line 231: 643 ; line 232: } 000212 FC08 644 POP CP 000214 FC03 645 POP DPP3 000216 FB88 646 RETI 647 ; FUNCTION timer_int (END RMASK = @0x0010) 648 timer_int ENDP A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 11 649 ?PR?INT ENDS 650 651 652 ; line 233: 653 ; line 234: 654 ; line 235: 655 ; line 236: #endif 656 ; line 237: 657 ; line 238: 658 ; line 239: 659 ; line 240: 660 ; line 241: 661 ; line 242: 662 ; line 243: 663 ; line 244: 664 665 END A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 12 SYMBOL TABLE LISTING ------ ----- ------- N A M E TYPE VALUE I ATTRIBUTES ?C0001. . . . . . . NEAR 3EH R SEC=?PR?INT ?C0002. . . . . . . NEAR 46H R SEC=?PR?INT ?C0005. . . . . . . NEAR 60H R SEC=?PR?INT ?C0006. . . . . . . NEAR 58H R SEC=?PR?INT ?C0007. . . . . . . NEAR 60H R SEC=?PR?INT ?C0009. . . . . . . NEAR 58H R SEC=?PR?INT ?C0010. . . . . . . NEAR 62H R SEC=?PR?INT ?C0011. . . . . . . NEAR 6AH R SEC=?PR?INT ?C0014. . . . . . . NEAR 92H R SEC=?PR?INT ?C0015. . . . . . . NEAR 8AH R SEC=?PR?INT ?C0016. . . . . . . NEAR 92H R SEC=?PR?INT ?C0018. . . . . . . NEAR 8AH R SEC=?PR?INT ?C0019. . . . . . . NEAR E0H R SEC=?PR?INT ?C0020. . . . . . . NEAR C6H R SEC=?PR?INT ?C0021. . . . . . . NEAR EAH R SEC=?PR?INT ?C0022. . . . . . . NEAR 124H R SEC=?PR?INT ?C0023. . . . . . . NEAR 118H R SEC=?PR?INT ?C0024. . . . . . . NEAR 140H R SEC=?PR?INT ?C0025. . . . . . . NEAR 212H R SEC=?PR?INT ?FD?INT . . . . . . ---- ---- SECTION ?ID?INT . . . . . . ---- ---- SECTION ?ND?INT . . . . . . ---- ---- SECTION ?PR?INT . . . . . . ---- ---- SECTION ADCIC . . . . . . . WORD FF98H A SFR ADCON . . . . . . . WORD FFA0H A SFR ADEIC . . . . . . . WORD FF9AH A SFR BUSCON0 . . . . . . WORD FF0CH A SFR BUSCON1 . . . . . . WORD FF14H A SFR BUSCON2 . . . . . . WORD FF16H A SFR BUSCON3 . . . . . . WORD FF18H A SFR BUSCON4 . . . . . . WORD FF1AH A SFR CC0IC . . . . . . . WORD FF78H A SFR CC10IC. . . . . . . WORD FF8CH A SFR CC11IC. . . . . . . WORD FF8EH A SFR CC12IC. . . . . . . WORD FF90H A SFR CC13IC. . . . . . . WORD FF92H A SFR CC14IC. . . . . . . WORD FF94H A SFR CC15IC. . . . . . . WORD FF96H A SFR CC16IC. . . . . . . WORD F160H A ESF CC17IC. . . . . . . WORD F162H A ESF CC18IC. . . . . . . WORD F164H A ESF CC19IC. . . . . . . WORD F166H A ESF CC1IC . . . . . . . WORD FF7AH A SFR CC20IC. . . . . . . WORD F168H A ESF CC21IC. . . . . . . WORD F16AH A ESF CC22IC. . . . . . . WORD F16CH A ESF CC23IC. . . . . . . WORD F16EH A ESF CC24IC. . . . . . . WORD F170H A ESF CC25IC. . . . . . . WORD F172H A ESF CC26IC. . . . . . . WORD F174H A ESF CC27IC. . . . . . . WORD F176H A ESF CC28IC. . . . . . . WORD F178H A ESF CC29IC. . . . . . . WORD F184H A ESF CC2IC . . . . . . . WORD FF7CH A SFR CC30IC. . . . . . . WORD F18CH A ESF CC31IC. . . . . . . WORD F194H A ESF CC3IC . . . . . . . WORD FF7EH A SFR CC4IC . . . . . . . WORD FF80H A SFR CC5IC . . . . . . . WORD FF82H A SFR CC6IC . . . . . . . WORD FF84H A SFR A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 13 CC7IC . . . . . . . WORD FF86H A SFR CC8IC . . . . . . . WORD FF88H A SFR CC9IC . . . . . . . WORD FF8AH A SFR CCM0. . . . . . . . WORD FF52H A SFR CCM1. . . . . . . . WORD FF54H A SFR CCM2. . . . . . . . WORD FF56H A SFR CCM3. . . . . . . . WORD FF58H A SFR CCM4. . . . . . . . WORD FF22H A SFR CCM5. . . . . . . . WORD FF24H A SFR CCM6. . . . . . . . WORD FF26H A SFR CCM7. . . . . . . . WORD FF28H A SFR CP. . . . . . . . . WORD FE10H A SFR CRIC. . . . . . . . WORD FF6AH A SFR DAY . . . . . . . . WORD 2H R PUB SEC=?ID?INT DP2 . . . . . . . . WORD FFC2H A SFR DP3 . . . . . . . . WORD FFC6H A SFR DP7 . . . . . . . . WORD FFD2H A SFR DP8 . . . . . . . . WORD FFD6H A SFR DPP2. . . . . . . . WORD FE04H A SFR DPP3. . . . . . . . WORD FE06H A SFR DRxD. . . . . . . . BIT E3H.11 A DTxD. . . . . . . . BIT E3H.10 A HOUR. . . . . . . . WORD 6H R PUB SEC=?ID?INT ISNC. . . . . . . . WORD F1DEH A ESF MDC . . . . . . . . WORD FF0EH A SFR MINUTE. . . . . . . WORD 4H R PUB SEC=?ID?INT MONTH . . . . . . . WORD 10H R PUB SEC=?ID?INT MSECOND . . . . . . WORD EH R PUB SEC=?ID?INT NDATA . . . . . . . ---- ---- GROUP ONES. . . . . . . . WORD FF1EH A SFR P2. . . . . . . . . WORD FFC0H A SFR P3. . . . . . . . . WORD FFC4H A SFR P5. . . . . . . . . WORD FFA2H A SFR P7. . . . . . . . . WORD FFD0H A SFR P8. . . . . . . . . WORD FFD4H A SFR PSW . . . . . . . . WORD FF10H A SFR PWMCON0 . . . . . . WORD FF30H A SFR PWMCON1 . . . . . . WORD FF32H A SFR PWMIC . . . . . . . WORD F17EH A ESF S0BG. . . . . . . . WORD FEB4H A SFR S0CON . . . . . . . WORD FFB0H A SFR S0EIC . . . . . . . WORD FF70H A SFR S0RBUF. . . . . . . WORD FEB2H A SFR S0RIC . . . . . . . WORD FF6EH A SFR S0TBIC. . . . . . . WORD F19CH A ESF S0TBUF. . . . . . . WORD FEB0H A SFR S0TIC . . . . . . . WORD FF6CH A SFR SDATA . . . . . . . ---- ---- GROUP SECOND. . . . . . . WORD 8H R PUB SEC=?ID?INT SERIAL_RECEIVE_INT. INTNO 002BH SERIAL_TRANSMIT_INT INTNO 002AH SSCCON. . . . . . . WORD FFB2H A SFR SSCEIC. . . . . . . WORD FF76H A SFR SSCRIC. . . . . . . WORD FF74H A SFR SSCTIC. . . . . . . WORD FF72H A SFR SYSCON. . . . . . . WORD FF12H A SFR T01CON. . . . . . . WORD FF50H A SFR T0IC. . . . . . . . WORD FF9CH A SFR T1IC. . . . . . . . WORD FF9EH A SFR T2CON . . . . . . . WORD FF40H A SFR T2IC. . . . . . . . WORD FF60H A SFR T3. . . . . . . . . WORD FE42H A SFR T3CON . . . . . . . WORD FF42H A SFR T3IC. . . . . . . . WORD FF62H A SFR T4. . . . . . . . . WORD FE44H A SFR T4CON . . . . . . . WORD FF44H A SFR A166 MACRO ASSEMBLER INT 01/12/05 22:15:54 PAGE 14 T4IC. . . . . . . . WORD FF64H A SFR T5CON . . . . . . . WORD FF46H A SFR T5IC. . . . . . . . WORD FF66H A SFR T6CON . . . . . . . WORD FF48H A SFR T6IC. . . . . . . . WORD FF68H A SFR T78CON. . . . . . . WORD FF20H A SFR T7IC. . . . . . . . WORD F17AH A ESF T8IC. . . . . . . . WORD F17CH A ESF TFR . . . . . . . . WORD FFACH A SFR THISMDAYS . . . . . WORD AH R PUB SEC=?ID?INT TIMER10 . . . . . . WORD 0H R PUB SEC=?ID?INT TIMER_BANK. . . . . ---- ---- REGBANK TIMER_INT . . . . . INTNO 0023H TxD . . . . . . . . BIT E2H.10 A WDTCON. . . . . . . WORD FFAEH A SFR XP0IC . . . . . . . WORD F186H A ESF XP1IC . . . . . . . WORD F18EH A ESF XP2IC . . . . . . . WORD F196H A ESF XP3IC . . . . . . . WORD F19EH A ESF YEAR. . . . . . . . WORD CH R PUB SEC=?ID?INT ZEROS . . . . . . . WORD FF1CH A SFR bankSORIC . . . . . ---- ---- REGBANK bankSOTIC . . . . . ---- ---- REGBANK deinit_serial . . . FAR 28H R PUB SEC=?PR?INT initTimerInt. . . . FAR 146H R PUB SEC=?PR?INT init_serial . . . . FAR 0H R PUB SEC=?PR?INT ser_receive_int . . FAR 94H R GLB SEC=?PR?INT ser_transmit_int. . FAR F0H R GLB SEC=?PR?INT serial_receive. . . FAR 3EH R PUB SEC=?PR?INT serial_transmit . . FAR 62H R PUB SEC=?PR?INT serinbuf. . . . . . BYTE 84H R PUB SEC=?FD?INT serinbufct. . . . . WORD 6H R PUB SEC=?ND?INT serinflag . . . . . WORD 2H R PUB SEC=?ND?INT seroutbuf . . . . . BYTE 0H R PUB SEC=?FD?INT seroutbufct . . . . WORD 4H R PUB SEC=?ND?INT seroutflag. . . . . WORD 0H R PUB SEC=?ND?INT startTimerInt . . . FAR 15CH R PUB SEC=?PR?INT stopTimerInt. . . . FAR 172H R PUB SEC=?PR?INT timer_int . . . . . FAR 17CH R GLB SEC=?PR?INT ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S)