?? key.lst
字號:
C51 COMPILER V7.00 KEY 05/22/2007 16:53:20 PAGE 1
C51 COMPILER V7.00, COMPILATION OF MODULE KEY
OBJECT MODULE PLACED IN Key.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Key.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include <reg52.h>
2 #include<intrins.h>
3 #define uchar unsigned char
4 #define uint unsigned int
5 #define ulint unsigned long int
6 sbit ACC_0 =ACC^0;
7 sbit KeyButton =P1^6;
8 sbit Button1 =P2^0;
9 #define Keyio P0
10 uchar code Kconst=0x75;//1為重復輸出,0不重復
11 uchar Kinput;
12 uchar Ktemp;
13 uchar Kstore;
14 uchar Kready;
15 uchar Koutput;
16
17 /*code uchar value[16]=
18 {
19 0x01,0x02,0x03,0x0a,
20 0x04,0x05,0x06,0x0b,
21 0x07,0x08,0x09,0x0c,
22 0x0e,0x00,0x0f,0x0d
23 }; */
24
25 uchar Key(void)
26 {
27 1 uchar i,temp;
28 1 temp=0xfe;
29 1 Kinput=0;
30 1 for(i=0;i<8;i++)
31 1 {
32 2 KeyButton=1;
33 2 Keyio=temp;
34 2 KeyButton=1;
35 2 KeyButton=1;
36 2 KeyButton=1;
37 2 KeyButton=1;
38 2 KeyButton=1;
39 2 if(KeyButton==0)
40 2 Kinput|=(~Keyio);
41 2 temp=_crol_(temp,1);//不帶進位的左移
42 2 }
43 1 Button1=1;
44 1 if(Button1==0)
45 1 Kinput=0x3;
46 1 Keyio=0xff;
47 1 Kready=Ktemp&Kinput|Kready&(Ktemp^Kinput);
48 1 Ktemp=Kinput;
49 1
50 1 /*以下表示式用于輸出重復鍵和非重復鍵*/
51 1 if(Kready!=0x3)
52 1 Koutput=Kready&(~Kstore|Kconst);
53 1 else
54 1 Koutput=Kready&(~Kstore);
55 1
C51 COMPILER V7.00 KEY 05/22/2007 16:53:20 PAGE 2
56 1 Kstore=Kready;
57 1 return Koutput;
58 1 }
59
60
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 99 ----
CONSTANT SIZE = 1 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 5 ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -