📄 main.lst
字号:
C51 COMPILER V8.02 MAIN 09/14/2007 22:10:11 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c LARGE BROWSE DEBUG OBJECTEXTEND
line level source
1 /* 本程序写于2004年9月23日凌晨2点
2 作者:孙尚新
3 联系方式: 2818709199 sunshangxin@hotmail.com */
4 #include <command.h>
5 main()
6 {
7 1 unsigned char ch;
8 1 long i;
9 1 unsigned char str[100],key;
10 1 int num_commands;
11 1 char command[MAX_CMD_LEN];
12 1
13 1
14 1 InitSerial();
15 1 InitSerialBuffer();
16 1 clrscr();
17 1 PrintStr("Crystal is ");
18 1 i = CRYSTAL;
19 1 for(ch = 0;ch<8;ch++)
20 1 {
21 2 str[7-ch] = ('0'+i%10);
22 2 i = i/10;
23 2 }
24 1 str[8] = (unsigned char)0;
25 1 PrintStr(str);
26 1 PrintStr("\r\n");
27 1 PrintStr("Serial is ");
28 1 i = SERBAUD;
29 1 for(ch = 0;ch<6;ch++)
30 1 {
31 2 str[5-ch] = ('0'+i%10);
32 2 i = i/10;
33 2 }
34 1 str[6] = (unsigned char)0;
35 1 PrintStr(str);
36 1 PrintStr("\n");
37 1 PrintStr("\r\n");
38 1 prompt();
39 1 i = 0;
40 1 for(;;)
41 1 {
42 2 while(!getch(&key));
43 2 if(key == BACK_KEY)
44 2 {
45 3 if(i>=1)
46 3 {
47 4 i -= i?1:0;
48 4 PrintChar(key);
49 4 PrintChar(' ');
50 4 PrintChar(key);
51 4 }
52 3 }
53 2 else if(key == ENTER_KEY)
54 2 {
55 3 command[i] = 0;
C51 COMPILER V8.02 MAIN 09/14/2007 22:10:11 PAGE 2
56 3 PrintChar('\r');
57 3 PrintChar('\n');
58 3 num_commands = ParseCmd(command, i);
59 3 if(num_commands<0)
60 3 {
61 4 PrintStr("Erroe Command......\r\n");
62 4 prompt();
63 4 }
64 3 else
65 3 {
66 4 prompt();
67 4 }
68 3 i = 0;
69 3 }
70 2 else
71 2 {
72 3 if(i<MAX_CMD_LEN-1)
73 3 {
74 4 command[i++] = key;
75 4 PrintChar(key);
76 4 }
77 3 }
78 2 }
79 1 }
80
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 581 ----
CONSTANT SIZE = 53 ----
XDATA SIZE = ---- 234
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
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 + -