1 ;-------------------------------------------------------- 2 ; File Created by SDCC : free open source ANSI-C Compiler 3 ; Version 2.9.0 #5416 (Mar 22 2009) (MINGW32) 4 ; This file was generated Tue Nov 24 13:34:44 2015 5 ;-------------------------------------------------------- 6 .module main 7 .optsdcc -mmcs51 --model-small 8 9 ;-------------------------------------------------------- 10 ; Public variables in this module 11 ;-------------------------------------------------------- 12 .globl _main 13 .globl _visualise 14 .globl _data_controller 15 .globl _lcd_controller 16 .globl _format_postfix 17 .globl _format_row2 18 .globl _format_row1 19 .globl _init 20 .globl _make_sound 21 .globl _write_led 22 .globl _SPR0 23 .globl _SPR1 24 .globl _CPHA 25 .globl _CPOL 26 .globl _SPIM 27 .globl _SPE 28 .globl _WCOL 29 .globl _ISPI 30 .globl _I2CI 31 .globl _I2CTX 32 .globl _I2CRS 33 .globl _I2CM 34 .globl _MDI 35 .globl _MCO 36 .globl _MDE 37 .globl _MDO 38 .globl _CS0 39 .globl _CS1 40 .globl _CS2 41 .globl _CS3 42 .globl _SCONV 43 .globl _CCONV 44 .globl _DMA 45 .globl _ADCI 46 .globl _P 47 .globl _F1 48 .globl _OV 49 .globl _RS0 50 .globl _RS1 51 .globl _F0 52 .globl _AC 53 .globl _CY 54 .globl _CAP2 55 .globl _CNT2 56 .globl _TR2 57 .globl _XEN 58 .globl _TCLK 59 .globl _RCLK 60 .globl _EXF2 61 .globl _TF2 62 .globl _WDE 63 .globl _WDS 64 .globl _WDR2 65 .globl _WDR1 66 .globl _PRE0 67 .globl _PRE1 68 .globl _PRE2 69 .globl _PX0 70 .globl _PT0 71 .globl _PX1 72 .globl _PT1 73 .globl _PS 74 .globl _PT2 75 .globl _PADC 76 .globl _PSI 77 .globl _RXD 78 .globl _TXD 79 .globl _INT0 80 .globl _INT1 81 .globl _T0 82 .globl _T1 83 .globl _WR 84 .globl _RD 85 .globl _EX0 86 .globl _ET0 87 .globl _EX1 88 .globl _ET1 89 .globl _ES 90 .globl _ET2 91 .globl _EADC 92 .globl _EA 93 .globl _RI 94 .globl _TI 95 .globl _RB8 96 .globl _TB8 97 .globl _REN 98 .globl _SM2 99 .globl _SM1 100 .globl _SM0 101 .globl _T2 102 .globl _T2EX 103 .globl _IT0 104 .globl _IE0 105 .globl _IT1 106 .globl _IE1 107 .globl _TR0 108 .globl _TF0 109 .globl _TR1 110 .globl _TF1 111 .globl _DACCON 112 .globl _DAC1H 113 .globl _DAC1L 114 .globl _DAC0H 115 .globl _DAC0L 116 .globl _SPICON 117 .globl _SPIDAT 118 .globl _ADCCON3 119 .globl _ADCGAINH 120 .globl _ADCGAINL 121 .globl _ADCOFSH 122 .globl _ADCOFSL 123 .globl _B 124 .globl _ADCCON1 125 .globl _I2CCON 126 .globl _ACC 127 .globl _PSMCON 128 .globl _ADCDATAH 129 .globl _ADCDATAL 130 .globl _ADCCON2 131 .globl _DMAP 132 .globl _DMAH 133 .globl _DMAL 134 .globl _PSW 135 .globl _TH2 136 .globl _TL2 137 .globl _RCAP2H 138 .globl _RCAP2L 139 .globl _T2CON 140 .globl _EADRL 141 .globl _WDCON 142 .globl _EDATA4 143 .globl _EDATA3 144 .globl _EDATA2 145 .globl _EDATA1 146 .globl _ETIM3 147 .globl _ETIM2 148 .globl _ETIM1 149 .globl _ECON 150 .globl _IP 151 .globl _P3 152 .globl _IE2 153 .globl _IE 154 .globl _P2 155 .globl _I2CADD 156 .globl _I2CDAT 157 .globl _SBUF 158 .globl _SCON 159 .globl _P1 160 .globl _TH1 161 .globl _TH0 162 .globl _TL1 163 .globl _TL0 164 .globl _TMOD 165 .globl _TCON 166 .globl _PCON 167 .globl _DPP 168 .globl _DPH 169 .globl _DPL 170 .globl _SP 171 .globl _P0 172 .globl _i 173 .globl _postfix 174 .globl _old_value 175 .globl _next_char 176 .globl _old_dip 177 .globl _dip 178 .globl _consumption 179 .globl _sub_info 180 .globl _total_pos 181 .globl _consumption100miles 182 .globl _consumption100km 183 .globl _fuel_threshold 184 .globl _tank_max_volume 185 .globl _row2 186 .globl _row1 187 .globl _mode 188 .globl _metrica 189 .globl _tank_value 190 ;-------------------------------------------------------- 191 ; special function registers 192 ;-------------------------------------------------------- 193 .area RSEG (DATA) 0080 194 _P0 = 0x0080 0081 195 _SP = 0x0081 0082 196 _DPL = 0x0082 0083 197 _DPH = 0x0083 0084 198 _DPP = 0x0084 0087 199 _PCON = 0x0087 0088 200 _TCON = 0x0088 0089 201 _TMOD = 0x0089 008A 202 _TL0 = 0x008a 008B 203 _TL1 = 0x008b 008C 204 _TH0 = 0x008c 008D 205 _TH1 = 0x008d 0090 206 _P1 = 0x0090 0098 207 _SCON = 0x0098 0099 208 _SBUF = 0x0099 009A 209 _I2CDAT = 0x009a 009B 210 _I2CADD = 0x009b 00A0 211 _P2 = 0x00a0 00A8 212 _IE = 0x00a8 00A9 213 _IE2 = 0x00a9 00B0 214 _P3 = 0x00b0 00B8 215 _IP = 0x00b8 00B9 216 _ECON = 0x00b9 00BA 217 _ETIM1 = 0x00ba 00BB 218 _ETIM2 = 0x00bb 00C4 219 _ETIM3 = 0x00c4 00BC 220 _EDATA1 = 0x00bc 00BD 221 _EDATA2 = 0x00bd 00BE 222 _EDATA3 = 0x00be 00BF 223 _EDATA4 = 0x00bf 00C0 224 _WDCON = 0x00c0 00C6 225 _EADRL = 0x00c6 00C8 226 _T2CON = 0x00c8 00CA 227 _RCAP2L = 0x00ca 00CB 228 _RCAP2H = 0x00cb 00CC 229 _TL2 = 0x00cc 00CD 230 _TH2 = 0x00cd 00D0 231 _PSW = 0x00d0 00D2 232 _DMAL = 0x00d2 00D3 233 _DMAH = 0x00d3 00D4 234 _DMAP = 0x00d4 00D8 235 _ADCCON2 = 0x00d8 00D9 236 _ADCDATAL = 0x00d9 00DA 237 _ADCDATAH = 0x00da 00DF 238 _PSMCON = 0x00df 00E0 239 _ACC = 0x00e0 00E8 240 _I2CCON = 0x00e8 00EF 241 _ADCCON1 = 0x00ef 00F0 242 _B = 0x00f0 00F1 243 _ADCOFSL = 0x00f1 00F2 244 _ADCOFSH = 0x00f2 00F3 245 _ADCGAINL = 0x00f3 00F4 246 _ADCGAINH = 0x00f4 00F5 247 _ADCCON3 = 0x00f5 00F7 248 _SPIDAT = 0x00f7 00F8 249 _SPICON = 0x00f8 00F9 250 _DAC0L = 0x00f9 00FA 251 _DAC0H = 0x00fa 00FB 252 _DAC1L = 0x00fb 00FC 253 _DAC1H = 0x00fc 00FD 254 _DACCON = 0x00fd 255 ;-------------------------------------------------------- 256 ; special function bits 257 ;-------------------------------------------------------- 258 .area RSEG (DATA) 008F 259 _TF1 = 0x008f 008E 260 _TR1 = 0x008e 008D 261 _TF0 = 0x008d 008C 262 _TR0 = 0x008c 008B 263 _IE1 = 0x008b 008A 264 _IT1 = 0x008a 0089 265 _IE0 = 0x0089 0088 266 _IT0 = 0x0088 0091 267 _T2EX = 0x0091 0090 268 _T2 = 0x0090 009F 269 _SM0 = 0x009f 009E 270 _SM1 = 0x009e 009D 271 _SM2 = 0x009d 009C 272 _REN = 0x009c 009B 273 _TB8 = 0x009b 009A 274 _RB8 = 0x009a 0099 275 _TI = 0x0099 0098 276 _RI = 0x0098 00AF 277 _EA = 0x00af 00AE 278 _EADC = 0x00ae 00AD 279 _ET2 = 0x00ad 00AC 280 _ES = 0x00ac 00AB 281 _ET1 = 0x00ab 00AA 282 _EX1 = 0x00aa 00A9 283 _ET0 = 0x00a9 00A8 284 _EX0 = 0x00a8 00B7 285 _RD = 0x00b7 00B6 286 _WR = 0x00b6 00B5 287 _T1 = 0x00b5 00B4 288 _T0 = 0x00b4 00B3 289 _INT1 = 0x00b3 00B2 290 _INT0 = 0x00b2 00B1 291 _TXD = 0x00b1 00B0 292 _RXD = 0x00b0 00BF 293 _PSI = 0x00bf 00BE 294 _PADC = 0x00be 00BD 295 _PT2 = 0x00bd 00BC 296 _PS = 0x00bc 00BB 297 _PT1 = 0x00bb 00BA 298 _PX1 = 0x00ba 00B9 299 _PT0 = 0x00b9 00B8 300 _PX0 = 0x00b8 00C7 301 _PRE2 = 0x00c7 00C6 302 _PRE1 = 0x00c6 00C5 303 _PRE0 = 0x00c5 00C3 304 _WDR1 = 0x00c3 00C2 305 _WDR2 = 0x00c2 00C1 306 _WDS = 0x00c1 00C0 307 _WDE = 0x00c0 00CF 308 _TF2 = 0x00cf 00CE 309 _EXF2 = 0x00ce 00CD 310 _RCLK = 0x00cd 00CC 311 _TCLK = 0x00cc 00CB 312 _XEN = 0x00cb 00CA 313 _TR2 = 0x00ca 00C9 314 _CNT2 = 0x00c9 00C8 315 _CAP2 = 0x00c8 00D7 316 _CY = 0x00d7 00D6 317 _AC = 0x00d6 00D5 318 _F0 = 0x00d5 00D4 319 _RS1 = 0x00d4 00D3 320 _RS0 = 0x00d3 00D2 321 _OV = 0x00d2 00D1 322 _F1 = 0x00d1 00D0 323 _P = 0x00d0 00DF 324 _ADCI = 0x00df 00DE 325 _DMA = 0x00de 00DD 326 _CCONV = 0x00dd 00DC 327 _SCONV = 0x00dc 00DB 328 _CS3 = 0x00db 00DA 329 _CS2 = 0x00da 00D9 330 _CS1 = 0x00d9 00D8 331 _CS0 = 0x00d8 00EF 332 _MDO = 0x00ef 00EE 333 _MDE = 0x00ee 00ED 334 _MCO = 0x00ed 00EC 335 _MDI = 0x00ec 00EB 336 _I2CM = 0x00eb 00EA 337 _I2CRS = 0x00ea 00E9 338 _I2CTX = 0x00e9 00E8 339 _I2CI = 0x00e8 00FF 340 _ISPI = 0x00ff 00FE 341 _WCOL = 0x00fe 00FD 342 _SPE = 0x00fd 00FC 343 _SPIM = 0x00fc 00FB 344 _CPOL = 0x00fb 00FA 345 _CPHA = 0x00fa 00F9 346 _SPR1 = 0x00f9 00F8 347 _SPR0 = 0x00f8 348 ;-------------------------------------------------------- 349 ; overlayable register banks 350 ;-------------------------------------------------------- 351 .area REG_BANK_0 (REL,OVR,DATA) 0000 352 .ds 8 353 ;-------------------------------------------------------- 354 ; internal ram data 355 ;-------------------------------------------------------- 356 .area DSEG (DATA) 0000 357 _tank_value:: 0000 358 .ds 1 0001 359 _metrica:: 0001 360 .ds 1 0002 361 _mode:: 0002 362 .ds 1 0003 363 _row1:: 0003 364 .ds 16 0013 365 _row2:: 0013 366 .ds 16 0023 367 _tank_max_volume:: 0023 368 .ds 1 0024 369 _fuel_threshold:: 0024 370 .ds 1 0025 371 _consumption100km:: 0025 372 .ds 1 0026 373 _consumption100miles:: 0026 374 .ds 1 0027 375 _total_pos:: 0027 376 .ds 1 0028 377 _sub_info:: 0028 378 .ds 1 0029 379 _consumption:: 0029 380 .ds 1 002A 381 _dip:: 002A 382 .ds 1 002B 383 _old_dip:: 002B 384 .ds 1 002C 385 _next_char:: 002C 386 .ds 1 002D 387 _old_value:: 002D 388 .ds 1 002E 389 _postfix:: 002E 390 .ds 2 0030 391 _i:: 0030 392 .ds 2 393 ;-------------------------------------------------------- 394 ; overlayable items in internal ram 395 ;-------------------------------------------------------- 396 .area OSEG (OVR,DATA) 397 ;-------------------------------------------------------- 398 ; Stack segment in internal ram 399 ;-------------------------------------------------------- 400 .area SSEG (DATA) 0000 401 __start__stack: 0000 402 .ds 1 403 404 ;-------------------------------------------------------- 405 ; indirectly addressable internal ram data 406 ;-------------------------------------------------------- 407 .area ISEG (DATA) 408 ;-------------------------------------------------------- 409 ; absolute internal ram data 410 ;-------------------------------------------------------- 411 .area IABS (ABS,DATA) 412 .area IABS (ABS,DATA) 413 ;-------------------------------------------------------- 414 ; bit data 415 ;-------------------------------------------------------- 416 .area BSEG (BIT) 417 ;-------------------------------------------------------- 418 ; paged external ram data 419 ;-------------------------------------------------------- 420 .area PSEG (PAG,XDATA) 421 ;-------------------------------------------------------- 422 ; external ram data 423 ;-------------------------------------------------------- 424 .area XSEG (XDATA) 425 ;-------------------------------------------------------- 426 ; absolute external ram data 427 ;-------------------------------------------------------- 428 .area XABS (ABS,XDATA) 429 ;-------------------------------------------------------- 430 ; external initialized ram data 431 ;-------------------------------------------------------- 432 .area XISEG (XDATA) 433 .area HOME (CODE) 434 .area GSINIT0 (CODE) 435 .area GSINIT1 (CODE) 436 .area GSINIT2 (CODE) 437 .area GSINIT3 (CODE) 438 .area GSINIT4 (CODE) 439 .area GSINIT5 (CODE) 440 .area GSINIT (CODE) 441 .area GSFINAL (CODE) 442 .area CSEG (CODE) 443 ;-------------------------------------------------------- 444 ; interrupt vector 445 ;-------------------------------------------------------- 446 .area HOME (CODE) 0000 447 __interrupt_vect: 0000 02s00r00 448 ljmp __sdcc_gsinit_startup 0003 32 449 reti 0004 450 .ds 7 000B 32 451 reti 000C 452 .ds 7 0013 32 453 reti 0014 454 .ds 7 001B 32 455 reti 001C 456 .ds 7 0023 02s00r00 457 ljmp _handler_uart 458 ;-------------------------------------------------------- 459 ; global & static initialisations 460 ;-------------------------------------------------------- 461 .area HOME (CODE) 462 .area GSINIT (CODE) 463 .area GSFINAL (CODE) 464 .area GSINIT (CODE) 465 .globl __sdcc_gsinit_startup 466 .globl __sdcc_program_startup 467 .globl __start__stack 468 .globl __mcs51_genXINIT 469 .globl __mcs51_genXRAMCLEAR 470 .globl __mcs51_genRAMCLEAR 471 ; SRC/main.c:18: unsigned char metrica = KILOMETERS; 0000 75*01 01 472 mov _metrica,#0x01 473 ; SRC/main.c:19: unsigned char mode = TANK_VALUE; 0003 75*02 00 474 mov _mode,#0x00 475 ; SRC/main.c:22: unsigned char tank_max_volume = 50; 0006 75*23 32 476 mov _tank_max_volume,#0x32 477 ; SRC/main.c:23: unsigned char fuel_threshold = 5; 0009 75*24 05 478 mov _fuel_threshold,#0x05 479 ; SRC/main.c:24: unsigned char consumption100km = 2; 000C 75*25 02 480 mov _consumption100km,#0x02 481 ; SRC/main.c:25: unsigned char consumption100miles = 1; 000F 75*26 01 482 mov _consumption100miles,#0x01 483 ; SRC/main.c:26: unsigned char total_pos = 14; 0012 75*27 0E 484 mov _total_pos,#0x0E 485 ; SRC/main.c:28: unsigned char sub_info = 0; 0015 75*28 00 486 mov _sub_info,#0x00 487 ; SRC/main.c:29: unsigned char consumption = 0; 0018 75*29 00 488 mov _consumption,#0x00 489 ; SRC/main.c:30: unsigned char dip = 0; 001B 75*2A 00 490 mov _dip,#0x00 491 ; SRC/main.c:31: unsigned char old_dip = 0; 001E 75*2B 00 492 mov _old_dip,#0x00 493 ; SRC/main.c:32: unsigned char next_char = 0; 0021 75*2C 00 494 mov _next_char,#0x00 495 ; SRC/main.c:33: unsigned char old_value = 10; 0024 75*2D 0A 496 mov _old_value,#0x0A 497 ; SRC/main.c:35: int i = 0; 0027 E4 498 clr a 0028 F5*30 499 mov _i,a 002A F5*31 500 mov (_i + 1),a 501 .area GSFINAL (CODE) 0000 02s00r26 502 ljmp __sdcc_program_startup 503 ;-------------------------------------------------------- 504 ; Home 505 ;-------------------------------------------------------- 506 .area HOME (CODE) 507 .area HOME (CODE) 0026 508 __sdcc_program_startup: 0026 12s02rFB 509 lcall _main 510 ; return from main will lock up 0029 80 FE 511 sjmp . 512 ;-------------------------------------------------------- 513 ; code 514 ;-------------------------------------------------------- 515 .area CSEG (CODE) 516 ;------------------------------------------------------------ 517 ;Allocation info for local variables in function 'write_led' 518 ;------------------------------------------------------------ 519 ;value Allocated to registers r2 520 ;------------------------------------------------------------ 521 ; SRC/main.c:38: void write_led(unsigned char value) 522 ; ----------------------------------------- 523 ; function write_led 524 ; ----------------------------------------- 0000 525 _write_led: 0002 526 ar2 = 0x02 0003 527 ar3 = 0x03 0004 528 ar4 = 0x04 0005 529 ar5 = 0x05 0006 530 ar6 = 0x06 0007 531 ar7 = 0x07 0000 532 ar0 = 0x00 0001 533 ar1 = 0x01 0000 AA 82 534 mov r2,dpl 535 ; SRC/main.c:40: write_max(7, value); 0002 C0 02 536 push ar2 0004 90 00 07 537 mov dptr,#0x0007 0007 12s00r00 538 lcall _write_max 000A 15 81 539 dec sp 000C 22 540 ret 541 ;------------------------------------------------------------ 542 ;Allocation info for local variables in function 'make_sound' 543 ;------------------------------------------------------------ 544 ;sound Allocated to registers r2 r3 545 ;i Allocated to registers r4 r5 546 ;------------------------------------------------------------ 547 ; SRC/main.c:42: void make_sound() 548 ; ----------------------------------------- 549 ; function make_sound 550 ; ----------------------------------------- 000D 551 _make_sound: 552 ; SRC/main.c:44: unsigned int sound = 0; 000D 7A 00 553 mov r2,#0x00 000F 7B 00 554 mov r3,#0x00 555 ; SRC/main.c:47: for (i = 0; i < 1000; i++) { 0011 7C 00 556 mov r4,#0x00 0013 7D 00 557 mov r5,#0x00 0015 558 00105$: 0015 C3 559 clr c 0016 EC 560 mov a,r4 0017 94 E8 561 subb a,#0xE8 0019 ED 562 mov a,r5 001A 64 80 563 xrl a,#0x80 001C 94 83 564 subb a,#0x83 001E 40 01 565 jc 00119$ 0020 22 566 ret 0021 567 00119$: 568 ; SRC/main.c:48: sound = (sound == 0x00) ? 0x10 : 0x00; 0021 EA 569 mov a,r2 0022 4B 570 orl a,r3 0023 B4 01 00 571 cjne a,#0x01,00120$ 0026 572 00120$: 0026 E4 573 clr a 0027 33 574 rlc a 0028 FE 575 mov r6,a 0029 60 02 576 jz 00111$ 002B 74 10 577 mov a,#0x10 002D 578 00111$: 002D FA 579 mov r2,a 002E 7B 00 580 mov r3,#0x00 581 ; SRC/main.c:49: write_max(4, sound); 0030 8A 06 582 mov ar6,r2 0032 C0 02 583 push ar2 0034 C0 03 584 push ar3 0036 C0 04 585 push ar4 0038 C0 05 586 push ar5 003A C0 06 587 push ar6 003C 90 00 04 588 mov dptr,#0x0004 003F 12s00r00 589 lcall _write_max 0042 15 81 590 dec sp 0044 D0 05 591 pop ar5 0046 D0 04 592 pop ar4 593 ; SRC/main.c:50: if(i%100==0) 0048 C0 04 594 push ar4 004A C0 05 595 push ar5 004C 74 64 596 mov a,#0x64 004E C0 E0 597 push acc 0050 E4 598 clr a 0051 C0 E0 599 push acc 0053 8C 82 600 mov dpl,r4 0055 8D 83 601 mov dph,r5 0057 12s00r00 602 lcall __modsint 005A AE 82 603 mov r6,dpl 005C AF 83 604 mov r7,dph 005E 15 81 605 dec sp 0060 15 81 606 dec sp 0062 D0 05 607 pop ar5 0064 D0 04 608 pop ar4 0066 D0 03 609 pop ar3 0068 D0 02 610 pop ar2 006A EE 611 mov a,r6 006B 4F 612 orl a,r7 006C 70 16 613 jnz 00102$ 614 ; SRC/main.c:51: write_led(0xff); 006E 75 82 FF 615 mov dpl,#0xFF 0071 C0 02 616 push ar2 0073 C0 03 617 push ar3 0075 C0 04 618 push ar4 0077 C0 05 619 push ar5 0079 12s00r00 620 lcall _write_led 007C D0 05 621 pop ar5 007E D0 04 622 pop ar4 0080 D0 03 623 pop ar3 0082 D0 02 624 pop ar2 0084 625 00102$: 626 ; SRC/main.c:52: if(i%200==0) 0084 C0 02 627 push ar2 0086 C0 03 628 push ar3 0088 C0 04 629 push ar4 008A C0 05 630 push ar5 008C 74 C8 631 mov a,#0xC8 008E C0 E0 632 push acc 0090 E4 633 clr a 0091 C0 E0 634 push acc 0093 8C 82 635 mov dpl,r4 0095 8D 83 636 mov dph,r5 0097 12s00r00 637 lcall __modsint 009A AE 82 638 mov r6,dpl 009C AF 83 639 mov r7,dph 009E 15 81 640 dec sp 00A0 15 81 641 dec sp 00A2 D0 05 642 pop ar5 00A4 D0 04 643 pop ar4 00A6 D0 03 644 pop ar3 00A8 D0 02 645 pop ar2 00AA EE 646 mov a,r6 00AB 4F 647 orl a,r7 648 ; SRC/main.c:53: write_led(0x00); 00AC 70 15 649 jnz 00107$ 00AE F5 82 650 mov dpl,a 00B0 C0 02 651 push ar2 00B2 C0 03 652 push ar3 00B4 C0 04 653 push ar4 00B6 C0 05 654 push ar5 00B8 12s00r00 655 lcall _write_led 00BB D0 05 656 pop ar5 00BD D0 04 657 pop ar4 00BF D0 03 658 pop ar3 00C1 D0 02 659 pop ar2 00C3 660 00107$: 661 ; SRC/main.c:47: for (i = 0; i < 1000; i++) { 00C3 0C 662 inc r4 00C4 BC 00 01 663 cjne r4,#0x00,00124$ 00C7 0D 664 inc r5 00C8 665 00124$: 00C8 02s00r15 666 ljmp 00105$ 667 ;------------------------------------------------------------ 668 ;Allocation info for local variables in function 'init' 669 ;------------------------------------------------------------ 670 ;speed Allocated to registers 671 ;------------------------------------------------------------ 672 ; SRC/main.c:57: void init(unsigned char speed) 673 ; ----------------------------------------- 674 ; function init 675 ; ----------------------------------------- 00CB 676 _init: 677 ; SRC/main.c:59: TH1 = 0xFD; //Скорость 9600 00CB 75 8D FD 678 mov _TH1,#0xFD 679 ; SRC/main.c:60: TH0 = 0x00; 00CE 75 8C 00 680 mov _TH0,#0x00 681 ; SRC/main.c:61: TMOD = 0x22; //Таймер 1 и 0 в режиме autoreload 00D1 75 89 22 682 mov _TMOD,#0x22 683 ; SRC/main.c:62: TCON = 0x50; //Запуск таймеров 0 и 1 00D4 75 88 50 684 mov _TCON,#0x50 685 ; SRC/main.c:63: SCON = 0x50; //8 bit UART, разрешение приема 00D7 75 98 50 686 mov _SCON,#0x50 687 ; SRC/main.c:64: PCON &= 0x7F; //Отключение дублирования скорости, установленной в TH1 00DA 53 87 7F 688 anl _PCON,#0x7F 689 ; SRC/main.c:67: init_timer(1000); 00DD 90 03 E8 690 mov dptr,#0x03E8 00E0 E4 691 clr a 00E1 F5 F0 692 mov b,a 00E3 12s00r00 693 lcall _init_timer 694 ; SRC/main.c:68: write_string("ready\n"); 00E6 90s00r00 695 mov dptr,#__str_0 00E9 75 F0 80 696 mov b,#0x80 00EC 12s00r00 697 lcall _write_string 698 ; SRC/main.c:70: EA = 1; 00EF D2 AF 699 setb _EA 700 ; SRC/main.c:71: ET0 = 1; 00F1 D2 A9 701 setb _ET0 00F3 22 702 ret 703 ;------------------------------------------------------------ 704 ;Allocation info for local variables in function 'format_row1' 705 ;------------------------------------------------------------ 706 ;value Allocated to registers r2 707 ;i Allocated to registers r4 r5 708 ;pos Allocated to registers r2 r3 709 ;------------------------------------------------------------ 710 ; SRC/main.c:74: void format_row1(char value) 711 ; ----------------------------------------- 712 ; function format_row1 713 ; ----------------------------------------- 00F4 714 _format_row1: 00F4 AA 82 715 mov r2,dpl 716 ; SRC/main.c:78: row1[0] = '['; 00F6 75*03 5B 717 mov _row1,#0x5B 718 ; SRC/main.c:79: row1[15] = ']'; 00F9 75*12 5D 719 mov (_row1 + 0x000f),#0x5D 720 ; SRC/main.c:80: pos = value * total_pos / tank_max_volume; 00FC C2 D5 721 clr F0 00FE 85*27 F0 722 mov b,_total_pos 0101 EA 723 mov a,r2 0102 30 E7 04 724 jnb acc.7,00117$ 0105 B2 D5 725 cpl F0 0107 F4 726 cpl a 0108 04 727 inc a 0109 728 00117$: 0109 A4 729 mul ab 010A 30 D5 0A 730 jnb F0,00118$ 010D F4 731 cpl a 010E 24 01 732 add a,#0x01 0110 C5 F0 733 xch a,b 0112 F4 734 cpl a 0113 34 00 735 addc a,#0x00 0115 C5 F0 736 xch a,b 0117 737 00118$: 0117 F5 82 738 mov dpl,a 0119 85 F0 83 739 mov dph,b 011C AA*23 740 mov r2,_tank_max_volume 011E 7B 00 741 mov r3,#0x00 0120 C0 02 742 push ar2 0122 C0 03 743 push ar3 0124 12s00r00 744 lcall __divsint 0127 AA 82 745 mov r2,dpl 0129 AB 83 746 mov r3,dph 012B 15 81 747 dec sp 012D 15 81 748 dec sp 749 ; SRC/main.c:81: for ( i = 1; i <= pos; i++) 012F 7C 01 750 mov r4,#0x01 0131 7D 00 751 mov r5,#0x00 0133 752 00101$: 0133 C3 753 clr c 0134 EA 754 mov a,r2 0135 9C 755 subb a,r4 0136 EB 756 mov a,r3 0137 64 80 757 xrl a,#0x80 0139 8D F0 758 mov b,r5 013B 63 F0 80 759 xrl b,#0x80 013E 95 F0 760 subb a,b 0140 40 0D 761 jc 00114$ 762 ; SRC/main.c:83: row1[i] = 0xff; 0142 EC 763 mov a,r4 0143 24r03 764 add a,#_row1 0145 F8 765 mov r0,a 0146 76 FF 766 mov @r0,#0xFF 767 ; SRC/main.c:81: for ( i = 1; i <= pos; i++) 0148 0C 768 inc r4 0149 BC 00 E7 769 cjne r4,#0x00,00101$ 014C 0D 770 inc r5 014D 80 E4 771 sjmp 00101$ 014F 772 00114$: 014F 8C 02 773 mov ar2,r4 0151 8D 03 774 mov ar3,r5 0153 775 00105$: 776 ; SRC/main.c:85: for (;i <= total_pos; i++) 0153 AC*27 777 mov r4,_total_pos 0155 7D 00 778 mov r5,#0x00 0157 C3 779 clr c 0158 EC 780 mov a,r4 0159 9A 781 subb a,r2 015A ED 782 mov a,r5 015B 64 80 783 xrl a,#0x80 015D 8B F0 784 mov b,r3 015F 63 F0 80 785 xrl b,#0x80 0162 95 F0 786 subb a,b 0164 40 0D 787 jc 00109$ 788 ; SRC/main.c:87: row1[i] = ' '; 0166 EA 789 mov a,r2 0167 24r03 790 add a,#_row1 0169 F8 791 mov r0,a 016A 76 20 792 mov @r0,#0x20 793 ; SRC/main.c:85: for (;i <= total_pos; i++) 016C 0A 794 inc r2 016D BA 00 E3 795 cjne r2,#0x00,00105$ 0170 0B 796 inc r3 0171 80 E0 797 sjmp 00105$ 0173 798 00109$: 0173 22 799 ret 800 ;------------------------------------------------------------ 801 ;Allocation info for local variables in function 'format_row2' 802 ;------------------------------------------------------------ 803 ;value Allocated to registers r2 804 ;i Allocated to registers r3 r4 805 ;------------------------------------------------------------ 806 ; SRC/main.c:91: void format_row2(unsigned char value) 807 ; ----------------------------------------- 808 ; function format_row2 809 ; ----------------------------------------- 0174 810 _format_row2: 0174 AA 82 811 mov r2,dpl 812 ; SRC/main.c:94: for(i=0; i<16; i++) 0176 7B 00 813 mov r3,#0x00 0178 7C 00 814 mov r4,#0x00 017A 815 00105$: 017A C3 816 clr c 017B EB 817 mov a,r3 017C 94 10 818 subb a,#0x10 017E EC 819 mov a,r4 017F 64 80 820 xrl a,#0x80 0181 94 80 821 subb a,#0x80 0183 50 0D 822 jnc 00108$ 823 ; SRC/main.c:96: row2[i]=0x20; 0185 EB 824 mov a,r3 0186 24r13 825 add a,#_row2 0188 F8 826 mov r0,a 0189 76 20 827 mov @r0,#0x20 828 ; SRC/main.c:94: for(i=0; i<16; i++) 018B 0B 829 inc r3 018C BB 00 EB 830 cjne r3,#0x00,00105$ 018F 0C 831 inc r4 0190 80 E8 832 sjmp 00105$ 0192 833 00108$: 834 ; SRC/main.c:101: row2[0] = 0 + '0'; 0192 75*13 30 835 mov _row2,#0x30 836 ; SRC/main.c:102: row2[1] = 0 + '0'; 0195 75*14 30 837 mov (_row2 + 0x0001),#0x30 838 ; SRC/main.c:103: row2[2] = 0 + '0'; 0198 75*15 30 839 mov (_row2 + 0x0002),#0x30 840 ; SRC/main.c:105: row2[2] = value % 10 + 0x30; 019B 75 F0 0A 841 mov b,#0x0A 019E EA 842 mov a,r2 019F 84 843 div ab 01A0 E5 F0 844 mov a,b 01A2 24 30 845 add a,#0x30 01A4 F5*15 846 mov (_row2 + 0x0002),a 847 ; SRC/main.c:106: if(value >= 10) 01A6 BA 0A 00 848 cjne r2,#0x0A,00117$ 01A9 849 00117$: 01A9 40 10 850 jc 00102$ 851 ; SRC/main.c:108: value = value / 10; 01AB 75 F0 0A 852 mov b,#0x0A 01AE EA 853 mov a,r2 01AF 84 854 div ab 855 ; SRC/main.c:109: row2[1] = value % 10 + 0x30; 01B0 FA 856 mov r2,a 01B1 75 F0 0A 857 mov b,#0x0A 01B4 84 858 div ab 01B5 E5 F0 859 mov a,b 01B7 24 30 860 add a,#0x30 01B9 F5*14 861 mov (_row2 + 0x0001),a 01BB 862 00102$: 863 ; SRC/main.c:112: if(value >= 100) 01BB BA 64 00 864 cjne r2,#0x64,00119$ 01BE 865 00119$: 01BE 40 10 866 jc 00104$ 867 ; SRC/main.c:114: value = value / 10; 01C0 75 F0 0A 868 mov b,#0x0A 01C3 EA 869 mov a,r2 01C4 84 870 div ab 871 ; SRC/main.c:115: row2[0] = value % 10 + 0x30; 01C5 FA 872 mov r2,a 01C6 75 F0 0A 873 mov b,#0x0A 01C9 84 874 div ab 01CA E5 F0 875 mov a,b 01CC 24 30 876 add a,#0x30 01CE F5*13 877 mov _row2,a 01D0 878 00104$: 879 ; SRC/main.c:119: row2[i] = postfix[0]; 01D0 85*2E*16 880 mov (_row2 + 0x0003),_postfix 881 ; SRC/main.c:121: row2[i] = postfix[1]; 01D3 85*2F*17 882 mov (_row2 + 0x0004),(_postfix + 0x0001) 883 ; SRC/main.c:122: i++; 01D6 22 884 ret 885 ;------------------------------------------------------------ 886 ;Allocation info for local variables in function 'format_postfix' 887 ;------------------------------------------------------------ 888 ;------------------------------------------------------------ 889 ; SRC/main.c:125: void format_postfix() 890 ; ----------------------------------------- 891 ; function format_postfix 892 ; ----------------------------------------- 01D7 893 _format_postfix: 894 ; SRC/main.c:127: if (mode == TANK_VALUE) { postfix[0] = 'L'; postfix[1] = ' '; } 01D7 E5*02 895 mov a,_mode 01D9 70 07 896 jnz 00105$ 01DB 75*2E 4C 897 mov _postfix,#0x4C 01DE 75*2F 20 898 mov (_postfix + 0x0001),#0x20 01E1 22 899 ret 01E2 900 00105$: 901 ; SRC/main.c:128: else if (metrica == KILOMETERS) { postfix[0] = 'k'; postfix[1] = 'm'; } 01E2 74 01 902 mov a,#0x01 01E4 B5*01 07 903 cjne a,_metrica,00102$ 01E7 75*2E 6B 904 mov _postfix,#0x6B 01EA 75*2F 6D 905 mov (_postfix + 0x0001),#0x6D 01ED 22 906 ret 01EE 907 00102$: 908 ; SRC/main.c:129: else { postfix[0] = 'm'; postfix[1] = ' '; } 01EE 75*2E 6D 909 mov _postfix,#0x6D 01F1 75*2F 20 910 mov (_postfix + 0x0001),#0x20 01F4 22 911 ret 912 ;------------------------------------------------------------ 913 ;Allocation info for local variables in function 'lcd_controller' 914 ;------------------------------------------------------------ 915 ;additional_info Allocated to stack - offset -3 916 ;volume Allocated to registers r2 917 ;------------------------------------------------------------ 918 ; SRC/main.c:132: void lcd_controller(unsigned char volume, unsigned char additional_info) 919 ; ----------------------------------------- 920 ; function lcd_controller 921 ; ----------------------------------------- 01F5 922 _lcd_controller: 01F5 C0*00 923 push _bp 01F7 85 81*00 924 mov _bp,sp 01FA AA 82 925 mov r2,dpl 926 ; SRC/main.c:134: format_postfix(); 01FC C0 02 927 push ar2 01FE 12s01rD7 928 lcall _format_postfix 0201 D0 02 929 pop ar2 930 ; SRC/main.c:135: format_row1(volume); 0203 8A 82 931 mov dpl,r2 0205 12s00rF4 932 lcall _format_row1 933 ; SRC/main.c:136: format_row2(additional_info); 0208 A8*00 934 mov r0,_bp 020A 18 935 dec r0 020B 18 936 dec r0 020C 18 937 dec r0 020D 86 82 938 mov dpl,@r0 020F 12s01r74 939 lcall _format_row2 940 ; SRC/main.c:137: clear_lcd(); 0212 12s00r00 941 lcall _clear_lcd 942 ; SRC/main.c:138: for (i = 0; i < 16; i++) 0215 E4 943 clr a 0216 F5*30 944 mov _i,a 0218 F5*31 945 mov (_i + 1),a 021A 946 00101$: 021A C3 947 clr c 021B E5*30 948 mov a,_i 021D 94 10 949 subb a,#0x10 021F E5*31 950 mov a,(_i + 1) 0221 64 80 951 xrl a,#0x80 0223 94 80 952 subb a,#0x80 0225 50 14 953 jnc 00104$ 954 ; SRC/main.c:140: print_char_lcd(row1[i]); 0227 E5*30 955 mov a,_i 0229 24r03 956 add a,#_row1 022B F8 957 mov r0,a 022C 86 82 958 mov dpl,@r0 022E 12s00r00 959 lcall _print_char_lcd 960 ; SRC/main.c:138: for (i = 0; i < 16; i++) 0231 05*30 961 inc _i 0233 E4 962 clr a 0234 B5*30 E3 963 cjne a,_i,00101$ 0237 05*31 964 inc (_i + 1) 0239 80 DF 965 sjmp 00101$ 023B 966 00104$: 967 ; SRC/main.c:142: goto_xy_lcd(1,2); 023B 74 02 968 mov a,#0x02 023D C0 E0 969 push acc 023F 75 82 01 970 mov dpl,#0x01 0242 12s00r00 971 lcall _goto_xy_lcd 0245 15 81 972 dec sp 973 ; SRC/main.c:143: for (i = 0; i < 16; i++) 0247 E4 974 clr a 0248 F5*30 975 mov _i,a 024A F5*31 976 mov (_i + 1),a 024C 977 00105$: 024C C3 978 clr c 024D E5*30 979 mov a,_i 024F 94 10 980 subb a,#0x10 0251 E5*31 981 mov a,(_i + 1) 0253 64 80 982 xrl a,#0x80 0255 94 80 983 subb a,#0x80 0257 50 14 984 jnc 00109$ 985 ; SRC/main.c:145: print_char_lcd(row2[i]); 0259 E5*30 986 mov a,_i 025B 24r13 987 add a,#_row2 025D F8 988 mov r0,a 025E 86 82 989 mov dpl,@r0 0260 12s00r00 990 lcall _print_char_lcd 991 ; SRC/main.c:143: for (i = 0; i < 16; i++) 0263 05*30 992 inc _i 0265 E4 993 clr a 0266 B5*30 E3 994 cjne a,_i,00105$ 0269 05*31 995 inc (_i + 1) 026B 80 DF 996 sjmp 00105$ 026D 997 00109$: 026D D0*00 998 pop _bp 026F 22 999 ret 1000 ;------------------------------------------------------------ 1001 ;Allocation info for local variables in function 'data_controller' 1002 ;------------------------------------------------------------ 1003 ;------------------------------------------------------------ 1004 ; SRC/main.c:149: unsigned char data_controller() 1005 ; ----------------------------------------- 1006 ; function data_controller 1007 ; ----------------------------------------- 0270 1008 _data_controller: 1009 ; SRC/main.c:151: return get_tank_value(); 0270 02s00r00 1010 ljmp _get_tank_value 1011 ;------------------------------------------------------------ 1012 ;Allocation info for local variables in function 'visualise' 1013 ;------------------------------------------------------------ 1014 ;value Allocated to registers r2 1015 ;------------------------------------------------------------ 1016 ; SRC/main.c:155: void visualise(unsigned char value) 1017 ; ----------------------------------------- 1018 ; function visualise 1019 ; ----------------------------------------- 0273 1020 _visualise: 0273 AA 82 1021 mov r2,dpl 1022 ; SRC/main.c:157: dip = read_max(2); 0275 90 00 02 1023 mov dptr,#0x0002 0278 C0 02 1024 push ar2 027A 12s00r00 1025 lcall _read_max 027D 85 82*2A 1026 mov _dip,dpl 0280 D0 02 1027 pop ar2 1028 ; SRC/main.c:158: if (value == old_value && dip == old_dip) return; 0282 EA 1029 mov a,r2 0283 B5*2D 06 1030 cjne a,_old_value,00102$ 0286 E5*2B 1031 mov a,_old_dip 0288 B5*2A 01 1032 cjne a,_dip,00102$ 028B 22 1033 ret 028C 1034 00102$: 1035 ; SRC/main.c:160: metrica = (dip & 0x1) ? MILES : KILOMETERS; 028C E5*2A 1036 mov a,_dip 028E 30 E0 04 1037 jnb acc.0,00109$ 0291 7B 00 1038 mov r3,#0x00 0293 80 02 1039 sjmp 00110$ 0295 1040 00109$: 0295 7B 01 1041 mov r3,#0x01 0297 1042 00110$: 0297 8B*01 1043 mov _metrica,r3 1044 ; SRC/main.c:161: mode = (dip & 0x2) ? TANK_VALUE : PREDICTION; 0299 E5*2A 1045 mov a,_dip 029B 30 E1 04 1046 jnb acc.1,00111$ 029E 7B 00 1047 mov r3,#0x00 02A0 80 02 1048 sjmp 00112$ 02A2 1049 00111$: 02A2 7B 01 1050 mov r3,#0x01 02A4 1051 00112$: 02A4 8B*02 1052 mov _mode,r3 1053 ; SRC/main.c:162: consumption = (metrica == MILES) ? consumption100miles : consumption100km; 02A6 E5*01 1054 mov a,_metrica 02A8 B4 01 00 1055 cjne a,#0x01,00130$ 02AB 1056 00130$: 02AB E4 1057 clr a 02AC 33 1058 rlc a 02AD FB 1059 mov r3,a 02AE 60 04 1060 jz 00113$ 02B0 AB*26 1061 mov r3,_consumption100miles 02B2 80 02 1062 sjmp 00114$ 02B4 1063 00113$: 02B4 AB*25 1064 mov r3,_consumption100km 02B6 1065 00114$: 02B6 8B*29 1066 mov _consumption,r3 1067 ; SRC/main.c:163: sub_info = (mode == PREDICTION) ? value * consumption : value; 02B8 74 01 1068 mov a,#0x01 02BA B5*02 08 1069 cjne a,_mode,00115$ 02BD 8A F0 1070 mov b,r2 02BF E5*29 1071 mov a,_consumption 02C1 A4 1072 mul ab 02C2 FB 1073 mov r3,a 02C3 80 02 1074 sjmp 00116$ 02C5 1075 00115$: 02C5 8A 03 1076 mov ar3,r2 02C7 1077 00116$: 02C7 8B*28 1078 mov _sub_info,r3 1079 ; SRC/main.c:165: lcd_controller(value, sub_info); 02C9 C0 02 1080 push ar2 02CB C0*28 1081 push _sub_info 02CD 8A 82 1082 mov dpl,r2 02CF 12s01rF5 1083 lcall _lcd_controller 02D2 15 81 1084 dec sp 02D4 D0 02 1085 pop ar2 1086 ; SRC/main.c:167: if (value < fuel_threshold) 02D6 C3 1087 clr c 02D7 EA 1088 mov a,r2 02D8 95*24 1089 subb a,_fuel_threshold 02DA 50 0F 1090 jnc 00105$ 1091 ; SRC/main.c:169: make_sound(); 02DC C0 02 1092 push ar2 02DE 12s00r0D 1093 lcall _make_sound 1094 ; SRC/main.c:170: write_led(0xff); 02E1 75 82 FF 1095 mov dpl,#0xFF 02E4 12s00r00 1096 lcall _write_led 02E7 D0 02 1097 pop ar2 02E9 80 0A 1098 sjmp 00106$ 02EB 1099 00105$: 1100 ; SRC/main.c:174: write_led(0x00); 02EB 75 82 00 1101 mov dpl,#0x00 02EE C0 02 1102 push ar2 02F0 12s00r00 1103 lcall _write_led 02F3 D0 02 1104 pop ar2 02F5 1105 00106$: 1106 ; SRC/main.c:176: old_value = value; 02F5 8A*2D 1107 mov _old_value,r2 1108 ; SRC/main.c:177: old_dip = dip; 02F7 85*2A*2B 1109 mov _old_dip,_dip 02FA 22 1110 ret 1111 ;------------------------------------------------------------ 1112 ;Allocation info for local variables in function 'main' 1113 ;------------------------------------------------------------ 1114 ;value Allocated to registers 1115 ;------------------------------------------------------------ 1116 ; SRC/main.c:180: void main() 1117 ; ----------------------------------------- 1118 ; function main 1119 ; ----------------------------------------- 02FB 1120 _main: 1121 ; SRC/main.c:183: init(S9600); 02FB 75 82 FD 1122 mov dpl,#0xFD 02FE 12s00rCB 1123 lcall _init 1124 ; SRC/main.c:184: clear_lcd(); 0301 12s00r00 1125 lcall _clear_lcd 1126 ; SRC/main.c:186: while(1) { 0304 1127 00102$: 1128 ; SRC/main.c:187: value = data_controller(); 0304 12s02r70 1129 lcall _data_controller 1130 ; SRC/main.c:188: visualise(value); 0307 12s02r73 1131 lcall _visualise 030A 80 F8 1132 sjmp 00102$ 1133 .area CSEG (CODE) 1134 .area CONST (CODE) 0000 1135 __str_0: 0000 72 65 61 64 79 1136 .ascii "ready" 0005 0A 1137 .db 0x0A 0006 00 1138 .db 0x00 1139 .area XINIT (CODE) 1140 .area CABS (ABS,CODE)