📄 mymain.lst
字号:
C51 COMPILER V7.02b MYMAIN 08/25/2006 12:00:10 PAGE 1
C51 COMPILER V7.02b, COMPILATION OF MODULE MYMAIN
OBJECT MODULE PLACED IN mymain.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE mywork\mymain\mymain.c LARGE INCDIR(c:\t\inc;c:\t\inc) DEBUG OBJECTEXTEND P
-RINT(.\mymain.lst) OBJECT(mymain.obj)
stmt level source
1 //**********************************************************************************
2 //杨屹 2002/08/21 第一版
3 //我的主程序(SNMP网管板)
4 //联系方法:gdtyy@ri.gdt.com.cn(2003/07/31以前有效)
5 //**********************************************************************************
6 //使用方法:
7 //mymain.h+word.h
8 //**********************************************************************************
9 #include <general.h>
*** WARNING C318 IN LINE 9 OF mywork\mymain\mymain.c: can't open file 'general.h'
10 //#include <string.h>
11 //#include <serial.h>
12 //#include <word.h>
13 //#include <ethernet.h>
14 //#include <mymain.h>
15 //#include <mystring.h>
16 //#include <myshell.h>
17 //#include <timer0.h>
18 //#include <SerEEROM.h>
19
20 /*
21 void CfgHost(WORDTABLE *WordTable);
22 void CfgGateway(WORDTABLE *WordTable);
23 void CfgMask(WORDTABLE *WordTable);
24 void CfgSnmpHost(WORDTABLE *WordTable);
25 void PrintARPtable(WORDTABLE *WordTable);
26 void PrintConfig(WORDTABLE *WordTable);
27 void PingCommand(WORDTABLE *WordTable);
28 void UDPCommand(WORDTABLE *WordTable);
29 void CfgMacAddress(WORDTABLE *WordTable);
30 void ListTxBuf(WORDTABLE *WordTable);
31 */
32
33 //void maincycle(void);
34 //long int secondtimer=0;
35 main()
36 {
37 1 static unsigned char ComTable[MaxComNum][MaxLenCom+1]={"rdp","wrbs","wdx","rdx","wxr","clr","help",
*** ERROR C202 IN LINE 37 OF MYWORK\MYMAIN\MYMAIN.C: 'MaxComNum': undefined identifier
*** ERROR C136 IN LINE 37 OF MYWORK\MYMAIN\MYMAIN.C: invalid dimension size: [0]
*** ERROR C136 IN LINE 37 OF MYWORK\MYMAIN\MYMAIN.C: invalid dimension size: [0]
38 1 "exit","rxr","erase66","rd66","wd66","rdb66","host","gateway","mask","snmphost","ls",
39 1 "lc","ping","udp","macadr","lt"};
40 1 int State=StatInputCom;
*** ERROR C202 IN LINE 40 OF MYWORK\MYMAIN\MYMAIN.C: 'StatInputCom': undefined identifier
41 1 unsigned char ch;
42 1 int ShellEnd=0; /*Shell end flag*/
43 1 unsigned char ComBuf[MaxLenComBuf+1]; /*store '\0'*/
*** ERROR C202 IN LINE 43 OF MYWORK\MYMAIN\MYMAIN.C: 'MaxLenComBuf': undefined identifier
*** ERROR C136 IN LINE 43 OF MYWORK\MYMAIN\MYMAIN.C: invalid dimension size: [0]
44 1 int i=-1; /*ComBuf pointer*/
45 1 int tem; /*Temp variable*/
46 1 int ComMatchFlag=0; /*Command match flag*/
47 1
C51 COMPILER V7.02b MYMAIN 08/25/2006 12:00:10 PAGE 2
48 1 WORDTABLE WordTable;
*** ERROR C202 IN LINE 48 OF MYWORK\MYMAIN\MYMAIN.C: 'WORDTABLE': undefined identifier
*** ERROR C141 IN LINE 48 OF MYWORK\MYMAIN\MYMAIN.C: syntax error near 'WordTable'
49 1
50 1 int Matched=0; /*Match flag*/
*** ERROR C141 IN LINE 50 OF MYWORK\MYMAIN\MYMAIN.C: syntax error near 'int'
*** ERROR C202 IN LINE 50 OF MYWORK\MYMAIN\MYMAIN.C: 'Matched': undefined identifier
51 1
52 1 InitSerial();
53 1 InitSerialBuffer();
54 1 initport();
55 1
56 1 initsck();
57 1 ne2000init();
58 1 InitArpTable();
59 1 InitTxBuf();
60 1
61 1 userInit();
62 1
63 1 clrscr();
64 1 PrintStr("\t\t***********************************************\n");
65 1 PrintStr("\t\t* Welcom to use this program *\n");
66 1 PrintStr("\t\t* Author:YangYi 20020715 *\n");
67 1 PrintStr("\t\t***********************************************\n\n\n");
68 1
69 1 /*Login & Password*/
70 1
71 1 PrintStr("% ");
72 1 while(!ShellEnd){
73 2
74 2 switch(State){
75 3 case StatInputCom:{
76 4 if(yygetch(&ch)){
77 5 if(ch==13) /*Enter return key*/
78 5 {
79 6 PrintStr("\n");
80 6 ComBuf[i+1]='\0';
81 6 if(i+1==0) PrintStr("% ");
82 6 else
83 6 State=StatExeCom;
84 6 }
85 5 else{
86 6 i=i+1;
87 6 if((i>=MaxLenComBuf)&&(ch!=8)){
88 7 PrintChar(7);
89 7 i=MaxLenComBuf-1;
90 7 }
91 6 else{
92 7 if(ch==8){
93 8 i=i-2;
94 8 if(i<-1) {i=-1;PrintChar(7);}
95 8 else{
96 9 PrintChar(8);
97 9 PrintChar(' ');
98 9 PrintChar(8);
99 9 }
100 8 }
101 7 else{
102 8 PrintChar(ch);
103 8 ComBuf[i]=ch;
104 8 }
105 7 }
C51 COMPILER V7.02b MYMAIN 08/25/2006 12:00:10 PAGE 3
106 6 }
107 5 break;
108 5 }
109 4 else{
110 5 maincycle();
111 5 break;
112 5 }
113 4 }
114 3 case StatExeCom:{
115 4 if(GetWord(ComBuf,&WordTable)==1&&WordTable.Num!=0){
116 5 yystrlwr(WordTable.wt[0].Str);
117 5 for(tem=0;tem<MaxComNum&&!ComMatchFlag;tem++)
118 5 if(strcmp(WordTable.wt[0].Str,ComTable[tem])==0) ComMatchFlag=1;
119 5 if(ComMatchFlag){
120 6 tem--;
121 6 switch(tem){
122 7 case 0:{DisplayPortValue(&WordTable);break;}
123 7 case 1:{WriteBdSel(&WordTable);break;}
124 7 case 2:{WriteDataX(&WordTable);break;}
125 7 case 3:{ReadDataX(&WordTable);break;}
126 7 case 4:{WriteXReg(&WordTable);break;}
127 7 case 5:{clrscr();break;}
128 7 case 6:{DisplayHelpMenu(&WordTable);break;}
129 7 case 7:{
130 8 //ShellEnd=1;
131 8 PrintStr("This Command is limited!\n");
132 8 break;
133 8 }
134 7 case 8:{ReadXReg(&WordTable);break;}
135 7 case 9:{Erase66(&WordTable);break;}
136 7 case 10:{Read66(&WordTable);break;}
137 7 case 11:{Write66(&WordTable);break;}
138 7 case 12:{ReadByte66(&WordTable);break;}
139 7 case 13:{CfgHost(&WordTable);break;}
140 7 case 14:{CfgGateway(&WordTable);break;}
141 7 case 15:{CfgMask(&WordTable);break;}
142 7 case 16:{CfgSnmpHost(&WordTable);break;}
143 7 case 17:{PrintARPtable(&WordTable);break;}
144 7 case 18:{PrintConfig(&WordTable);break;}
145 7 case 19:{PingCommand(&WordTable);break;}
146 7 case 20:{UDPCommand(&WordTable);break;}
147 7 case 21:{CfgMacAddress(&WordTable);break;}
148 7 case 22:{ListTxBuf(&WordTable);break;}
149 7 }
150 6 }
151 5 else
152 5 PrintStr(" Bad command!\n\n");
153 5 }
154 4 else{
155 5 if(WordTable.Num) PrintStr(" Bad command!\n\n");
156 5 }
157 4
158 4 ComMatchFlag=0;
159 4 State=StatInputCom;
160 4 if(ShellEnd) {PrintStr("\n\n");}
161 4 else PrintStr("% ");
162 4 i=-1;
163 4 break;
164 4 }
165 3 default:{
166 4 //ShellEnd=1;
167 4 PrintStr("System fatal error!\n");
C51 COMPILER V7.02b MYMAIN 08/25/2006 12:00:10 PAGE 4
168 4 PrintChar(7);PrintChar(7);PrintChar(7);
169 4 }
170 3 }
171 2 }
172 1 }
173
174 //temp
175 /*
176 void maincycle(void)
177 {
178 }
179 */
C51 COMPILATION COMPLETE. 1 WARNING(S), 10 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -