1 ;-------------------------------------------------------- 2 ; File Created by SDCC : free open source ANSI-C Compiler 3 ; Version 4.0.0 #11528 (MINGW64) 4 ;-------------------------------------------------------- 5 .module lcd 6 .optsdcc -mmcs51 --model-small 7 8 ;-------------------------------------------------------- 9 ; Public variables in this module 10 ;-------------------------------------------------------- 11 .globl _Custom_Char5x8 12 .globl _lcdShowBarGraphValue 13 .globl _lcdBarGraphInit 14 .globl _lcdCustomChars 15 .globl _lcdNewChars 16 .globl _lcdPrint 17 .globl _lcdSetCursor20X4 18 .globl _lcdInit 19 .globl _lcdSendData 20 .globl _lcdSendCommand 21 .globl _wait250uS 22 .globl _wait_mS 23 .globl _delay2600nanoSecond 24 .globl _CY 25 .globl _AC 26 .globl _F0 27 .globl _RS1 28 .globl _RS0 29 .globl _OV 30 .globl _F1 31 .globl _P 32 .globl _PS 33 .globl _PT1 34 .globl _PX1 35 .globl _PT0 36 .globl _PX0 37 .globl _RD 38 .globl _WR 39 .globl _T1 40 .globl _T0 41 .globl _INT1 42 .globl _INT0 43 .globl _TXD 44 .globl _RXD 45 .globl _P3_7 46 .globl _P3_6 47 .globl _P3_5 48 .globl _P3_4 49 .globl _P3_3 50 .globl _P3_2 51 .globl _P3_1 52 .globl _P3_0 53 .globl _EA 54 .globl _ES 55 .globl _ET1 56 .globl _EX1 57 .globl _ET0 58 .globl _EX0 59 .globl _P2_7 60 .globl _P2_6 61 .globl _P2_5 62 .globl _P2_4 63 .globl _P2_3 64 .globl _P2_2 65 .globl _P2_1 66 .globl _P2_0 67 .globl _SM0 68 .globl _SM1 69 .globl _SM2 70 .globl _REN 71 .globl _TB8 72 .globl _RB8 73 .globl _TI 74 .globl _RI 75 .globl _P1_7 76 .globl _P1_6 77 .globl _P1_5 78 .globl _P1_4 79 .globl _P1_3 80 .globl _P1_2 81 .globl _P1_1 82 .globl _P1_0 83 .globl _TF1 84 .globl _TR1 85 .globl _TF0 86 .globl _TR0 87 .globl _IE1 88 .globl _IT1 89 .globl _IE0 90 .globl _IT0 91 .globl _P0_7 92 .globl _P0_6 93 .globl _P0_5 94 .globl _P0_4 95 .globl _P0_3 96 .globl _P0_2 97 .globl _P0_1 98 .globl _P0_0 99 .globl _B 100 .globl _ACC 101 .globl _PSW 102 .globl _IP 103 .globl _P3 104 .globl _IE 105 .globl _P2 106 .globl _SBUF 107 .globl _SCON 108 .globl _P1 109 .globl _TH1 110 .globl _TH0 111 .globl _TL1 112 .globl _TL0 113 .globl _TMOD 114 .globl _TCON 115 .globl _PCON 116 .globl _DPH 117 .globl _DPL 118 .globl _SP 119 .globl _P0 120 .globl _lcdSetCursor20X4_PARM_2 121 ;-------------------------------------------------------- 122 ; special function registers 123 ;-------------------------------------------------------- 124 .area RSEG (ABS,DATA) 000000 125 .org 0x0000 000080 126 _P0 = 0x0080 000081 127 _SP = 0x0081 000082 128 _DPL = 0x0082 000083 129 _DPH = 0x0083 000087 130 _PCON = 0x0087 000088 131 _TCON = 0x0088 000089 132 _TMOD = 0x0089 00008A 133 _TL0 = 0x008a 00008B 134 _TL1 = 0x008b 00008C 135 _TH0 = 0x008c 00008D 136 _TH1 = 0x008d 000090 137 _P1 = 0x0090 000098 138 _SCON = 0x0098 000099 139 _SBUF = 0x0099 0000A0 140 _P2 = 0x00a0 0000A8 141 _IE = 0x00a8 0000B0 142 _P3 = 0x00b0 0000B8 143 _IP = 0x00b8 0000D0 144 _PSW = 0x00d0 0000E0 145 _ACC = 0x00e0 0000F0 146 _B = 0x00f0 147 ;-------------------------------------------------------- 148 ; special function bits 149 ;-------------------------------------------------------- 150 .area RSEG (ABS,DATA) 000000 151 .org 0x0000 000080 152 _P0_0 = 0x0080 000081 153 _P0_1 = 0x0081 000082 154 _P0_2 = 0x0082 000083 155 _P0_3 = 0x0083 000084 156 _P0_4 = 0x0084 000085 157 _P0_5 = 0x0085 000086 158 _P0_6 = 0x0086 000087 159 _P0_7 = 0x0087 000088 160 _IT0 = 0x0088 000089 161 _IE0 = 0x0089 00008A 162 _IT1 = 0x008a 00008B 163 _IE1 = 0x008b 00008C 164 _TR0 = 0x008c 00008D 165 _TF0 = 0x008d 00008E 166 _TR1 = 0x008e 00008F 167 _TF1 = 0x008f 000090 168 _P1_0 = 0x0090 000091 169 _P1_1 = 0x0091 000092 170 _P1_2 = 0x0092 000093 171 _P1_3 = 0x0093 000094 172 _P1_4 = 0x0094 000095 173 _P1_5 = 0x0095 000096 174 _P1_6 = 0x0096 000097 175 _P1_7 = 0x0097 000098 176 _RI = 0x0098 000099 177 _TI = 0x0099 00009A 178 _RB8 = 0x009a 00009B 179 _TB8 = 0x009b 00009C 180 _REN = 0x009c 00009D 181 _SM2 = 0x009d 00009E 182 _SM1 = 0x009e 00009F 183 _SM0 = 0x009f 0000A0 184 _P2_0 = 0x00a0 0000A1 185 _P2_1 = 0x00a1 0000A2 186 _P2_2 = 0x00a2 0000A3 187 _P2_3 = 0x00a3 0000A4 188 _P2_4 = 0x00a4 0000A5 189 _P2_5 = 0x00a5 0000A6 190 _P2_6 = 0x00a6 0000A7 191 _P2_7 = 0x00a7 0000A8 192 _EX0 = 0x00a8 0000A9 193 _ET0 = 0x00a9 0000AA 194 _EX1 = 0x00aa 0000AB 195 _ET1 = 0x00ab 0000AC 196 _ES = 0x00ac 0000AF 197 _EA = 0x00af 0000B0 198 _P3_0 = 0x00b0 0000B1 199 _P3_1 = 0x00b1 0000B2 200 _P3_2 = 0x00b2 0000B3 201 _P3_3 = 0x00b3 0000B4 202 _P3_4 = 0x00b4 0000B5 203 _P3_5 = 0x00b5 0000B6 204 _P3_6 = 0x00b6 0000B7 205 _P3_7 = 0x00b7 0000B0 206 _RXD = 0x00b0 0000B1 207 _TXD = 0x00b1 0000B2 208 _INT0 = 0x00b2 0000B3 209 _INT1 = 0x00b3 0000B4 210 _T0 = 0x00b4 0000B5 211 _T1 = 0x00b5 0000B6 212 _WR = 0x00b6 0000B7 213 _RD = 0x00b7 0000B8 214 _PX0 = 0x00b8 0000B9 215 _PT0 = 0x00b9 0000BA 216 _PX1 = 0x00ba 0000BB 217 _PT1 = 0x00bb 0000BC 218 _PS = 0x00bc 0000D0 219 _P = 0x00d0 0000D1 220 _F1 = 0x00d1 0000D2 221 _OV = 0x00d2 0000D3 222 _RS0 = 0x00d3 0000D4 223 _RS1 = 0x00d4 0000D5 224 _F0 = 0x00d5 0000D6 225 _AC = 0x00d6 0000D7 226 _CY = 0x00d7 227 ;-------------------------------------------------------- 228 ; overlayable register banks 229 ;-------------------------------------------------------- 230 .area REG_BANK_0 (REL,OVR,DATA) 000000 231 .ds 8 232 ;-------------------------------------------------------- 233 ; internal ram data 234 ;-------------------------------------------------------- 235 .area DSEG (DATA) 000000 236 _lcdSetCursor20X4_PARM_2: 000000 237 .ds 2 000002 238 _lcdSetCursor20X4_ddram_y_65536_15: 000002 239 .ds 4 000006 240 _lcdBarGraphInit_mySet_65536_25: 000006 241 .ds 48 242 ;-------------------------------------------------------- 243 ; overlayable items in internal ram 244 ;-------------------------------------------------------- 245 .area OSEG (OVR,DATA) 246 ;-------------------------------------------------------- 247 ; indirectly addressable internal ram data 248 ;-------------------------------------------------------- 249 .area ISEG (DATA) 250 ;-------------------------------------------------------- 251 ; absolute internal ram data 252 ;-------------------------------------------------------- 253 .area IABS (ABS,DATA) 254 .area IABS (ABS,DATA) 255 ;-------------------------------------------------------- 256 ; bit data 257 ;-------------------------------------------------------- 258 .area BSEG (BIT) 259 ;-------------------------------------------------------- 260 ; paged external ram data 261 ;-------------------------------------------------------- 262 .area PSEG (PAG,XDATA) 263 ;-------------------------------------------------------- 264 ; external ram data 265 ;-------------------------------------------------------- 266 .area XSEG (XDATA) 267 ;-------------------------------------------------------- 268 ; absolute external ram data 269 ;-------------------------------------------------------- 270 .area XABS (ABS,XDATA) 271 ;-------------------------------------------------------- 272 ; external initialized ram data 273 ;-------------------------------------------------------- 274 .area XISEG (XDATA) 275 .area HOME (CODE) 276 .area GSINIT0 (CODE) 277 .area GSINIT1 (CODE) 278 .area GSINIT2 (CODE) 279 .area GSINIT3 (CODE) 280 .area GSINIT4 (CODE) 281 .area GSINIT5 (CODE) 282 .area GSINIT (CODE) 283 .area GSFINAL (CODE) 284 .area CSEG (CODE) 285 ;-------------------------------------------------------- 286 ; global & static initialisations 287 ;-------------------------------------------------------- 288 .area HOME (CODE) 289 .area GSINIT (CODE) 290 .area GSFINAL (CODE) 291 .area GSINIT (CODE) 292 ;-------------------------------------------------------- 293 ; Home 294 ;-------------------------------------------------------- 295 .area HOME (CODE) 296 .area HOME (CODE) 297 ;-------------------------------------------------------- 298 ; code 299 ;-------------------------------------------------------- 300 .area CSEG (CODE) 301 ;------------------------------------------------------------ 302 ;Allocation info for local variables in function 'delay2600nanoSecond' 303 ;------------------------------------------------------------ 304 ; lcd.c:9: void delay2600nanoSecond() {return;} 305 ; ----------------------------------------- 306 ; function delay2600nanoSecond 307 ; ----------------------------------------- 000000 308 _delay2600nanoSecond: 000007 309 ar7 = 0x07 000006 310 ar6 = 0x06 000005 311 ar5 = 0x05 000004 312 ar4 = 0x04 000003 313 ar3 = 0x03 000002 314 ar2 = 0x02 000001 315 ar1 = 0x01 000000 316 ar0 = 0x00 000000 22 [24] 317 ret 318 ;------------------------------------------------------------ 319 ;Allocation info for local variables in function 'wait_mS' 320 ;------------------------------------------------------------ 321 ;time Allocated to registers r6 r7 322 ;i Allocated to registers r4 r5 323 ;a Allocated to registers r2 r3 324 ;------------------------------------------------------------ 325 ; lcd.c:11: void wait_mS(int time) {for (int i = 0; i < time; i++) {for (int a = 0; a < 165; a++);}} //1.0101 mS with 165 326 ; ----------------------------------------- 327 ; function wait_mS 328 ; ----------------------------------------- 000001 329 _wait_mS: 000001 AE 82 [24] 330 mov r6,dpl 000003 AF 83 [24] 331 mov r7,dph 000005 7C 00 [12] 332 mov r4,#0x00 000007 7D 00 [12] 333 mov r5,#0x00 000009 334 00107$: 000009 C3 [12] 335 clr c 00000A EC [12] 336 mov a,r4 00000B 9E [12] 337 subb a,r6 00000C ED [12] 338 mov a,r5 00000D 64 80 [12] 339 xrl a,#0x80 00000F 8F F0 [24] 340 mov b,r7 000011 63 F0 80 [24] 341 xrl b,#0x80 000014 95 F0 [12] 342 subb a,b 000016 50 1D [24] 343 jnc 00109$ 000018 7A 00 [12] 344 mov r2,#0x00 00001A 7B 00 [12] 345 mov r3,#0x00 00001C 346 00104$: 00001C C3 [12] 347 clr c 00001D EA [12] 348 mov a,r2 00001E 94 A5 [12] 349 subb a,#0xa5 000020 EB [12] 350 mov a,r3 000021 64 80 [12] 351 xrl a,#0x80 000023 94 80 [12] 352 subb a,#0x80 000025 50 07 [24] 353 jnc 00108$ 000027 0A [12] 354 inc r2 000028 BA 00 F1 [24] 355 cjne r2,#0x00,00104$ 00002B 0B [12] 356 inc r3 00002C 80 EE [24] 357 sjmp 00104$ 00002E 358 00108$: 00002E 0C [12] 359 inc r4 00002F BC 00 D7 [24] 360 cjne r4,#0x00,00107$ 000032 0D [12] 361 inc r5 000033 80 D4 [24] 362 sjmp 00107$ 000035 363 00109$: 000035 22 [24] 364 ret 365 ;------------------------------------------------------------ 366 ;Allocation info for local variables in function 'wait250uS' 367 ;------------------------------------------------------------ 368 ;i Allocated to registers r6 r7 369 ;------------------------------------------------------------ 370 ; lcd.c:13: void wait250uS() {for (int i = 0; i < 20; i++) delay2600nanoSecond();} 371 ; ----------------------------------------- 372 ; function wait250uS 373 ; ----------------------------------------- 000036 374 _wait250uS: 000036 7E 00 [12] 375 mov r6,#0x00 000038 7F 00 [12] 376 mov r7,#0x00 00003A 377 00103$: 00003A C3 [12] 378 clr c 00003B EE [12] 379 mov a,r6 00003C 94 14 [12] 380 subb a,#0x14 00003E EF [12] 381 mov a,r7 00003F 64 80 [12] 382 xrl a,#0x80 000041 94 80 [12] 383 subb a,#0x80 000043 50 12 [24] 384 jnc 00105$ 000045 C0 07 [24] 385 push ar7 000047 C0 06 [24] 386 push ar6 000049 12r00r00 [24] 387 lcall _delay2600nanoSecond 00004C D0 06 [24] 388 pop ar6 00004E D0 07 [24] 389 pop ar7 000050 0E [12] 390 inc r6 000051 BE 00 E6 [24] 391 cjne r6,#0x00,00103$ 000054 0F [12] 392 inc r7 000055 80 E3 [24] 393 sjmp 00103$ 000057 394 00105$: 000057 22 [24] 395 ret 396 ;------------------------------------------------------------ 397 ;Allocation info for local variables in function 'lcdSendCommand' 398 ;------------------------------------------------------------ 399 ;command Allocated to registers r7 400 ;------------------------------------------------------------ 401 ; lcd.c:31: void lcdSendCommand(unsigned char command) {//Delay mus 402 ; ----------------------------------------- 403 ; function lcdSendCommand 404 ; ----------------------------------------- 000058 405 _lcdSendCommand: 000058 AF 82 [24] 406 mov r7,dpl 407 ; lcd.c:32: E = 0; 408 ; assignBit 00005A C2 B2 [12] 409 clr _P3_2 410 ; lcd.c:33: RW = 0; 411 ; assignBit 00005C C2 B3 [12] 412 clr _P3_3 413 ; lcd.c:34: RS = 0; 414 ; assignBit 00005E C2 B4 [12] 415 clr _P3_4 416 ; lcd.c:35: D = command; 000060 8F 90 [24] 417 mov _P1,r7 418 ; lcd.c:36: E = 1; 419 ; assignBit 000062 D2 B2 [12] 420 setb _P3_2 421 ; lcd.c:37: E = 0; 422 ; assignBit 000064 C2 B2 [12] 423 clr _P3_2 424 ; lcd.c:38: wait250uS();} 000066 02r00r36 [24] 425 ljmp _wait250uS 426 ;------------------------------------------------------------ 427 ;Allocation info for local variables in function 'lcdSendData' 428 ;------------------------------------------------------------ 429 ;data Allocated to registers r7 430 ;------------------------------------------------------------ 431 ; lcd.c:40: void lcdSendData(unsigned char data) { 432 ; ----------------------------------------- 433 ; function lcdSendData 434 ; ----------------------------------------- 000069 435 _lcdSendData: 000069 AF 82 [24] 436 mov r7,dpl 437 ; lcd.c:41: E = 0; 438 ; assignBit 00006B C2 B2 [12] 439 clr _P3_2 440 ; lcd.c:42: RW = 0; 441 ; assignBit 00006D C2 B3 [12] 442 clr _P3_3 443 ; lcd.c:43: RS = 1; 444 ; assignBit 00006F D2 B4 [12] 445 setb _P3_4 446 ; lcd.c:44: D = data; 000071 8F 90 [24] 447 mov _P1,r7 448 ; lcd.c:45: E = 1; 449 ; assignBit 000073 D2 B2 [12] 450 setb _P3_2 451 ; lcd.c:46: E = 0; 452 ; assignBit 000075 C2 B2 [12] 453 clr _P3_2 454 ; lcd.c:47: wait250uS();} 000077 02r00r36 [24] 455 ljmp _wait250uS 456 ;------------------------------------------------------------ 457 ;Allocation info for local variables in function 'lcdInit' 458 ;------------------------------------------------------------ 459 ; lcd.c:48: void lcdInit() { //As reported in http://www.dinceraydin.com/lcd/initalization.htm 460 ; ----------------------------------------- 461 ; function lcdInit 462 ; ----------------------------------------- 00007A 463 _lcdInit: 464 ; lcd.c:49: wait_mS(20); //5V power 00007A 90 00 14 [24] 465 mov dptr,#0x0014 00007D 12r00r01 [24] 466 lcall _wait_mS 467 ; lcd.c:50: lcdSendCommand(0x38); wait_mS(5);//8bit, 2 lines, small font 000080 75 82 38 [24] 468 mov dpl,#0x38 000083 12r00r58 [24] 469 lcall _lcdSendCommand 000086 90 00 05 [24] 470 mov dptr,#0x0005 000089 12r00r01 [24] 471 lcall _wait_mS 472 ; lcd.c:51: lcdSendCommand(0x38); wait250uS();;//8bit, 2 lines, small font 00008C 75 82 38 [24] 473 mov dpl,#0x38 00008F 12r00r58 [24] 474 lcall _lcdSendCommand 000092 12r00r36 [24] 475 lcall _wait250uS 476 ; lcd.c:52: lcdSendCommand(0x38); wait250uS();//8bit, 2 lines, small font 000095 75 82 38 [24] 477 mov dpl,#0x38 000098 12r00r58 [24] 478 lcall _lcdSendCommand 00009B 12r00r36 [24] 479 lcall _wait250uS 480 ; lcd.c:53: lcdSendCommand(0x0C); wait250uS();//Display all on, cursor off, blink off 00009E 75 82 0C [24] 481 mov dpl,#0x0c 0000A1 12r00r58 [24] 482 lcall _lcdSendCommand 0000A4 12r00r36 [24] 483 lcall _wait250uS 484 ; lcd.c:54: lcdSendCommand(0x06); wait250uS();//Display all on, cursor off, blink off 0000A7 75 82 06 [24] 485 mov dpl,#0x06 0000AA 12r00r58 [24] 486 lcall _lcdSendCommand 0000AD 12r00r36 [24] 487 lcall _wait250uS 488 ; lcd.c:55: lcdSendCommand(0x02); wait_mS(2);//Set cursor to the upper left corner 0000B0 75 82 02 [24] 489 mov dpl,#0x02 0000B3 12r00r58 [24] 490 lcall _lcdSendCommand 0000B6 90 00 02 [24] 491 mov dptr,#0x0002 0000B9 12r00r01 [24] 492 lcall _wait_mS 493 ; lcd.c:56: lcdSendCommand(0x01); wait_mS(2);}//Clear the whole LCD } 0000BC 75 82 01 [24] 494 mov dpl,#0x01 0000BF 12r00r58 [24] 495 lcall _lcdSendCommand 0000C2 90 00 02 [24] 496 mov dptr,#0x0002 0000C5 02r00r01 [24] 497 ljmp _wait_mS 498 ;------------------------------------------------------------ 499 ;Allocation info for local variables in function 'lcdSetCursor20X4' 500 ;------------------------------------------------------------ 501 ;y Allocated with name '_lcdSetCursor20X4_PARM_2' 502 ;x Allocated to registers r6 r7 503 ;ddram Allocated to registers 504 ;ddram_y Allocated with name '_lcdSetCursor20X4_ddram_y_65536_15' 505 ;------------------------------------------------------------ 506 ; lcd.c:61: void lcdSetCursor20X4(unsigned int x, unsigned int y) { 507 ; ----------------------------------------- 508 ; function lcdSetCursor20X4 509 ; ----------------------------------------- 0000C8 510 _lcdSetCursor20X4: 0000C8 AE 82 [24] 511 mov r6,dpl 0000CA AF 83 [24] 512 mov r7,dph 513 ; lcd.c:63: unsigned char ddram_y[4] = {0,64,20,84}; //row are interlaced in a 20X4. 0000CC 75*02 00 [24] 514 mov _lcdSetCursor20X4_ddram_y_65536_15,#0x00 0000CF 75*03 40 [24] 515 mov (_lcdSetCursor20X4_ddram_y_65536_15 + 0x0001),#0x40 0000D2 75*04 14 [24] 516 mov (_lcdSetCursor20X4_ddram_y_65536_15 + 0x0002),#0x14 0000D5 75*05 54 [24] 517 mov (_lcdSetCursor20X4_ddram_y_65536_15 + 0x0003),#0x54 518 ; lcd.c:64: x = x%20; y = y%4; //Data conditioning 0000D8 75*00 14 [24] 519 mov __moduint_PARM_2,#0x14 0000DB 75*01 00 [24] 520 mov (__moduint_PARM_2 + 1),#0x00 0000DE 8E 82 [24] 521 mov dpl,r6 0000E0 8F 83 [24] 522 mov dph,r7 0000E2 12r00r00 [24] 523 lcall __moduint 0000E5 AE 82 [24] 524 mov r6,dpl 0000E7 53*00 03 [24] 525 anl _lcdSetCursor20X4_PARM_2,#0x03 0000EA 75*01 00 [24] 526 mov (_lcdSetCursor20X4_PARM_2 + 1),#0x00 527 ; lcd.c:65: ddram = ddram_y[y]+x; 0000ED E5*00 [12] 528 mov a,_lcdSetCursor20X4_PARM_2 0000EF 24r02 [12] 529 add a,#_lcdSetCursor20X4_ddram_y_65536_15 0000F1 F9 [12] 530 mov r1,a 0000F2 87 05 [24] 531 mov ar5,@r1 0000F4 EE [12] 532 mov a,r6 0000F5 2D [12] 533 add a,r5 534 ; lcd.c:66: lcdSendCommand(0x80|ddram);} 0000F6 44 80 [12] 535 orl a,#0x80 0000F8 F5 82 [12] 536 mov dpl,a 0000FA 02r00r58 [24] 537 ljmp _lcdSendCommand 538 ;------------------------------------------------------------ 539 ;Allocation info for local variables in function 'lcdPrint' 540 ;------------------------------------------------------------ 541 ;sz Allocated to registers 542 ;------------------------------------------------------------ 543 ; lcd.c:68: void lcdPrint(char *sz) { 544 ; ----------------------------------------- 545 ; function lcdPrint 546 ; ----------------------------------------- 0000FD 547 _lcdPrint: 0000FD AD 82 [24] 548 mov r5,dpl 0000FF AE 83 [24] 549 mov r6,dph 000101 AF F0 [24] 550 mov r7,b 551 ; lcd.c:69: while(*sz) lcdSendData(*sz++); 000103 552 00101$: 000103 8D 82 [24] 553 mov dpl,r5 000105 8E 83 [24] 554 mov dph,r6 000107 8F F0 [24] 555 mov b,r7 000109 12r00r00 [24] 556 lcall __gptrget 00010C FC [12] 557 mov r4,a 00010D 60 18 [24] 558 jz 00104$ 00010F 8C 82 [24] 559 mov dpl,r4 000111 0D [12] 560 inc r5 000112 BD 00 01 [24] 561 cjne r5,#0x00,00116$ 000115 0E [12] 562 inc r6 000116 563 00116$: 000116 C0 07 [24] 564 push ar7 000118 C0 06 [24] 565 push ar6 00011A C0 05 [24] 566 push ar5 00011C 12r00r69 [24] 567 lcall _lcdSendData 00011F D0 05 [24] 568 pop ar5 000121 D0 06 [24] 569 pop ar6 000123 D0 07 [24] 570 pop ar7 000125 80 DC [24] 571 sjmp 00101$ 000127 572 00104$: 573 ; lcd.c:70: } 000127 22 [24] 574 ret 575 ;------------------------------------------------------------ 576 ;Allocation info for local variables in function 'lcdNewChars' 577 ;------------------------------------------------------------ 578 ;a Allocated to registers r7 579 ;------------------------------------------------------------ 580 ; lcd.c:72: void lcdNewChars() { 581 ; ----------------------------------------- 582 ; function lcdNewChars 583 ; ----------------------------------------- 000128 584 _lcdNewChars: 585 ; lcd.c:73: lcdSendCommand(0x40);//CGRAM data input 000128 75 82 40 [24] 586 mov dpl,#0x40 00012B 12r00r58 [24] 587 lcall _lcdSendCommand 588 ; lcd.c:74: for (unsigned char a = 0; a < 64; a++) { 00012E 7F 00 [12] 589 mov r7,#0x00 000130 590 00103$: 000130 BF 40 00 [24] 591 cjne r7,#0x40,00116$ 000133 592 00116$: 000133 50 1D [24] 593 jnc 00105$ 594 ; lcd.c:75: lcdSendData(Custom_Char5x8[a]); 000135 EF [12] 595 mov a,r7 000136 75 F0 02 [24] 596 mov b,#0x02 000139 A4 [48] 597 mul ab 00013A 24r00 [12] 598 add a,#_Custom_Char5x8 00013C F5 82 [12] 599 mov dpl,a 00013E 74s00 [12] 600 mov a,#(_Custom_Char5x8 >> 8) 000140 35 F0 [12] 601 addc a,b 000142 F5 83 [12] 602 mov dph,a 000144 E4 [12] 603 clr a 000145 93 [24] 604 movc a,@a+dptr 000146 F5 82 [12] 605 mov dpl,a 000148 C0 07 [24] 606 push ar7 00014A 12r00r69 [24] 607 lcall _lcdSendData 00014D D0 07 [24] 608 pop ar7 609 ; lcd.c:74: for (unsigned char a = 0; a < 64; a++) { 00014F 0F [12] 610 inc r7 000150 80 DE [24] 611 sjmp 00103$ 000152 612 00105$: 613 ; lcd.c:77: } 000152 22 [24] 614 ret 615 ;------------------------------------------------------------ 616 ;Allocation info for local variables in function 'lcdCustomChars' 617 ;------------------------------------------------------------ 618 ;custom Allocated to registers r5 r6 r7 619 ;a Allocated to registers r4 620 ;------------------------------------------------------------ 621 ; lcd.c:79: void lcdCustomChars(char custom[]) { 622 ; ----------------------------------------- 623 ; function lcdCustomChars 624 ; ----------------------------------------- 000153 625 _lcdCustomChars: 000153 AD 82 [24] 626 mov r5,dpl 000155 AE 83 [24] 627 mov r6,dph 000157 AF F0 [24] 628 mov r7,b 629 ; lcd.c:80: lcdSendCommand(0x40);//CGRAM data input 000159 75 82 40 [24] 630 mov dpl,#0x40 00015C C0 07 [24] 631 push ar7 00015E C0 06 [24] 632 push ar6 000160 C0 05 [24] 633 push ar5 000162 12r00r58 [24] 634 lcall _lcdSendCommand 000165 D0 05 [24] 635 pop ar5 000167 D0 06 [24] 636 pop ar6 000169 D0 07 [24] 637 pop ar7 638 ; lcd.c:81: for (unsigned char a = 0; a < 64; a++) { 00016B 7C 00 [12] 639 mov r4,#0x00 00016D 640 00103$: 00016D BC 40 00 [24] 641 cjne r4,#0x40,00116$ 000170 642 00116$: 000170 50 29 [24] 643 jnc 00105$ 644 ; lcd.c:82: lcdSendData(custom[a]);} 000172 EC [12] 645 mov a,r4 000173 2D [12] 646 add a,r5 000174 F9 [12] 647 mov r1,a 000175 E4 [12] 648 clr a 000176 3E [12] 649 addc a,r6 000177 FA [12] 650 mov r2,a 000178 8F 03 [24] 651 mov ar3,r7 00017A 89 82 [24] 652 mov dpl,r1 00017C 8A 83 [24] 653 mov dph,r2 00017E 8B F0 [24] 654 mov b,r3 000180 12r00r00 [24] 655 lcall __gptrget 000183 F5 82 [12] 656 mov dpl,a 000185 C0 07 [24] 657 push ar7 000187 C0 06 [24] 658 push ar6 000189 C0 05 [24] 659 push ar5 00018B C0 04 [24] 660 push ar4 00018D 12r00r69 [24] 661 lcall _lcdSendData 000190 D0 04 [24] 662 pop ar4 000192 D0 05 [24] 663 pop ar5 000194 D0 06 [24] 664 pop ar6 000196 D0 07 [24] 665 pop ar7 666 ; lcd.c:81: for (unsigned char a = 0; a < 64; a++) { 000198 0C [12] 667 inc r4 000199 80 D2 [24] 668 sjmp 00103$ 00019B 669 00105$: 670 ; lcd.c:83: } 00019B 22 [24] 671 ret 672 ;------------------------------------------------------------ 673 ;Allocation info for local variables in function 'lcdBarGraphInit' 674 ;------------------------------------------------------------ 675 ;mySet Allocated with name '_lcdBarGraphInit_mySet_65536_25' 676 ;a Allocated to registers r7 677 ;------------------------------------------------------------ 678 ; lcd.c:87: void lcdBarGraphInit() { 679 ; ----------------------------------------- 680 ; function lcdBarGraphInit 681 ; ----------------------------------------- 00019C 682 _lcdBarGraphInit: 683 ; lcd.c:89: const unsigned char mySet[] = { 00019C 75*06 00 [24] 684 mov _lcdBarGraphInit_mySet_65536_25,#0x00 00019F 75*07 00 [24] 685 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0001),#0x00 0001A2 75*08 00 [24] 686 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0002),#0x00 0001A5 75*09 00 [24] 687 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0003),#0x00 0001A8 75*0A 00 [24] 688 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0004),#0x00 0001AB 75*0B 00 [24] 689 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0005),#0x00 0001AE 75*0C 00 [24] 690 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0006),#0x00 0001B1 75*0D 00 [24] 691 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0007),#0x00 0001B4 75*0E 10 [24] 692 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0008),#0x10 0001B7 75*0F 10 [24] 693 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0009),#0x10 0001BA 75*10 10 [24] 694 mov (_lcdBarGraphInit_mySet_65536_25 + 0x000a),#0x10 0001BD 75*11 10 [24] 695 mov (_lcdBarGraphInit_mySet_65536_25 + 0x000b),#0x10 0001C0 75*12 10 [24] 696 mov (_lcdBarGraphInit_mySet_65536_25 + 0x000c),#0x10 0001C3 75*13 10 [24] 697 mov (_lcdBarGraphInit_mySet_65536_25 + 0x000d),#0x10 0001C6 75*14 10 [24] 698 mov (_lcdBarGraphInit_mySet_65536_25 + 0x000e),#0x10 0001C9 75*15 10 [24] 699 mov (_lcdBarGraphInit_mySet_65536_25 + 0x000f),#0x10 0001CC 75*16 18 [24] 700 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0010),#0x18 0001CF 75*17 18 [24] 701 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0011),#0x18 0001D2 75*18 18 [24] 702 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0012),#0x18 0001D5 75*19 18 [24] 703 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0013),#0x18 0001D8 75*1A 18 [24] 704 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0014),#0x18 0001DB 75*1B 18 [24] 705 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0015),#0x18 0001DE 75*1C 18 [24] 706 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0016),#0x18 0001E1 75*1D 18 [24] 707 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0017),#0x18 0001E4 75*1E 1C [24] 708 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0018),#0x1c 0001E7 75*1F 1C [24] 709 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0019),#0x1c 0001EA 75*20 1C [24] 710 mov (_lcdBarGraphInit_mySet_65536_25 + 0x001a),#0x1c 0001ED 75*21 1C [24] 711 mov (_lcdBarGraphInit_mySet_65536_25 + 0x001b),#0x1c 0001F0 75*22 1C [24] 712 mov (_lcdBarGraphInit_mySet_65536_25 + 0x001c),#0x1c 0001F3 75*23 1C [24] 713 mov (_lcdBarGraphInit_mySet_65536_25 + 0x001d),#0x1c 0001F6 75*24 1C [24] 714 mov (_lcdBarGraphInit_mySet_65536_25 + 0x001e),#0x1c 0001F9 75*25 1C [24] 715 mov (_lcdBarGraphInit_mySet_65536_25 + 0x001f),#0x1c 0001FC 75*26 1E [24] 716 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0020),#0x1e 0001FF 75*27 1E [24] 717 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0021),#0x1e 000202 75*28 1E [24] 718 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0022),#0x1e 000205 75*29 1E [24] 719 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0023),#0x1e 000208 75*2A 1E [24] 720 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0024),#0x1e 00020B 75*2B 1E [24] 721 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0025),#0x1e 00020E 75*2C 1E [24] 722 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0026),#0x1e 000211 75*2D 1E [24] 723 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0027),#0x1e 000214 75*2E 1F [24] 724 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0028),#0x1f 000217 75*2F 1F [24] 725 mov (_lcdBarGraphInit_mySet_65536_25 + 0x0029),#0x1f 00021A 75*30 1F [24] 726 mov (_lcdBarGraphInit_mySet_65536_25 + 0x002a),#0x1f 00021D 75*31 1F [24] 727 mov (_lcdBarGraphInit_mySet_65536_25 + 0x002b),#0x1f 000220 75*32 1F [24] 728 mov (_lcdBarGraphInit_mySet_65536_25 + 0x002c),#0x1f 000223 75*33 1F [24] 729 mov (_lcdBarGraphInit_mySet_65536_25 + 0x002d),#0x1f 000226 75*34 1F [24] 730 mov (_lcdBarGraphInit_mySet_65536_25 + 0x002e),#0x1f 000229 75*35 1F [24] 731 mov (_lcdBarGraphInit_mySet_65536_25 + 0x002f),#0x1f 732 ; lcd.c:97: lcdSendCommand(0x40); 00022C 75 82 40 [24] 733 mov dpl,#0x40 00022F 12r00r58 [24] 734 lcall _lcdSendCommand 735 ; lcd.c:98: for (unsigned char a = 0; a < 48; a++) {lcdSendData(mySet[a]);} 000232 7F 00 [12] 736 mov r7,#0x00 000234 737 00103$: 000234 BF 30 00 [24] 738 cjne r7,#0x30,00116$ 000237 739 00116$: 000237 50 10 [24] 740 jnc 00105$ 000239 EF [12] 741 mov a,r7 00023A 24r06 [12] 742 add a,#_lcdBarGraphInit_mySet_65536_25 00023C F9 [12] 743 mov r1,a 00023D 87 82 [24] 744 mov dpl,@r1 00023F C0 07 [24] 745 push ar7 000241 12r00r69 [24] 746 lcall _lcdSendData 000244 D0 07 [24] 747 pop ar7 000246 0F [12] 748 inc r7 000247 80 EB [24] 749 sjmp 00103$ 000249 750 00105$: 751 ; lcd.c:99: } //End of lcdBarGraphInit() 000249 22 [24] 752 ret 753 ;------------------------------------------------------------ 754 ;Allocation info for local variables in function 'lcdShowBarGraphValue' 755 ;------------------------------------------------------------ 756 ;value Allocated to registers r7 757 ;i Allocated to registers r4 758 ;f Allocated to registers r6 759 ;a Allocated to registers r7 760 ;------------------------------------------------------------ 761 ; lcd.c:102: void lcdShowBarGraphValue(char value) { // max 100 if 20X4 display 762 ; ----------------------------------------- 763 ; function lcdShowBarGraphValue 764 ; ----------------------------------------- 00024A 765 _lcdShowBarGraphValue: 00024A AF 82 [24] 766 mov r7,dpl 767 ; lcd.c:103: char i = value/5; //Multiples of 5 00024C 7E 00 [12] 768 mov r6,#0x00 00024E 75*00 05 [24] 769 mov __divsint_PARM_2,#0x05 770 ; 1-genFromRTrack replaced mov (__divsint_PARM_2 + 1),#0x00 000251 8E*01 [24] 771 mov (__divsint_PARM_2 + 1),r6 000253 8F 82 [24] 772 mov dpl,r7 000255 8E 83 [24] 773 mov dph,r6 000257 C0 07 [24] 774 push ar7 000259 C0 06 [24] 775 push ar6 00025B 12r00r00 [24] 776 lcall __divsint 00025E AC 82 [24] 777 mov r4,dpl 000260 D0 06 [24] 778 pop ar6 000262 D0 07 [24] 779 pop ar7 780 ; lcd.c:104: char f = value%5; //Fractional of 5 000264 75*00 05 [24] 781 mov __modsint_PARM_2,#0x05 000267 75*01 00 [24] 782 mov (__modsint_PARM_2 + 1),#0x00 00026A 8F 82 [24] 783 mov dpl,r7 00026C 8E 83 [24] 784 mov dph,r6 00026E C0 04 [24] 785 push ar4 000270 12r00r00 [24] 786 lcall __modsint 000273 AE 82 [24] 787 mov r6,dpl 000275 D0 04 [24] 788 pop ar4 789 ; lcd.c:105: for (char a = 0; a < i; a++) {lcdSendData(5);} 000277 7F 00 [12] 790 mov r7,#0x00 000279 791 00103$: 000279 C3 [12] 792 clr c 00027A EF [12] 793 mov a,r7 00027B 9C [12] 794 subb a,r4 00027C 50 15 [24] 795 jnc 00101$ 00027E 75 82 05 [24] 796 mov dpl,#0x05 000281 C0 07 [24] 797 push ar7 000283 C0 06 [24] 798 push ar6 000285 C0 04 [24] 799 push ar4 000287 12r00r69 [24] 800 lcall _lcdSendData 00028A D0 04 [24] 801 pop ar4 00028C D0 06 [24] 802 pop ar6 00028E D0 07 [24] 803 pop ar7 000290 0F [12] 804 inc r7 000291 80 E6 [24] 805 sjmp 00103$ 000293 806 00101$: 807 ; lcd.c:106: lcdSendData(f); 000293 8E 82 [24] 808 mov dpl,r6 809 ; lcd.c:107: } 000295 02r00r69 [24] 810 ljmp _lcdSendData 811 .area CSEG (CODE) 812 .area CONST (CODE) 000000 813 _Custom_Char5x8: 000000 0E 00 814 .byte #0x0e, #0x00 ; 14 000002 0E 00 815 .byte #0x0e, #0x00 ; 14 000004 04 00 816 .byte #0x04, #0x00 ; 4 000006 0E 00 817 .byte #0x0e, #0x00 ; 14 000008 15 00 818 .byte #0x15, #0x00 ; 21 00000A 04 00 819 .byte #0x04, #0x00 ; 4 00000C 0A 00 820 .byte #0x0a, #0x00 ; 10 00000E 0A 00 821 .byte #0x0a, #0x00 ; 10 000010 00 00 822 .byte #0x00, #0x00 ; 0 000012 00 00 823 .byte #0x00, #0x00 ; 0 000014 0A 00 824 .byte #0x0a, #0x00 ; 10 000016 04 00 825 .byte #0x04, #0x00 ; 4 000018 04 00 826 .byte #0x04, #0x00 ; 4 00001A 11 00 827 .byte #0x11, #0x00 ; 17 00001C 0E 00 828 .byte #0x0e, #0x00 ; 14 00001E 00 00 829 .byte #0x00, #0x00 ; 0 000020 04 00 830 .byte #0x04, #0x00 ; 4 000022 0E 00 831 .byte #0x0e, #0x00 ; 14 000024 1F 00 832 .byte #0x1f, #0x00 ; 31 000026 1F 00 833 .byte #0x1f, #0x00 ; 31 000028 0E 00 834 .byte #0x0e, #0x00 ; 14 00002A 0E 00 835 .byte #0x0e, #0x00 ; 14 00002C 0A 00 836 .byte #0x0a, #0x00 ; 10 00002E 0A 00 837 .byte #0x0a, #0x00 ; 10 000030 0E 00 838 .byte #0x0e, #0x00 ; 14 000032 11 00 839 .byte #0x11, #0x00 ; 17 000034 11 00 840 .byte #0x11, #0x00 ; 17 000036 1F 00 841 .byte #0x1f, #0x00 ; 31 000038 1B 00 842 .byte #0x1b, #0x00 ; 27 00003A 1B 00 843 .byte #0x1b, #0x00 ; 27 00003C 1F 00 844 .byte #0x1f, #0x00 ; 31 00003E 00 00 845 .byte #0x00, #0x00 ; 0 000040 0E 00 846 .byte #0x0e, #0x00 ; 14 000042 10 00 847 .byte #0x10, #0x00 ; 16 000044 10 00 848 .byte #0x10, #0x00 ; 16 000046 1F 00 849 .byte #0x1f, #0x00 ; 31 000048 1B 00 850 .byte #0x1b, #0x00 ; 27 00004A 1B 00 851 .byte #0x1b, #0x00 ; 27 00004C 1F 00 852 .byte #0x1f, #0x00 ; 31 00004E 00 00 853 .byte #0x00, #0x00 ; 0 000050 00 00 854 .byte #0x00, #0x00 ; 0 000052 11 00 855 .byte #0x11, #0x00 ; 17 000054 0A 00 856 .byte #0x0a, #0x00 ; 10 000056 11 00 857 .byte #0x11, #0x00 ; 17 000058 04 00 858 .byte #0x04, #0x00 ; 4 00005A 0E 00 859 .byte #0x0e, #0x00 ; 14 00005C 11 00 860 .byte #0x11, #0x00 ; 17 00005E 00 00 861 .byte #0x00, #0x00 ; 0 000060 00 00 862 .byte #0x00, #0x00 ; 0 000062 00 00 863 .byte #0x00, #0x00 ; 0 000064 0A 00 864 .byte #0x0a, #0x00 ; 10 000066 15 00 865 .byte #0x15, #0x00 ; 21 000068 11 00 866 .byte #0x11, #0x00 ; 17 00006A 0E 00 867 .byte #0x0e, #0x00 ; 14 00006C 04 00 868 .byte #0x04, #0x00 ; 4 00006E 00 00 869 .byte #0x00, #0x00 ; 0 000070 1F 00 870 .byte #0x1f, #0x00 ; 31 000072 1F 00 871 .byte #0x1f, #0x00 ; 31 000074 15 00 872 .byte #0x15, #0x00 ; 21 000076 1B 00 873 .byte #0x1b, #0x00 ; 27 000078 1B 00 874 .byte #0x1b, #0x00 ; 27 00007A 1F 00 875 .byte #0x1f, #0x00 ; 31 00007C 11 00 876 .byte #0x11, #0x00 ; 17 00007E 1F 00 877 .byte #0x1f, #0x00 ; 31 878 .area XINIT (CODE) 879 .area CABS (ABS,CODE)