📄 checker.lst
字号:
C51 COMPILER V7.06 CHECKER 07/12/2007 15:01:12 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE CHECKER
OBJECT MODULE PLACED IN checker.OBJ
COMPILER INVOKED BY: D:\Keil 51\setup\C51\BIN\C51.EXE checker.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include<reg51.h>
2 #define uchar unsigned char
3 #define uint unsigned int
4
5 #define TRUE 1
6 #define FAULSE 0
7 #define scan P2
8
9 sbit L1=P2^0;
10 sbit L2=P2^1;
11 sbit L3=P2^2;
12 sbit L4=P2^3;
13 sbit C1=P2^4;
14 sbit C2=P2^5;
15 sbit C3=P2^6;
16 sbit C4=P2^7;
17 uchar key=0;
18 /****************check if any key pressed*********************/
19
20 bit CheckState(void)
21 {
22 1 bit key=0;
23 1 uchar state=0;
24 1 scan=0x0F; //scan key
25 1 state=scan; //get kay state
26 1 if(state!=0x0F)key=TRUE; //check if any key pressed
27 1 else key=FAULSE;
28 1 return(key);
29 1 }
30
31 /****************** ckeck whitch key pressed*****************/
32
33 uchar GetKeys(void)
34 {
35 1 scan=0xFF;
36 1 if(L1==0) //line 1 have key pressed
37 1 {
38 2 if(C1==0)key=0x11;
39 2 else if(C2==0)key=0x21;
40 2 else if(C3==0)key=0x41;
41 2 else key=0x81;
42 2 }
43 1
44 1 else if(L2==0)
45 1 {
46 2 if(C1==0)key=0x12;
47 2 else if(C2==0)key=0x22;
48 2 else if(C3==0)key=0x42;
49 2 else key=0x82;
50 2 }
51 1
52 1 else if(L3==0)
53 1 {
54 2 if(C1==0)key=0x14;
55 2 else if(C2==0)key=0x24;
C51 COMPILER V7.06 CHECKER 07/12/2007 15:01:12 PAGE 2
56 2 else if(C3==0)key=0x44;
57 2 else key=0x84;
58 2 }
59 1
60 1 else
61 1 {
62 2 if(C1==0)key=0x18;
63 2 else if(C2==0)key=0x28;
64 2 else if(C3==0)key=0x48;
65 2 else key=0x88;
66 2 }
67 1
68 1 return(key);
69 1 }
70
71 void DisplayKey(uchar key)
72 {
73 1 P1=key;
74 1 }
75
76 void main()
77 {
78 1 while(1)
79 1 {
80 2 if(CheckState())key=GetKeys();
81 2 DisplayKey(key);
82 2
83 2 }
84 1 }
85
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 170 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 1 ----
IDATA SIZE = ---- ----
BIT SIZE = ---- 1
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -