A51 MACRO ASSEMBLER 綺阵式键臺的识_餩_二__ 05/15/2008 16:00:32 PAGE 1
MACRO ASSEMBLER A51 V7.07
OBJECT MODULE PLACED IN 矩阵式键盘的识别(二).OBJ
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE 矩阵式键盘的识别(二).asm SET(SMALL) DEBUG EP
LOC OBJ LINE SOURCE
0000 1 ORG 0000H
0000 2100 2 AJMP main
0100 3 ORG 0100H
0100 75B00F 4 main: MOV P3,#0FH
0103 7580FE 5 KEY0: MOV P0,#0FEH ;[11111110]FE,置P0.0低电平扫描P0.4~P0.7键值
0106 308438 6 JNB P0.4,K0
0109 30853D 7 JNB P0.5,K1
010C 308642 8 JNB P0.6,K2
010F 308747 9 JNB P0.7,K3
0112 7580FD 10 MOV P0,#0FDH ;[11111101]FD,置P0.1低电平扫描P0.4~P0.7键值
0115 308449 11 JNB P0.4,K4
0118 30854E 12 JNB P0.5,K5
011B 308653 13 JNB P0.6,K6
011E 308758 14 JNB P0.7,K7
0121 7580FB 15 MOV P0,#0FBH ;[11111011]FB,置P0.2低电平扫描P0.4~P0.7键值
0124 30845A 16 JNB P0.4,K8
0127 30855F 17 JNB P0.5,K9
012A 308664 18 JNB P0.6,K10
012D 308769 19 JNB P0.7,K11
0130 7580F7 20 MOV P0,#0F7H ;[11110111]FE,置P0.3低电平扫描P0.4~P0.7键值
0133 30846B 21 JNB P0.4,K12
0136 308570 22 JNB P0.5,K13
0139 308675 23 JNB P0.6,K14
013C 30877A 24 JNB P0.7,K15
013F 2103 25 AJMP KEY0
26 ;键码显示子程序
0141 75B01E 27 K0: MOV P3,#1EH ;0
0144 31C1 28 ACALL YSH1S
0146 2103 29 AJMP KEY0
0148 22 30 RET
0149 75B02E 31 K1: MOV P3,#2EH ;1
014C 31C1 32 ACALL YSH1S
014E 2103 33 AJMP KEY0
0150 22 34 RET
0151 75B04E 35 K2: MOV P3,#4EH ;2
0154 31C1 36 ACALL YSH1S
0156 2103 37 AJMP KEY0
0158 22 38 RET
0159 75B08E 39 K3: MOV P3,#8EH ;3
015C 31C1 40 ACALL YSH1S
015E 2103 41 AJMP KEY0
0160 22 42 RET
0161 75B01D 43 K4: MOV P3,#1DH ;4
0164 31C1 44 ACALL YSH1S
0166 2103 45 AJMP KEY0
0168 22 46 RET
0169 75B02D 47 K5: MOV P3,#2DH ;5
016C 31C1 48 ACALL YSH1S
016E 2103 49 AJMP KEY0
0170 22 50 RET
0171 75B04D 51 K6: MOV P3,#4DH ;6
0174 31C1 52 ACALL YSH1S
0176 2103 53 AJMP KEY0
0178 22 54 RET
0179 75B08D 55 K7: MOV P3,#8DH ;7
017C 31C1 56 ACALL YSH1S
017E 2103 57 AJMP KEY0
0180 22 58 RET
A51 MACRO ASSEMBLER 綺阵式键臺的识_餩_二__ 05/15/2008 16:00:32 PAGE 2
0181 75B01B 59 K8: MOV P3,#1BH ;8
0184 31C1 60 ACALL YSH1S
0186 2103 61 AJMP KEY0
0188 22 62 RET
0189 75B02B 63 K9: MOV P3,#2BH ;9
018C 31C1 64 ACALL YSH1S
018E 2103 65 AJMP KEY0
0190 22 66 RET
0191 75B04B 67 K10: MOV P3,#4BH ;A
0194 31C1 68 ACALL YSH1S
0196 2103 69 AJMP KEY0
0198 22 70 RET
0199 75B08B 71 K11: MOV P3,#8BH ;b
019C 31C1 72 ACALL YSH1S
019E 2103 73 AJMP KEY0
01A0 22 74 RET
01A1 75B017 75 K12: MOV P3,#17H ;C
01A4 31C1 76 ACALL YSH1S
01A6 2103 77 AJMP KEY0
01A8 22 78 RET
01A9 75B027 79 K13: MOV P3,#27H ;d
01AC 31C1 80 ACALL YSH1S
01AE 2103 81 AJMP KEY0
01B0 22 82 RET
01B1 75B047 83 K14: MOV P3,#47H ;E
01B4 31C1 84 ACALL YSH1S
01B6 2103 85 AJMP KEY0
01B8 22 86 RET
01B9 75B087 87 K15: MOV P3,#87H ;F
01BC 31C1 88 ACALL YSH1S
01BE 2103 89 AJMP KEY0
01C0 22 90 RET
91 ;延时子程序
01C1 7B05 92 YSH1S: MOV R3,#05H
01C3 7CA8 93 LOOP: MOV R4,#0A8H
01C5 7D8A 94 LOOP1: MOV R5,#08AH
01C7 DDFE 95 XHD: DJNZ R5,XHD
01C9 DCFA 96 DJNZ R4,LOOP1
01CB DBF6 97 DJNZ R3,LOOP
01CD 22 98 RET
99 END
A51 MACRO ASSEMBLER 綺阵式键臺的识_餩_二__ 05/15/2008 16:00:32 PAGE 3
SYMBOL TABLE LISTING
------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES
K0 . . . . . . . . C ADDR 0141H A
K1 . . . . . . . . C ADDR 0149H A
K10. . . . . . . . C ADDR 0191H A
K11. . . . . . . . C ADDR 0199H A
K12. . . . . . . . C ADDR 01A1H A
K13. . . . . . . . C ADDR 01A9H A
K14. . . . . . . . C ADDR 01B1H A
K15. . . . . . . . C ADDR 01B9H A
K2 . . . . . . . . C ADDR 0151H A
K3 . . . . . . . . C ADDR 0159H A
K4 . . . . . . . . C ADDR 0161H A
K5 . . . . . . . . C ADDR 0169H A
K6 . . . . . . . . C ADDR 0171H A
K7 . . . . . . . . C ADDR 0179H A
K8 . . . . . . . . C ADDR 0181H A
K9 . . . . . . . . C ADDR 0189H A
KEY0 . . . . . . . C ADDR 0103H A
LOOP . . . . . . . C ADDR 01C3H A
LOOP1. . . . . . . C ADDR 01C5H A
MAIN . . . . . . . C ADDR 0100H A
P0 . . . . . . . . D ADDR 0080H A
P3 . . . . . . . . D ADDR 00B0H A
XHD. . . . . . . . C ADDR 01C7H A
YSH1S. . . . . . . C ADDR 01C1H A
REGISTER BANK(S) USED: 0
ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S)