Micro Computer Control Corp. MA51 (T) 8051 Relocatable Macro Assembler Version 1.14 07-JAN-93 KEYPAD Sat Jan 08 19:40:42 2005 PAGE 1 OBJECT MODULE PLACED IN KEYPAD.OBJ ASSEMBLER INVOKED BY: MA51 KEYPAD.SRC LOC OBJ LINE SOURCE 2 ;This code is listed here for entertainment value only, it should 3 ;not be used for anything important. Do not use this for a saleable product. 4 ;Feel free to pass this on to others in it's entirety. along with this message. 5 ;No Guarantees implicit or otherwise are implied, your mileage may vary. 8 9 $RB(0) 10 $RB(1) 11 =1 12 $NOMOD51 INCLUDE(87C752.pdf) =1 14 ;This code is listed here for entertainment value only, it should =1 15 ;not be used for anything important. Do not use this for a saleable product. =1 16 ;Feel free to pass this on to others in it's entirety. along with this message. =1 17 ;No Guarantees implicit or otherwise are implied, your mileage may vary. =1 20 =1 21 ; Philips/Signetics 87C752 Processor Descriptor File =1 22 $NOLIST =1 186 $INCLUDE(common.inc) =1 188 ;This code is listed here for entertainment value only, it should =1 189 ;not be used for anything important. Do not use this for a saleable product. =1 190 ;Feel free to pass this on to others in it's entirety. along with this message. =1 191 ;No Guarantees implicit or otherwise are implied, your mileage may vary. =1 194 =1 195 ; Memory Map =1 196 ; Location Code Data =1 197 ; 0000h iRAM Internal Bank 0 =1 198 ; 0000h iRAM R0 [Ihead] =1 199 ; 0001h iRAM R1 [Itail] =1 200 ; 0002h iRAM R2 [last temperature reading] =1 201 ; 0003h iRAM R3 [ROW] =1 202 ; 0004h iRAM R4 [COL] =1 203 ; 0005h iRAM R5 unused? =1 204 ; 0006h iRAM R6 [temporary] =1 205 ; 0007h iRAM R7 [temporary] =1 206 =1 207 ; 0008h iRAM Internal Bank 1 =1 208 ; 0008h iRAM R0 [ohead] =1 209 ; 0009h iRAM R1 [otail] =1 210 ; 000ah iRAM R2 [MYSW] =1 211 ; 000a.0 iRAM [MYSW.0] RAW =1 212 ; 000a.1 iRAM [MYSW.1] COLOR =1 213 ; 000a.2 iRAM [MYSW.2] BROADCAST =1 214 ; 000bh iRAM R3 [OLDCHAR] =1 215 ; 000ch iRAM R4 [OLDTEMP] =1 216 ; 000dh iRAM R5 IBUF[0] =1 217 ; 000eh iRAM R6 IBUF[1] =1 218 ; 000fh iRAM R7 IBUF[2] =1 219 =1 220 ; 0010h iRAM Internal Bank 2 KEYPAD Sat Jan 08 19:40:42 2005 PAGE 2 LOC OBJ LINE SOURCE =1 221 ; 0010h iRAM R0 IBUF[3] =1 222 ; 0011h iRAM R1 IBUF[4] =1 223 ; 0012h iRAM R2 IBUF[5] =1 224 ; 0013h iRAM R3 IBUF[6] =1 225 ; 0014h iRAM R4 IBUF[7] =1 226 ; 0015h iRAM R5 IBUF[8] =1 227 ; 0016h iRAM R6 IBUF[9] =1 228 ; 0017h iRAM R7 OBUF[0] =1 229 =1 230 ; 0018h iRAM Internal Bank 3 =1 231 ; 0018h iRAM R0 OBUF[1] =1 232 ; 0019h iRAM R1 OBUF[2] =1 233 ; 001ah iRAM R2 OBUF[3] =1 234 ; 001bh iRAM R3 OBUF[4] =1 235 ; 001ch iRAM R4 OBUF[5] =1 236 ; 001dh iRAM R5 OBUF[6] =1 237 ; 001eh iRAM R6 OBUF[7] =1 238 ; 001fh iRAM R7 OBUF[8] =1 239 =1 240 ; 0020h iRAM Internal (Stack start) =1 241 ; 0080h RAM Internal P0 =1 242 ; 0081h RAM Internal SP =1 243 ; 0082h RAM Internal DPL =1 244 ; 0083h RAM Internal DPH =1 245 ; 0084h RAM Internal nothing =1 246 ; 0087h RAM Internal nothing =1 247 ; 0088h RAM Internal TCON =1 248 ; 0089h RAM Internal TMOD =1 249 ; 008ah RAM Internal TL0 =1 250 ; 008bh RAM Internal TL1 =1 251 ; 008ch RAM Internal TH0 =1 252 ; 008dh RAM Internal TH1 =1 253 ; 008eh RAM Internal nothing =1 254 ; 008fh RAM Internal nothing =1 255 ; 0090h RAM Internal P1 =1 256 ; 0091h RAM Internal nothing =1 257 ; 0097h RAM Internal nothing =1 258 ; 0098h RAM Internal SCON =1 259 ; 0099h RAM Internal SBUF =1 260 ; 009ah RAM Internal nothing =1 261 ; 009fh RAM Internal nothing =1 262 ; 00a0h RAM Internal P2 =1 263 ; 00a1h RAM Internal nothing =1 264 ; 00a7h RAM Internal nothing =1 265 ; 00a8h RAM Internal IEC =1 266 ; 00a9h RAM Internal nothing =1 267 ; 00afh RAM Internal nothing =1 268 ; 00b0h RAM Internal P3 =1 269 ; 00b1h RAM Internal nothing =1 270 ; 00b7h RAM Internal nothing =1 271 ; 00b8h RAM Internal IPC =1 272 ; 00b9h RAM Internal nothing =1 273 ; 00cfh RAM Internal nothing =1 274 ; 00d0h RAM Internal PSW =1 275 ; 00d1h RAM Internal nothing =1 276 ; 00dfh RAM Internal nothing =1 277 ; 00e0h RAM Internal ACC =1 278 ; 00e1h RAM Internal nothing =1 279 ; 00efh RAM Internal nothing =1 280 ; 00f0h RAM Internal B =1 281 ; 00f1h RAM Internal nothing =1 282 ; 00ffh RAM Internal nothing =1 283 KEYPAD Sat Jan 08 19:40:42 2005 PAGE 3 LOC OBJ LINE SOURCE =1 284 =1 285 ;COLS EQU 40 =1 286 ;ROWS EQU 4 0010 =1 287 COLS EQU 16 0001 =1 288 ROWS EQU 1 =1 289 0003 =1 290 ROW EQU 03h 0004 =1 291 COL EQU 04h =1 292 000A =1 293 MYSW EQU 0Ah 000B =1 294 OLDCHAR EQU 0Bh 000C =1 295 OLDTEMP EQU 0Ch =1 296 0000 =1 297 RAW EQU 0 0001 =1 298 COLOR EQU 1 0002 =1 299 BROADCAST EQU 2 =1 300 0095 =1 301 SRD EQU P1.5 0097 =1 302 SWR EQU P1.7 0094 =1 303 CTS EQU P1.4 ; Goes low when OK to send or receive. =1 304 =1 305 ; The following BCASTs better match the alarms versions. 00FE =1 306 BCAST_ON EQU 254 ; Broadcast on char. 00FD =1 307 BCAST_OFF EQU 253 ; Broadcast off char. =1 308 =1 309 ; R5 used for getchar routine. =1 310 ; R6 =1 311 ; R7 are temporaries. 0005 =1 312 R05 EQU 05h 0006 =1 313 R06 EQU 06h 0007 =1 314 R07 EQU 07h =1 315 000D =1 316 IBUFSTART EQU 0Dh 0017 =1 317 IBUFEND EQU 17h ; Up to but not including. =1 318 0017 =1 319 OBUFSTART EQU 17h 0020 =1 320 OBUFEND EQU 20h ; Up to but not including. =1 321 =1 322 ; At 9600 baud, 104.166667 usec/bit. at 5.24288MHz 1 cycle = 2.28882usec. =1 323 ; number of cycles per bit is 104.166667 / 2.28882 in this case or, =1 324 ; 46 (45.51) cycles per bit. 002E =1 325 CPB EQU 46 ; Cycles per bit. =1 326 327 sleep MACRO W 328 MOV DPTR,#NOT((W-5)/6) ; 2 cycles 329 ACALL LONGWAIT ; 2 cycles 330 ENDM =1 331 332 333 EXTRN CODE(PUTLCD) 334 EXTRN CODE(PUTCHAR) 335 EXTRN CODE(IPUTCHAR) 336 EXTRN CODE(INTCHAR) 337 EXTRN CODE(INITLCD) 338 EXTRN CODE(HEXSTR) 339 EXTRN CODE(CRH0) 340 EXTRN CODE(LONGWAIT) 341 342 PUBLIC CRV0 343 PUBLIC MYINT0 344 ---- 345 CSEG AT 0000H ; RESET VECTOR ADDRESS 0000 346 CRV0: KEYPAD Sat Jan 08 19:40:42 2005 PAGE 4 LOC OBJ LINE SOURCE 0000 0100 F 347 AJMP CRH0 ; JMP TO RESET HANDLER 348 ---- 349 CSEG AT (0 * 8 + 3) ; INTERRUPT NO. 0 VECTOR ADDRESS 350 ; This interrupt line goes low on the start bit of a character and 351 ; then the line gets looked at as an input for the rest of the character. 0003 352 MYINT0: 0003 0100 F 353 AJMP INTCHAR 354 355 ; All of the following infinite loops are to catch any buggy code which ends 356 ; up at an interrupt and set the P3 output to the interrupt number for 357 ; debugging. I'm not expecting this to get executed. 358 ---- 359 CSEG AT (1 * 8 + 3) 000B 360 _tmp1: 000B 75B001 361 MOV P3,#1 000E 80FB 362 SJMP _tmp1 363 ---- 364 CSEG AT (2 * 8 + 3) 0013 365 _tmp2: 0013 75B002 366 MOV P3,#2 0016 80FB 367 SJMP _tmp2 368 ---- 369 CSEG AT (3 * 8 + 3) 001B 370 _tmp3: 001B 75B003 371 MOV P3,#3 001E 80FB 372 SJMP _tmp3 373 ---- 374 CSEG AT (4 * 8 + 3) 0023 375 _tmp4: 0023 75B004 376 MOV P3,#4 0026 80FB 377 SJMP _tmp4 378 ---- 379 CSEG AT (5 * 8 + 3) 002B 380 _tmp5: 002B 75B005 381 MOV P3,#5 002E 80FB 382 SJMP _tmp5 383 ---- 384 CSEG AT (6 * 8 + 3) 0033 385 _tmp6: 0033 75B006 386 MOV P3,#6 0036 80FB 387 SJMP _tmp6 388 389 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 390 ; 391 ; Variable usage, is R6 and R7 are temporaries used for timings. 392 ; DPTR is used for timings for INITIALIZATION of LCD. 393 ; In Register bank 0 394 ; R0 is a pointer to the head of a circular character buffer, only looked 395 ; at and modified by HANDLE_CHARACTER 396 ; R1 is a pointer to the tail of a circular character buffer, only looked 397 ; at and modified by INTCHAR character interrupt routine. 398 ; Circular character buffer starts at IBUFSTART and ends just before IBUFEND 399 ; In Register bank 1 400 ; R0 is a pointer to the head of a circular character buffer, only looked 401 ; at and modified by HANDLE_CHARACTER 402 ; R1 is a pointer to the tail of a circular character buffer, only looked 403 ; at and modified by PUTCHAR character interrupt routine. 404 ; Circular character buffer starts at IBUFSTART and ends just before IBUFEND 405 ; R2 contains current Temperature. 406 ; R3 is a temporary used by the read from the LCD 407 ; R5 gets trashed at any time. 408 ; 409 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; KEYPAD Sat Jan 08 19:40:42 2005 PAGE 5 LOC OBJ LINE SOURCE 410 411 CLIBC SEGMENT CODE 412 RSEG CLIBC 413 0000 414 HELLOSTR: 0000 4B657970 415 DB 'Keypad on ....', 0 0004 6164206F 0008 6E202020 000C 2E2E2E2E 0010 0010 00 416 417 418 PUBLIC _MAIN 419 PUBLIC NORMLCD 420 421 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 422 ; 423 ; _MAIN 424 ; Loops infinitely looking for stuff to do. 425 ; 426 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 427 0011 428 _MAIN: 429 ; Don't let the display get screwedup 0011 75B03F 430 MOV P3,#LOW(NOT (EN OR EN2)) 0014 75F040 431 MOV B,#EN ; Initialize the first, up to, 40 x 2 0017 1100 F 432 ACALL INITLCD ; Initialize the LCD display. 433 434 ; The commented out code is for a 40x4 display. 435 ; MOV B,#EN2 ; Initialize the second 40 x 2 436 ; ACALL INITLCD ; Initialize the LCD display. 437 0019 900000 F 438 MOV DPTR,#HELLOSTR ; Say hello. 001C 1100 F 439 ACALL LCDSTR 440 001E 1100 F 441 ACALL GETTEMP ; get the temperature initially 0020 442 TOPLOOP: 0020 209409 443 JB CTS,NOTURN ; our turn to empty output buffer? 0023 D2D3 444 SETB RS0 ; Use register bank 1. 0025 E8 445 MOV A,R0 0026 C3 446 CLR C 0027 99 447 SUBB A,R1 ; Check output buffer (Character ready in *R0) 0028 6002 448 JZ NOTURN ; Buffer is empty, don't putchar anything. 002A 1100 F 449 ACALL IPUTCHAR ; call routine to actually put the character 450 002C 451 NOTURN: 002C C2D3 452 CLR RS0 ; Back to bank 0 for the input side. 002E E8 453 MOV A,R0 002F C3 454 CLR C 0030 99 455 SUBB A,R1 ; Check input buffer (Character ready in *R0) 0031 6005 456 JZ TRYTEMP ; Buffer is empty, try getting the temp. 0033 1100 F 457 ACALL HANDLE_CHAR ; Deal with the character 0035 020000 F 458 LJMP KEEPON 459 0038 460 TRYTEMP: 0038 1100 F 461 ACALL GETTEMP ; Only get the temperature if buffer is empty. 462 003A 463 KEEPON: 003A 1100 F 464 ACALL SCANKEYS ; Scan the keypad for key presses. 465 003C 650B 466 XRL A,OLDCHAR ; If the character is the same as last time 003E 60E0 467 JZ TOPLOOP ; ignore it. KEYPAD Sat Jan 08 19:40:42 2005 PAGE 6 LOC OBJ LINE SOURCE 468 0040 650B 469 XRL A,OLDCHAR ; otherwise fix the xor to get the character 470 ; back 471 0042 F50B 472 MOV OLDCHAR,A ; Save character as old character 0044 60DA 473 JZ TOPLOOP ; If character is null, we aren't interested 474 0046 1100 F 475 ACALL PUTCHAR ; dump character to serial line 476 0048 80D6 477 SJMP TOPLOOP ; Go back and do it all again. 478 479 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 480 ; 481 ; GETTEMP 482 ; Does an A/D on the Temperature probe and puts it into R2 483 ; 484 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 485 004A 486 GETTEMP: 004A E5A0 487 MOV A,ADCON ; Get status bits of A/D for validity test. 004C 30E43E 488 JNB ACC.4,SAME_TEMP ; No valid data yet, Just bail. 004F AA84 489 MOV R2,ADAT ; Get data into R2 490 ; Set up status for another round of sampling 0051 75A02A 491 MOV ADCON,#(ENADC OR ADCS OR AADR1) 0054 EA 492 MOV A,R2 ; Get data into A for processing. 493 0055 C3 494 CLR C ; Only show difference if more than 1. 0056 950C 495 SUBB A,OLDTEMP 0058 6033 496 JZ SAME_TEMP 005A 30E706 497 JNB ACC.7,POS_DIFF 005D 64FF 498 XRL A,#0ffh ; Invert 005F 602C 499 JZ SAME_TEMP 0061 8004 500 SJMP LCD_TEMP 501 0063 502 POS_DIFF: 0063 9401 503 SUBB A,#1 0065 6026 504 JZ SAME_TEMP 505 0067 506 LCD_TEMP: ; Display temp at location 0067 C004 507 PUSH COL ; Save old column BUGBUG should save ROW too 0069 75040C 508 MOV COL,#12 ; temp is in format 100o starting at col 12 509 006C 1100 F 510 ACALL ROWCOL 511 006E EA 512 MOV A,R2 ; get temp. 006F F50C 513 MOV OLDTEMP,A ; save it away. 514 0071 900000 F 515 MOV DPTR,#TTABLE ; offset from Temp. Table 0074 93 516 MOVC A,@A+DPTR ; get Temperature value from table. 517 0075 1100 F 518 ACALL DECLCD ; out temp to LCD 519 0077 74DF 520 MOV A,#223 ; output degree symbol 0079 1100 F 521 ACALL NORMLCD 522 007B D004 523 POP COL ; recover old COL location, BUGBUG recover 007D 22 524 RET ; ROW information too once its saved. 525 007E 526 CH_ENQ: ; Alternate means to force a temp query. 527 ; ^E was pressed. 007E 7454 528 MOV A,#'T' ; Format is T=XX where XX are raw temperature 0080 1100 F 529 ACALL PUTCHAR ; data NOT gone through the table. 0082 743D 530 MOV A,#'=' KEYPAD Sat Jan 08 19:40:42 2005 PAGE 7 LOC OBJ LINE SOURCE 0084 1100 F 531 ACALL PUTCHAR 0086 EA 532 MOV A,R2 0087 900000 F 533 MOV DPTR,#TTABLE ; offset from Temp. Table 008A 93 534 MOVC A,@A+DPTR ; get Temperature value from table. 535 008B 1100 F 536 ACALL HEXSTR 537 008D 538 SAME_TEMP: 008D 22 539 RET 540 541 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 542 ; 543 ; SCANKEYS 544 ; Scanns the keypads once and sends Character to master if pressed. 545 ; and sets ACC to 0 or the key pressed. 546 ; 547 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 548 008E 549 SCANKEYS: 550 ; Leave only the scan lines. 008E 743F 551 MOV A,#LOW(NOT (EN OR EN2)) 0090 F5B0 552 MOV P3,A 0092 7F00 553 MOV R7,#0 ; R7 contains count of scan lines. 0094 7E00 554 MOV R6,#0 ; R6 contains count of row lines. 555 0096 556 TRYNEXT: 0096 C3 557 CLR C ; Ensure E2 doesnt get shifted high 0097 13 558 RRC A 0098 F5B0 559 MOV P3,A 009A 4440 560 ORL A,#EN ; Ensure only one col low at a time 009C 308312 561 JNB KP_R1,ROW_1 009F 30820E 562 JNB KP_R2,ROW_2 00A2 30900A 563 JNB KP_R3,ROW_3 00A5 309106 564 JNB KP_R4,ROW_4 565 00A8 0F 566 INC R7 00A9 40EB 567 JC TRYNEXT 568 00AB 7400 569 MOV A,#0 ; No key pressed. 00AD 22 570 RET 571 572 ; Note fallthrough cases for the rows. Row 1 R6 := 0, .. Row 4, R6 := 3 00AE 573 ROW_4: 00AE 0E 574 INC R6 00AF 575 ROW_3: 00AF 0E 576 INC R6 00B0 577 ROW_2: 00B0 0E 578 INC R6 00B1 579 ROW_1: 00B1 EF 580 MOV A,R7 00B2 23 581 RL A 00B3 23 582 RL A 00B4 4E 583 ORL A,R6 ; Now A contains 000cccrr 00B5 900000 F 584 MOV DPTR,#KEYTABLE 00B8 93 585 MOVC A,@A+DPTR ; Translate from row/col to character. 586 ; Leave only the scan lines. 00B9 75B03F 587 MOV P3,#LOW(NOT (EN OR EN2)) 00BC 22 588 RET 589 590 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 591 ; 592 ; HANDLE_CHAR 593 ; Assumes a serial character has been received and either prints it to the KEYPAD Sat Jan 08 19:40:42 2005 PAGE 8 LOC OBJ LINE SOURCE 594 ; LCD display, or in the case of a special character, executes an action. 595 ; Any character below 32 ' ' is considered special. 596 ; 597 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 598 599 ; Note assumption here is we've already verified there is a character in the 600 ; input buffer. 00BD 601 HANDLE_CHAR: 00BD 86F0 602 MOV B,@R0 ; Get character 00BF 08 603 INC R0 ; And updated input head pointer. 00C0 B81702 604 CJNE R0,#IBUFEND,READBUFOK 00C3 780D 605 MOV R0,#IBUFSTART ; Adjust to wrap in the case where at end. 606 00C5 607 READBUFOK: 00C5 E50A 608 MOV A,MYSW ; Get status bits. 00C7 20E02A 609 JB ACC.RAW,CH_RAW ; In raw mode, don't interpret the character 610 ; send it directly to the LCD 611 612 ; Changing the color of the status led. 00CA 20E117 613 JB ACC.COLOR,CH_COLOR 614 00CD E5F0 615 MOV A,B ; If greater than 31 treat as a printing char. 00CF 54E0 616 ANL A,#LOW(NOT 31) 00D1 7070 617 JNZ NORMCHAR 618 00D3 E5F0 619 MOV A,B ; Special character 00D5 23 620 RL A 00D6 04 621 INC A ; Address high byte is at char*2+1+SFJT 00D7 900000 F 622 MOV DPTR,#SFJT ; Set up jump table for special characters. 00DA 93 623 MOVC A,@A+DPTR 00DB C0E0 624 PUSH ACC ; Save 1/2 address for call(ret) on stack 00DD E5F0 625 MOV A,B 00DF 23 626 RL A ; Address low byte is at char*2+SFJT 00E0 93 627 MOVC A,@A+DPTR 00E1 C0E0 628 PUSH ACC ; Save 1/2 address for call(ret) on stack 00E3 22 629 RET ; And call the special routine by returning. 630 631 ; Change the 3 color LED's color 00E4 632 CH_COLOR: 00E4 E5F0 633 MOV A,B 00E6 C4 634 SWAP A ; move lower 4 bits as color control 00E7 54F0 635 ANL A,#0f0h ; ignore small stuff. 636 637 ; Note PWCM is being used to vary the duty cycle of the three color LED for 638 ; status information. 00E9 F58E 639 MOV PWCM,A ; Color mode, just reset color number 00EB 850AE0 640 MOV ACC,MYSW 00EE B2E1 641 CPL ACC.COLOR ; And get out of color mode. 00F0 85E00A 642 MOV MYSW,ACC 00F3 22 643 RET 644 645 ; Drive the LCD directly WARNING only if you know what you are doing. 00F4 646 CH_RAW: 00F4 E5F0 647 MOV A,B ; Escape mode, just drive LCD direct. 00F6 1100 F 648 ACALL PUTLCD 00F8 850AE0 649 MOV ACC,MYSW 00FB C2E0 650 CLR ACC.RAW ; Force out of raw mode after one char. 00FD 85E00A 651 MOV MYSW,ACC 0100 22 652 RET 653 654 ; Handle carriage return by setting column to 0 0101 655 CH_CR: 0101 750400 656 MOV COL,#0 KEYPAD Sat Jan 08 19:40:42 2005 PAGE 9 LOC OBJ LINE SOURCE 0104 22 657 RET 658 659 ; Reboot the keypad 0105 660 CH_REBOOT: 0105 0100 F 661 AJMP CRH0 ; Force a reboot. 662 663 ; Increment the character position 0107 664 CH_INC: 0107 0504 665 INC COL ; Bump the column number 0109 E504 666 MOV A,COL 010B C3 667 CLR C 010C 9410 668 SUBB A,#COLS ; If at the end of a row, auto cr/lf. 010E 7005 669 JNZ NO_INC 670 0110 750400 671 MOV COL,#0 ; force cr. 0113 8001 672 SJMP CH_LF ; and a lf. 673 0115 674 NO_INC: 0115 22 675 RET 676 677 ; Linefeed increment the line number 0116 678 CH_LF: 0116 0503 679 INC ROW ; Increment the line number 0118 E503 680 MOV A,ROW 011A C3 681 CLR C 011B 9401 682 SUBB A,#ROWS 011D 7003 683 JNZ NO_LF 011F 750300 684 MOV ROW,#0 ; If line is off the display reset to top line. 0122 685 NO_LF: 0122 22 686 RET 687 688 ; Reverse Linefeed, ignore if at the top of the display. 689 ; Note this is not symmetric with linefeed on purpose. It makes getting to the 690 ; top line possible, in a device independant way, where multiple keypads with 691 ; differing heights are used. 692 0123 693 CH_CTRLK: 0123 E503 694 MOV A,ROW 0125 6009 695 JZ NO_BS 0127 1503 696 DEC ROW 0129 22 697 RET 698 699 ; BackSpace, ignore if at the beginning of a line. 012A 700 CH_BS: 012A E504 701 MOV A,COL 012C 6002 702 JZ NO_BS 012E 1504 703 DEC COL 0130 704 NO_BS: ; Also exit point for 'do nothing' characters. 0130 22 705 RET 706 707 ; Put in raw mode, note currently next character will toggle back out of 708 ; this mode. 0131 709 CH_ESC: 0131 850AE0 710 MOV ACC,MYSW 0134 B2E0 711 CPL ACC.RAW ;Toggle raw mode for my status word. 0136 85E00A 712 MOV MYSW,ACC 0139 22 713 RET 714 715 ; Put in color mode, note currently next character will toggle back out of 716 ; this mode. 013A 717 CH_CTRLC: 013A 850AE0 718 MOV ACC,MYSW 013D B2E1 719 CPL ACC.COLOR ;Toggle color mode for my status word. KEYPAD Sat Jan 08 19:40:42 2005 PAGE 10 LOC OBJ LINE SOURCE 013F 85E00A 720 MOV MYSW,ACC 0142 22 721 RET 722 723 ; Handle normal character, note any number of other routines can mess with 724 ; what the LCD display thinks is the current location (like the temp routine.) 725 0143 726 NORMCHAR: 0143 C0F0 727 PUSH B ; save character 0145 1100 F 728 ACALL ROWCOL ; set row and column to proper location. 0147 1100 F 729 ACALL CH_INC ; advance to next character location. 0149 D0E0 730 POP ACC ; recover character 014B 1100 F 731 ACALL NORMLCD ; and send it to the LCD. 732 014D 22 733 RET 734 735 ;Special function jump table for special characters. backspace, cr, lf, etc. 014E 736 SFJT: 014E 0000 F 737 DW NO_BS, NO_BS, NO_BS, CH_CTRLC, NO_BS, CH_ENQ, NO_BS, NO_BS 0150 0000 F 0152 0000 F 0154 0000 F 0156 0000 F 0158 0000 F 015A 0000 F 015C 0000 F 015E 0000 F 738 DW CH_BS, NO_BS, CH_LF, CH_CTRLK, NO_BS, CH_CR, NO_BS, NO_BS 0160 0000 F 0162 0000 F 0164 0000 F 0166 0000 F 0168 0000 F 016A 0000 F 016C 0000 F 016E 0000 F 739 DW NO_BS, NO_BS, CH_REBOOT, NO_BS, NO_BS, NO_BS, NO_BS, NO_BS 0170 0000 F 0172 0000 F 0174 0000 F 0176 0000 F 0178 0000 F 017A 0000 F 017C 0000 F 017E 0000 F 740 DW NO_BS, NO_BS, NO_BS, CH_ESC, NO_BS, NO_BS, NO_BS, NO_BS 0180 0000 F 0182 0000 F 0184 0000 F 0186 0000 F 0188 0000 F 018A 0000 F 018C 0000 F 741 742 743 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 744 ; 745 ; ROWCOL 746 ; Sets the Row and Column on the display 747 ; setable for 40x4 display. 748 ; Currently set for 16x1 display. 749 ; 750 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 751 752 ; Note, E(P3.6 and E2(P3.7) refer to enable lines on LCD display. 753 ; Note, RW(P3.4 and RS(P3.5) refer to read/write and reset on LCD display. 754 ; Note, the LCD display is being driven in 4 bit mode NOT 8 bit mode. KEYPAD Sat Jan 08 19:40:42 2005 PAGE 11 LOC OBJ LINE SOURCE 755 018E 756 ROWCOL: 018E E503 757 MOV A,ROW 0190 4480 758 ORL A,#80h ; 80h is the base address for LCD 759 ; MOV C,ACC.0 ; Odd rows for 40x4 start at C0h 760 ; MOV ACC.6,C 0192 54F0 761 ANL A,#0F0h ; Mask off old row bits. 0194 2504 762 ADD A,COL ; column offsed is just added 0196 A2E3 763 MOV C,ACC.3 ; cols > 7 for 16x1 start at C0h 0198 92E6 764 MOV ACC.6,C ; cols > 7 for 16x1 start at C0h 019A C2E3 765 CLR ACC.3 ; cols > 7 for 16x1 start at C0h 766 019C C0E0 767 PUSH ACC ; Save away address. 019E 54F0 768 ANL A,#0f0h ; Blast low nibble. 01A0 4503 769 ORL A,ROW ; Get row into low nibble. 01A2 A2E1 770 MOV C,ACC.1 ; move high row bit into carry 01A4 92E3 771 MOV ACC.3,C ; choose E2 if row 2 or 3 01A6 B3 772 CPL C ; otherwise 01A7 92E2 773 MOV ACC.2,C ; choose E 01A9 54FC 774 ANL A,#LOW(NOT 3) ; blast lower 2 bits (eventually RW and RS) 01AB C4 775 SWAP A ; Get bits where they belong. 01AC 1100 F 776 ACALL PUTLCD 777 01AE D0E0 778 POP ACC ; Get address. 01B0 540F 779 ANL A,#0fh ; mask off high bits 01B2 C4 780 SWAP A ; move low data to high. 01B3 4503 781 ORL A,ROW ; move row data into low nibble 01B5 A2E1 782 MOV C,ACC.1 ; move high row bit into carry 01B7 92E3 783 MOV ACC.3,C ; choose E2 if row 2 or 3 01B9 B3 784 CPL C ; otherwise 01BA 92E2 785 MOV ACC.2,C ; choose E 01BC 54FC 786 ANL A,#LOW(NOT 3) ; blast lower two bits. 01BE C4 787 SWAP A ; move low bits back into data position. 01BF 1100 F 788 ACALL PUTLCD 01C1 22 789 RET 790 791 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 792 ; 793 ; NORMLCD 794 ; Outputs a character to the display. 795 ; 796 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 797 01C2 798 NORMLCD: 01C2 C0E0 799 PUSH ACC ; optimally this would be the same code as 01C4 54F0 800 ANL A,#0f0h ; above. 01C6 4503 801 ORL A,ROW 01C8 A2E1 802 MOV C,ACC.1 01CA 92E3 803 MOV ACC.3,C 01CC B3 804 CPL C 01CD 92E2 805 MOV ACC.2,C 01CF 54FC 806 ANL A,#LOW(NOT 3) 01D1 C4 807 SWAP A 01D2 4420 808 ORL A,#20h 01D4 1100 F 809 ACALL PUTLCD 810 01D6 D0E0 811 POP ACC 01D8 540F 812 ANL A,#0fh 01DA C4 813 SWAP A 01DB 4503 814 ORL A,ROW 01DD A2E1 815 MOV C,ACC.1 01DF 92E3 816 MOV ACC.3,C 01E1 B3 817 CPL C KEYPAD Sat Jan 08 19:40:42 2005 PAGE 12 LOC OBJ LINE SOURCE 01E2 92E2 818 MOV ACC.2,C 01E4 54FC 819 ANL A,#LOW(NOT 3) 01E6 C4 820 SWAP A 01E7 4420 821 ORL A,#20h 01E9 1100 F 822 ACALL PUTLCD 01EB 22 823 RET 824 825 826 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 827 ; 828 ; LCDSTR 829 ; Outputs a null terminated string at CS:DPTR to the display. 830 ; 831 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 832 01EC 833 LCDSTR: 01EC 1100 F 834 ACALL ROWCOL ; Get to correct row and column 01EE 1100 F 835 ACALL CH_INC ; BUGBUG Shouldn't this be after character? 01F0 E4 836 CLR A 01F1 93 837 MOVC A,@A+DPTR 01F2 600D 838 JZ DONESTR 01F4 C082 839 PUSH DPL 01F6 C083 840 PUSH DPH 01F8 1100 F 841 ACALL NORMLCD 01FA D083 842 POP DPH 01FC D082 843 POP DPL 01FE A3 844 INC DPTR 01FF 80EB 845 SJMP LCDSTR 846 0201 847 DONESTR: 0201 22 848 RET 849 0202 850 DECLCD: 0202 C0E0 851 PUSH ACC 0204 C2D5 852 CLR F0 ; Use F0 as leading zero blanking indicator 0206 75F064 853 MOV B,#100 0209 84 854 DIV AB 855 020A 6002 856 JZ NO_HUND 020C D2D5 857 SETB F0 020E 858 NO_HUND: 020E 1100 F 859 ACALL DECASC 0210 1100 F 860 ACALL NORMLCD 0212 740A 861 MOV A,#10 0214 C5F0 862 XCH A,B 0216 84 863 DIV AB 864 0217 6002 865 JZ NO_TEN 0219 D2D5 866 SETB F0 021B 867 NO_TEN: 021B 1100 F 868 ACALL DECASC 021D 1100 F 869 ACALL NORMLCD 870 021F D2D5 871 SETB F0 ; Force at least one zero on output. 0221 C5F0 872 XCH A,B 0223 1100 F 873 ACALL DECASC 0225 1100 F 874 ACALL NORMLCD 875 0227 D0E0 876 POP ACC 0229 22 877 RET 878 022A 879 DECASC: 022A 30D503 880 JNB F0,BLANKZER KEYPAD Sat Jan 08 19:40:42 2005 PAGE 13 LOC OBJ LINE SOURCE 022D 2430 881 ADD A,#'0' ; Get binary represenation offset to '0' char. 022F 22 882 RET 883 0230 884 BLANKZER: 0230 7420 885 MOV A,#32 ; Use a space if zero blanking is on. 0232 22 886 RET 887 888 889 ; This is the translation from row/column scan to character 0233 33363923 890 KEYTABLE: DB '369#' 0237 0237 32353830 891 DB '2580' 023B 023B 3134372A 892 DB '147*' 023F 023F 6F757646 893 DB 'ouvF' 0243 0243 66647473 894 DB 'fdts' 0247 0247 72726B6C 895 DB 'rrkl' 024B 896 =1 897 $INCLUDE(temp.src) =1 899 ;This code is listed here for entertainment value only, it should =1 900 ;not be used for anything important. Do not use this for a saleable product. =1 901 ;Feel free to pass this on to others in it's entirety. along with this message. =1 902 ;No Guarantees implicit or otherwise are implied, your mileage may vary. =1 905 =1 906 ; Automatically generated from temp.awk 907 PUBLIC TTABLE 024B 908 TTABLE: 024B 00 909 DB 0 024C 00 910 DB 0 024D 00 911 DB 0 024E 00 912 DB 0 024F 00 913 DB 0 0250 00 914 DB 0 0251 00 915 DB 0 0252 00 916 DB 0 0253 00 917 DB 0 0254 00 918 DB 0 0255 00 919 DB 0 0256 00 920 DB 0 0257 00 921 DB 0 0258 00 922 DB 0 0259 00 923 DB 0 025A 00 924 DB 0 025B 00 925 DB 0 025C 00 926 DB 0 025D 00 927 DB 0 025E 00 928 DB 0 025F 00 929 DB 0 0260 00 930 DB 0 0261 00 931 DB 0 0262 00 932 DB 0 0263 00 933 DB 0 0264 00 934 DB 0 0265 00 935 DB 0 0266 00 936 DB 0 0267 00 937 DB 0 KEYPAD Sat Jan 08 19:40:42 2005 PAGE 14 LOC OBJ LINE SOURCE 0268 00 938 DB 0 0269 00 939 DB 0 026A 00 940 DB 0 026B 00 941 DB 0 026C 00 942 DB 0 026D 00 943 DB 0 026E 02 944 DB 2 026F 06 945 DB 6 0270 09 946 DB 9 0271 0B 947 DB 11 0272 0D 948 DB 13 0273 0F 949 DB 15 0274 10 950 DB 16 0275 12 951 DB 18 0276 13 952 DB 19 0277 14 953 DB 20 0278 16 954 DB 22 0279 17 955 DB 23 027A 18 956 DB 24 027B 19 957 DB 25 027C 1A 958 DB 26 027D 1B 959 DB 27 027E 1C 960 DB 28 027F 1D 961 DB 29 0280 1E 962 DB 30 0281 1F 963 DB 31 0282 20 964 DB 32 0283 21 965 DB 33 0284 22 966 DB 34 0285 23 967 DB 35 0286 24 968 DB 36 0287 25 969 DB 37 0288 26 970 DB 38 0289 26 971 DB 38 028A 27 972 DB 39 028B 28 973 DB 40 028C 29 974 DB 41 028D 29 975 DB 41 028E 2A 976 DB 42 028F 2B 977 DB 43 0290 2C 978 DB 44 0291 2C 979 DB 44 0292 2D 980 DB 45 0293 2E 981 DB 46 0294 2F 982 DB 47 0295 2F 983 DB 47 0296 30 984 DB 48 0297 31 985 DB 49 0298 31 986 DB 49 0299 32 987 DB 50 029A 33 988 DB 51 029B 33 989 DB 51 029C 34 990 DB 52 029D 35 991 DB 53 029E 35 992 DB 53 029F 36 993 DB 54 02A0 37 994 DB 55 02A1 37 995 DB 55 02A2 38 996 DB 56 02A3 38 997 DB 56 02A4 39 998 DB 57 02A5 3A 999 DB 58 02A6 3A 1000 DB 58 KEYPAD Sat Jan 08 19:40:42 2005 PAGE 15 LOC OBJ LINE SOURCE 02A7 3B 1001 DB 59 02A8 3B 1002 DB 59 02A9 3C 1003 DB 60 02AA 3D 1004 DB 61 02AB 3D 1005 DB 61 02AC 3E 1006 DB 62 02AD 3E 1007 DB 62 02AE 3F 1008 DB 63 02AF 3F 1009 DB 63 02B0 40 1010 DB 64 02B1 40 1011 DB 64 02B2 41 1012 DB 65 02B3 42 1013 DB 66 02B4 42 1014 DB 66 02B5 43 1015 DB 67 02B6 43 1016 DB 67 02B7 44 1017 DB 68 02B8 44 1018 DB 68 02B9 45 1019 DB 69 02BA 45 1020 DB 69 02BB 46 1021 DB 70 02BC 46 1022 DB 70 02BD 47 1023 DB 71 02BE 47 1024 DB 71 02BF 48 1025 DB 72 02C0 48 1026 DB 72 02C1 49 1027 DB 73 02C2 49 1028 DB 73 02C3 4A 1029 DB 74 02C4 4A 1030 DB 74 02C5 4B 1031 DB 75 02C6 4B 1032 DB 75 02C7 4C 1033 DB 76 02C8 4C 1034 DB 76 02C9 4D 1035 DB 77 02CA 4D 1036 DB 77 02CB 4E 1037 DB 78 02CC 4E 1038 DB 78 02CD 4F 1039 DB 79 02CE 4F 1040 DB 79 02CF 50 1041 DB 80 02D0 50 1042 DB 80 02D1 51 1043 DB 81 02D2 51 1044 DB 81 02D3 51 1045 DB 81 02D4 52 1046 DB 82 02D5 52 1047 DB 82 02D6 53 1048 DB 83 02D7 53 1049 DB 83 02D8 54 1050 DB 84 02D9 54 1051 DB 84 02DA 55 1052 DB 85 02DB 55 1053 DB 85 02DC 56 1054 DB 86 02DD 56 1055 DB 86 02DE 56 1056 DB 86 02DF 57 1057 DB 87 02E0 57 1058 DB 87 02E1 58 1059 DB 88 02E2 58 1060 DB 88 02E3 59 1061 DB 89 02E4 59 1062 DB 89 02E5 59 1063 DB 89 KEYPAD Sat Jan 08 19:40:42 2005 PAGE 16 LOC OBJ LINE SOURCE 02E6 5A 1064 DB 90 02E7 5A 1065 DB 90 02E8 5B 1066 DB 91 02E9 5B 1067 DB 91 02EA 5C 1068 DB 92 02EB 5C 1069 DB 92 02EC 5C 1070 DB 92 02ED 5D 1071 DB 93 02EE 5D 1072 DB 93 02EF 5E 1073 DB 94 02F0 5E 1074 DB 94 02F1 5F 1075 DB 95 02F2 5F 1076 DB 95 02F3 5F 1077 DB 95 02F4 60 1078 DB 96 02F5 60 1079 DB 96 02F6 61 1080 DB 97 02F7 61 1081 DB 97 02F8 61 1082 DB 97 02F9 62 1083 DB 98 02FA 62 1084 DB 98 02FB 63 1085 DB 99 02FC 63 1086 DB 99 02FD 63 1087 DB 99 02FE 64 1088 DB 100 02FF 64 1089 DB 100 0300 65 1090 DB 101 0301 65 1091 DB 101 0302 65 1092 DB 101 0303 66 1093 DB 102 0304 66 1094 DB 102 0305 66 1095 DB 102 0306 67 1096 DB 103 0307 67 1097 DB 103 0308 68 1098 DB 104 0309 68 1099 DB 104 030A 68 1100 DB 104 030B 69 1101 DB 105 030C 69 1102 DB 105 030D 6A 1103 DB 106 030E 6A 1104 DB 106 030F 6A 1105 DB 106 0310 6B 1106 DB 107 0311 6B 1107 DB 107 0312 6B 1108 DB 107 0313 6C 1109 DB 108 0314 6C 1110 DB 108 0315 6D 1111 DB 109 0316 6D 1112 DB 109 0317 6D 1113 DB 109 0318 6E 1114 DB 110 0319 6E 1115 DB 110 031A 6E 1116 DB 110 031B 6F 1117 DB 111 031C 6F 1118 DB 111 031D 6F 1119 DB 111 031E 70 1120 DB 112 031F 70 1121 DB 112 0320 71 1122 DB 113 0321 71 1123 DB 113 0322 71 1124 DB 113 0323 72 1125 DB 114 0324 72 1126 DB 114 KEYPAD Sat Jan 08 19:40:42 2005 PAGE 17 LOC OBJ LINE SOURCE 0325 72 1127 DB 114 0326 73 1128 DB 115 0327 73 1129 DB 115 0328 73 1130 DB 115 0329 74 1131 DB 116 032A 74 1132 DB 116 032B 75 1133 DB 117 032C 75 1134 DB 117 032D 75 1135 DB 117 032E 76 1136 DB 118 032F 76 1137 DB 118 0330 76 1138 DB 118 0331 77 1139 DB 119 0332 77 1140 DB 119 0333 77 1141 DB 119 0334 78 1142 DB 120 0335 78 1143 DB 120 0336 78 1144 DB 120 0337 79 1145 DB 121 0338 79 1146 DB 121 0339 79 1147 DB 121 033A 7A 1148 DB 122 033B 7A 1149 DB 122 033C 7A 1150 DB 122 033D 7B 1151 DB 123 033E 7B 1152 DB 123 033F 7B 1153 DB 123 0340 7C 1154 DB 124 0341 7C 1155 DB 124 0342 7C 1156 DB 124 0343 7D 1157 DB 125 0344 7D 1158 DB 125 0345 7D 1159 DB 125 0346 7E 1160 DB 126 0347 7E 1161 DB 126 0348 7E 1162 DB 126 0349 7F 1163 DB 127 034A 7F 1164 DB 127 =1 1165 $EJECT KEYPAD Sat Jan 08 19:40:42 2005 PAGE 18 LOC OBJ LINE SOURCE 1166 1167 1168 $EJECT KEYPAD Sat Jan 08 19:40:42 2005 PAGE 19 LOC OBJ LINE SOURCE 1169 END KEYPAD Sat Jan 08 19:40:42 2005 PAGE 20 SYMBOL TABLE LISTING ------ ----- ------- N A M E T Y P E V A L U E A T T R I B U T E S AADR0...... NUMB 0001H A AADR1...... NUMB 0002H A AADR2...... NUMB 0004H A AC......... B ADDR 00D0H.6 A ACC........ D ADDR 00E0H A ADAT....... D ADDR 0084H A ADCI....... NUMB 0010H A ADCON...... D ADDR 00A0H A ADCS....... NUMB 0008H A ARL........ B ADDR 0098H.4 A ATN........ B ADDR 0098H.6 A B.......... D ADDR 00F0H A BCAST_OFF.. NUMB 00FDH A BCAST_ON... NUMB 00FEH A BLANKZER... C ADDR 0230H R SEG = CLIBC BROADCAST.. NUMB 0002H A CARL....... B ADDR 0098H.4 A CDR........ B ADDR 0098H.5 A CH_BS...... C ADDR 012AH R SEG = CLIBC CH_COLOR... C ADDR 00E4H R SEG = CLIBC CH_CR...... C ADDR 0101H R SEG = CLIBC CH_CTRLC... C ADDR 013AH R SEG = CLIBC CH_CTRLK... C ADDR 0123H R SEG = CLIBC CH_ENQ..... C ADDR 007EH R SEG = CLIBC CH_ESC..... C ADDR 0131H R SEG = CLIBC CH_INC..... C ADDR 0107H R SEG = CLIBC CH_LF...... C ADDR 0116H R SEG = CLIBC CH_RAW..... C ADDR 00F4H R SEG = CLIBC CH_REBOOT.. C ADDR 0105H R SEG = CLIBC CLIBC...... C SEG 034BH R REL = UNIT CLRTI...... B ADDR 00D8H.5 A COL........ NUMB 0004H A COLOR...... NUMB 0001H A COLS....... NUMB 0010H A CPB........ NUMB 002EH A CRH0....... C ADDR ---- EXT CRV0....... C ADDR 0000H A PUB CSTP....... B ADDR 0098H.2 A CSTR....... B ADDR 0098H.3 A CT0........ B ADDR 00D8H.0 A CT1........ B ADDR 00D8H.1 A CTS........ B ADDR 0090H.4 A CXA........ B ADDR 0098H.7 A CY......... B ADDR 00D0H.7 A DECASC..... C ADDR 022AH R SEG = CLIBC DECLCD..... C ADDR 0202H R SEG = CLIBC DONESTR.... C ADDR 0201H R SEG = CLIBC DPH........ D ADDR 0083H A DPL........ D ADDR 0082H A DRDY....... B ADDR 0098H.5 A EA......... B ADDR 00A8H.7 A EI2........ B ADDR 00A8H.4 A EN......... NUMB 0040H A EN2........ NUMB 0080H A ENADC...... NUMB 0020H A EPWM....... B ADDR 00A8H.3 A ET0........ B ADDR 00A8H.1 A EX0........ B ADDR 00A8H.0 A EX1........ B ADDR 00A8H.2 A F0......... B ADDR 00D0H.5 A GATE....... B ADDR 0088H.7 A GETTEMP.... C ADDR 004AH R SEG = CLIBC HANDLE_CHAR C ADDR 00BDH R SEG = CLIBC HELLOSTR... C ADDR 0000H R SEG = CLIBC HEXSTR..... C ADDR ---- EXT I2CFG...... D ADDR 00D8H A I2CON...... D ADDR 0098H A I2DAT...... D ADDR 0099H A I2STA...... D ADDR 00F8H A IBUFEND.... NUMB 0017H A IBUFSTART.. NUMB 000DH A IDLE....... B ADDR 0098H.6 A IDLES...... B ADDR 00F8H.6 A IE......... D ADDR 00A8H A IE0........ B ADDR 0088H.3 A IE1........ B ADDR 0088H.1 A INITLCD.... C ADDR ---- EXT INT0....... B ADDR 0090H.5 A INT1....... B ADDR 0090H.6 A INTCHAR.... C ADDR ---- EXT IPUTCHAR... C ADDR ---- EXT IT0........ B ADDR 0088H.2 A IT1........ B ADDR 0088H.0 A KEEPON..... C ADDR 003AH R SEG = CLIBC KEYTABLE... C ADDR 0233H R SEG = CLIBC KP_C1...... B ADDR 00B0H.5 A KP_C2...... B ADDR 00B0H.4 A KP_C3...... B ADDR 00B0H.0 A KP_C4...... B ADDR 00B0H.1 A KP_C5...... B ADDR 00B0H.2 A KP_C6...... B ADDR 00B0H.3 A KP_R1...... B ADDR 0080H.3 A KP_R2...... B ADDR 0080H.2 A KP_R3...... B ADDR 0090H.0 A KP_R4...... B ADDR 0090H.1 A LCDSTR..... C ADDR 01ECH R SEG = CLIBC LCD_D4..... B ADDR 00B0H.0 A LCD_D5..... B ADDR 00B0H.1 A LCD_D6..... B ADDR 00B0H.2 A LCD_D7..... B ADDR 00B0H.3 A LCD_EN..... B ADDR 00B0H.6 A LCD_EN2.... B ADDR 00B0H.7 A LCD_RS..... B ADDR 00B0H.5 A LCD_RW..... B ADDR 00B0H.4 A LCD_TEMP... C ADDR 0067H R SEG = CLIBC LONGWAIT... C ADDR ---- EXT MAKSTP..... B ADDR 00F8H.2 A MAKSTR..... B ADDR 00F8H.3 A MASTER..... B ADDR 0098H.1 A MASTRQ..... B ADDR 00D8H.6 A MYINT0..... C ADDR 0003H A PUB MYSW....... NUMB 000AH A NORMCHAR... C ADDR 0143H R SEG = CLIBC NORMLCD.... C ADDR 01C2H R PUB SEG = CLIBC NOTURN..... C ADDR 002CH R SEG = CLIBC NO_BS...... C ADDR 0130H R SEG = CLIBC NO_HUND.... C ADDR 020EH R SEG = CLIBC NO_INC..... C ADDR 0115H R SEG = CLIBC NO_LF...... C ADDR 0122H R SEG = CLIBC NO_TEN..... C ADDR 021BH R SEG = CLIBC OBUFEND.... NUMB 0020H A OBUFSTART.. NUMB 0017H A OLDCHAR.... NUMB 000BH A OLDTEMP.... NUMB 000CH A OV......... B ADDR 00D0H.2 A P.......... B ADDR 00D0H.0 A P0......... D ADDR 0080H A P0_0....... B ADDR 0080H.0 A P0_1....... B ADDR 0080H.1 A P0_2....... B ADDR 0080H.2 A P1......... D ADDR 0090H A P1_0....... B ADDR 0090H.0 A P1_1....... B ADDR 0090H.1 A P1_2....... B ADDR 0090H.2 A P1_3....... B ADDR 0090H.3 A P1_4....... B ADDR 0090H.4 A P1_5....... B ADDR 0090H.5 A P1_6....... B ADDR 0090H.6 A P1_7....... B ADDR 0090H.7 A P3......... D ADDR 00B0H A P3_0....... B ADDR 00B0H.0 A P3_1....... B ADDR 00B0H.1 A P3_2....... B ADDR 00B0H.2 A P3_3....... B ADDR 00B0H.3 A P3_4....... B ADDR 00B0H.4 A P3_5....... B ADDR 00B0H.5 A P3_6....... B ADDR 00B0H.6 A P3_7....... B ADDR 00B0H.7 A PCON....... D ADDR 0087H A POS_DIFF... C ADDR 0063H R SEG = CLIBC PSW........ D ADDR 00D0H A PUTCHAR.... C ADDR ---- EXT PUTLCD..... C ADDR ---- EXT PWCM....... D ADDR 008EH A PWENA...... D ADDR 00FEH A PWMP....... D ADDR 008FH A R05........ NUMB 0005H A R06........ NUMB 0006H A R07........ NUMB 0007H A RAW........ NUMB 0000H A RDAT....... B ADDR 0098H.7 A READBUFOK.. C ADDR 00C5H R SEG = CLIBC ROW........ NUMB 0003H A ROWCOL..... C ADDR 018EH R SEG = CLIBC ROWS....... NUMB 0001H A ROW_1...... C ADDR 00B1H R SEG = CLIBC ROW_2...... C ADDR 00B0H R SEG = CLIBC ROW_3...... C ADDR 00AFH R SEG = CLIBC ROW_4...... C ADDR 00AEH R SEG = CLIBC RS0........ B ADDR 00D0H.3 A RS1........ B ADDR 00D0H.4 A RTH........ D ADDR 008DH A RTL........ D ADDR 008BH A SAME_TEMP.. C ADDR 008DH R SEG = CLIBC SCANKEYS... C ADDR 008EH R SEG = CLIBC SCL........ B ADDR 0080H.0 A SDA........ B ADDR 0080H.1 A SFJT....... C ADDR 014EH R SEG = CLIBC SLAVEN..... B ADDR 00D8H.7 A SP......... D ADDR 0081H A SRD........ B ADDR 0090H.5 A STP........ B ADDR 0098H.2 A STR........ B ADDR 0098H.3 A SWR........ B ADDR 0090H.7 A T0......... B ADDR 0090H.7 A TCON....... D ADDR 0088H A TF......... B ADDR 0088H.5 A TH......... D ADDR 008CH A TIRUN...... B ADDR 00D8H.4 A TL......... D ADDR 008AH A TOPLOOP.... C ADDR 0020H R SEG = CLIBC TR......... B ADDR 0088H.4 A TRYNEXT.... C ADDR 0096H R SEG = CLIBC TRYTEMP.... C ADDR 0038H R SEG = CLIBC TTABLE..... C ADDR 024BH R PUB SEG = CLIBC XACTV...... B ADDR 00F8H.4 A XDATAS..... B ADDR 00F8H.5 A XSTP....... B ADDR 0098H.0 A XSTPS...... B ADDR 00F8H.0 A XSTR....... B ADDR 0098H.1 A XSTRS...... B ADDR 00F8H.1 A _MAIN...... C ADDR 0011H R PUB SEG = CLIBC _TMP1...... C ADDR 000BH A _TMP2...... C ADDR 0013H A _TMP3...... C ADDR 001BH A _TMP4...... C ADDR 0023H A _TMP5...... C ADDR 002BH A _TMP6...... C ADDR 0033H A REGISTER BANK(S) USED: 0 ASSEMBLY COMPLETE, NO ERROR FOUND