📄 新建.lst
字号:
C51 COMPILER V7.01 __建 03/16/2006 20:50:02 PAGE 1
C51 COMPILER V7.01, COMPILATION OF MODULE __建
OBJECT MODULE PLACED IN C:\DOCUME~1\ADMINI~1\MYDOCU~1\1602-232\新建.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE C:\DOCUME~1\ADMINI~1\MYDOCU~1\1602-232\新建.C DB SB OE
stmt level source
1 #include<reg51.h>
2 #include<intrins.h>
3 #include<stdio.h>
4 #include<absacc.h>
5 #define uchar unsigned char
6 #define uint unsigned int
7
8 sbit bflag=P0^0;
9 sbit rs=P2^0;
10 sbit rw=P2^1;
11 sbit en=P2^2;
12 uchar get[42];
13 uchar getflag=0;
14 static uchar getnum;
15
16 void delay()
17 {uchar j;
18 1 for(j=250;j>0;j--);
19 1 }
20
21 void longdelay(uint s) //长延时,0.25ms
22 {
23 1 while(s--)
24 1 {
25 2 delay();
26 2 }
27 1 }
28
29 //1602程序
30 void en_toggle()
31 {
32 1 en=0;
33 1 //_nop_();
34 1 delay();
35 1 en=1;
36 1 delay();
37 1 // _nop_();
38 1 en=0;
39 1 } //必须加延时
40 void is_ready()
41 {
42 1 P0=0x00;//设置为输入口 ,现实中应该送0xff
43 1 rs=0;
44 1 rw=1;
45 1 en=1;
46 1 while(bflag);
47 1 en=0;
48 1 }
49 void write_cmd(uchar cmd)
50 {
51 1 is_ready();
52 1 rs=0;
53 1 rw=0;
54 1 P0=cmd;
55 1 en_toggle();
C51 COMPILER V7.01 __建 03/16/2006 20:50:02 PAGE 2
56 1 _nop_();
57 1 }
58
59 void display(uchar row,uchar col,uchar indata)//行,位置,字符
60 {uchar p;
61 1 if(row==1)
62 1 {p=0x80+col-1;
63 2 write_cmd(p);}
64 1 else
65 1 {p=0xc0+col-1;
66 2 write_cmd(p);
67 2 }
68 1 is_ready();
69 1 rs=1;
70 1 rw=0;
71 1 P0=indata;
72 1 en_toggle();
73 1 _nop_();
74 1 }
75 void init_lcd()
76 {
77 1 write_cmd(0x38);
78 1 write_cmd(0x0f);
79 1 write_cmd(0x06);
80 1 write_cmd(0x01);
81 1 }
82
83
84 void init_series(void) //串口初始化
85 {SCON=0x50;//方式1,禁止多机通信,允许接收
86 1 TMOD=0x20;//T1工作在方式2下
87 1 PCON=0x00;
88 1 IE=0x90;//T1禁止中断溢出,开中断
89 1 TH1=0xfd;//波特率为:9600
90 1 TL1=0xfd;
91 1 TR1=1;
92 1 }
93
94 void serial()interrupt 4
95 {
96 1 RI=0;
97 1 if(SBUF=='$')
98 1 {getflag=1;}
99 1 if(getflag==1)
100 1 {
101 2 get[getnum]=SBUF;
102 2 getnum++;
103 2 }
104 1 }
105
106 void main()
107 { uchar position,i,j;
108 1 position=0;
109 1 i=0;
110 1 j=1;
111 1 init_lcd(); //初始化1602
112 1 getnum=0;
113 1 init_series(); //初始化串口
114 1
115 1 while(1)
116 1 {
117 2 if(getnum>43)
C51 COMPILER V7.01 __建 03/16/2006 20:50:02 PAGE 3
118 2 {
119 3 IE=0;
120 3 display(1,1,get[27]);
121 3 display(1,3,get[17]);
122 3 display(1,4,get[18]);
123 3 display(1,6,get[19]);
124 3 display(1,7,get[20]);
125 3 display(1,5,get[21]);
126 3 display(1,8,get[22]);
127 3 display(1,9,get[23]);//纬度
128 3
129 3 display(2,1,get[40]);
130 3 display(2,2,get[29]);
131 3 display(2,3,get[30]);
132 3 display(2,4,get[31]);
133 3 display(2,6,get[32]);
134 3 display(2,7,get[33]);
135 3 display(2,5,get[34]);
136 3 display(2,8,get[35]);
137 3 display(2,9,get[36]);//经度
138 3
139 3 }
140 2 }
141 1
142 1 }
C51 COMPILER V7.01 __建 03/16/2006 20:50:02 PAGE 4
NAME CLASS MSPACE TYPE OFFSET SIZE
==== ===== ====== ==== ====== ====
bflag. . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0080H 1
P0 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0080H 1
P2 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A0H 1
serial . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
IE . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A8H 1
delay. . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
j. . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
size_t . . . . . . . . . . . . . . . . TYPEDEF ----- U_INT ----- 2
getnum . . . . . . . . . . . . . . . . STATIC DATA U_CHAR 0000H 1
RI . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 0098H 1
_write_cmd . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
cmd. . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
_longdelay . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
s. . . . . . . . . . . . . . . . . . * REG * DATA U_INT 0004H 2
init_series. . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
main . . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
position . . . . . . . . . . . . . . AUTO DATA U_CHAR 0000H 1
i. . . . . . . . . . . . . . . . . . AUTO DATA U_CHAR 0001H 1
j. . . . . . . . . . . . . . . . . . AUTO DATA U_CHAR 0002H 1
SBUF . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0099H 1
PCON . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0087H 1
SCON . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0098H 1
TMOD . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0089H 1
en_toggle. . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
get. . . . . . . . . . . . . . . . . . PUBLIC DATA ARRAY 0001H 42
init_lcd . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
TH1. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008DH 1
TL1. . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 008BH 1
en . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A2H 1
is_ready . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
TR1. . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 008EH 1
_display . . . . . . . . . . . . . . . PUBLIC CODE PROC 0003H -----
row. . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0007H 1
col. . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0005H 1
indata . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0003H 1
p. . . . . . . . . . . . . . . . . . * REG * DATA U_CHAR 0006H 1
getflag. . . . . . . . . . . . . . . . PUBLIC DATA U_CHAR 002BH 1
rs . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A0H 1
rw . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00A1H 1
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 349 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 44 3
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 + -