A51 MACRO ASSEMBLER 綺阵式键臺_氖__餩_一__ 04/29/2009 18:46:43 PAGE 1
MACRO ASSEMBLER A51 V8.00d
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 75A000 4 MAIN: MOV P2,#000H
0103 75B0FE 5 KEY0: MOV P3,#0FEH ;[11111110]FE,置P3.0低电平扫描P3.4~P3.7键值
0106 30B438 6 JNB P3.4,K0
0109 30B53D 7 JNB P3.5,K1
010C 30B642 8 JNB P3.6,K2
010F 30B747 9 JNB P3.7,K3
0112 75B0FD 10 MOV P3,#0FDH ;[11111101]FD,置P3.1低电平扫描P3.4~P3.7键值
0115 30B449 11 JNB P3.4,K4
0118 30B54E 12 JNB P3.5,K5
011B 30B653 13 JNB P3.6,K6
011E 30B758 14 JNB P3.7,K7
0121 75B0FB 15 MOV P3,#0FBH ;[11111011]FB,置P3.2低电平扫描P3.4~P3.7键值
0124 30B45A 16 JNB P3.4,K8
0127 30B55F 17 JNB P3.5,K9
012A 30B664 18 JNB P3.6,K10
012D 30B769 19 JNB P3.7,K11
0130 75B0F7 20 MOV P3,#0F7H ;[11110111]FE,置P3.3低电平扫描P3.4~P3.7键值
0133 30B46B 21 JNB P3.4,K12
0136 30B570 22 JNB P3.5,K13
0139 30B675 23 JNB P3.6,K14
013C 30B77A 24 JNB P3.7,K15
013F 2103 25 AJMP KEY0
26
27 ;键码显示子程序
28 ;----------------------------------------
0141 75A03F 29 K0: MOV P2,#03FH ;0
0144 31C1 30 ACALL YSH1S
0146 2103 31 AJMP KEY0
0148 22 32 RET
0149 75A006 33 K1: MOV P2,#006H ;1
014C 31C1 34 ACALL YSH1S
014E 2103 35 AJMP KEY0
0150 22 36 RET
0151 75A05B 37 K2: MOV P2,#05BH ;2
0154 31C1 38 ACALL YSH1S
0156 2103 39 AJMP KEY0
0158 22 40 RET
0159 75A04F 41 K3: MOV P2,#04FH ;3
015C 31C1 42 ACALL YSH1S
015E 2103 43 AJMP KEY0
0160 22 44 RET
45 ;----------------------------
0161 75A066 46 K4: MOV P2,#066H ;4
0164 31C1 47 ACALL YSH1S
0166 2103 48 AJMP KEY0
0168 22 49 RET
50
0169 75A06D 51 K5: MOV P2,#06DH ;5
016C 31C1 52 ACALL YSH1S
016E 2103 53 AJMP KEY0
0170 22 54 RET
0171 75A07D 55 K6: MOV P2,#07DH ;6
0174 31C1 56 ACALL YSH1S
0176 2103 57 AJMP KEY0
0178 22 58 RET
A51 MACRO ASSEMBLER 綺阵式键臺_氖__餩_一__ 04/29/2009 18:46:43 PAGE 2
0179 75A007 59 K7: MOV P2,#007H ;7
017C 31C1 60 ACALL YSH1S
017E 2103 61 AJMP KEY0
0180 22 62 RET
63 ;--------------------
0181 75A07F 64 K8: MOV P2,#07FH ;8
0184 31C1 65 ACALL YSH1S
0186 2103 66 AJMP KEY0
0188 22 67 RET
0189 75A06F 68 K9: MOV P2,#06FH ;9
018C 31C1 69 ACALL YSH1S
018E 2103 70 AJMP KEY0
0190 22 71 RET
0191 75A077 72 K10: MOV P2,#077H ;A
0194 31C1 73 ACALL YSH1S
0196 2103 74 AJMP KEY0
0198 22 75 RET
0199 75A07C 76 K11: MOV P2,#07CH ;b
019C 31C1 77 ACALL YSH1S
019E 2103 78 AJMP KEY0
01A0 22 79 RET
80 ;------------------------
01A1 75A039 81 K12: MOV P2,#039H ;C
01A4 31C1 82 ACALL YSH1S
01A6 2103 83 AJMP KEY0
01A8 22 84 RET
01A9 75A05E 85 K13: MOV P2,#05EH ;d
01AC 31C1 86 ACALL YSH1S
01AE 2103 87 AJMP KEY0
01B0 22 88 RET
01B1 75A079 89 K14: MOV P2,#079H ;E
01B4 31C1 90 ACALL YSH1S
01B6 2103 91 AJMP KEY0
01B8 22 92 RET
01B9 75A071 93 K15: MOV P2,#071H ;F
01BC 31C1 94 ACALL YSH1S
01BE 2103 95 AJMP KEY0
01C0 22 96 RET
97 ;----------------------
98 ;延时子程序
01C1 7B05 99 YSH1S: MOV R3,#05H
01C3 7CA8 100 LOOP: MOV R4,#0A8H
01C5 7D8A 101 LOOP1: MOV R5,#08AH
01C7 DDFE 102 XHD: DJNZ R5,XHD
01C9 DCFA 103 DJNZ R4,LOOP1
01CB DBF6 104 DJNZ R3,LOOP
01CD 22 105 RET
106 END
A51 MACRO ASSEMBLER 綺阵式键臺_氖__餩_一__ 04/29/2009 18:46:43 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
P2 . . . . . . . . D ADDR 00A0H 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)