⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myshell.lst

📁 此代码是实现将lwip协议移植于51单片机的测试程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.02b   MYSHELL                                                              08/25/2006 12:00:12 PAGE 1   


C51 COMPILER V7.02b, COMPILATION OF MODULE MYSHELL
OBJECT MODULE PLACED IN myshell.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE mywork\myshell\myshell.c LARGE INCDIR(c:\t\inc;c:\t\inc) DEBUG OBJECTEXTEND
                    - PRINT(.\myshell.lst) OBJECT(myshell.obj)

stmt level    source

   1          //**********************************************************************************
   2          //杨屹    2002/08/21    第一版
   3          //shell界面命令执行程序
   4          //联系方法:gdtyy@ri.gdt.com.cn(2003/07/31以前有效)
   5          //**********************************************************************************
   6          #include <general.h>
*** WARNING C318 IN LINE 6 OF mywork\myshell\myshell.c: can't open file 'general.h'
   7          //#include <string.h>
   8          //#include <mystring.h>
   9          //#include <serial.h>
  10          //#include <SerEEROM.h>
  11          //#include <word.h>
  12          //#include <myshell.h>
  13          //#include <myconfig51.h>
  14          
  15          //Command execute.
  16          void WriteBdSel(WORDTABLE *WordTable)//输出板选4bit16板位
*** ERROR C141 IN LINE 16 OF MYWORK\MYSHELL\MYSHELL.C: syntax error near '*', expected ')'
  17          {
  18   1              long int Num;
  19   1      
  20   1              if(WordTable->Num==1) PrintStr("Syntax error!\7\n");
*** ERROR C202 IN LINE 20 OF MYWORK\MYSHELL\MYSHELL.C: 'WordTable': undefined identifier
  21   1              else{
  22   2                      if(StrToNum(WordTable->wt[1].Str,&Num)==0) PrintStr("Board number error!\7\n");
  23   2                      else{
  24   3                              opBoardSel(Num);PrintStr("Sir:Write board select finished!\n");
  25   3                      }
  26   2              }
  27   1      }
  28          
  29          void WriteDataX(WORDTABLE *WordTable)//向X5045中给定地址写入数据
  30          {
  31   1              long int Num;
  32   1              int i,adr,len,tadr;
  33   1              unsigned char WIP,dat[MaxLenWordTable-1];
  34   1      
  35   1              if(WordTable->Num<3) PrintStr("Syntax error!\7\n");
  36   1              else{
  37   2                      if(StrToNum(WordTable->wt[1].Str,&Num)==0) PrintStr("Address error!\7\n");
  38   2                      else{
  39   3                              if((strcmp(WordTable->wt[2].Str,"x")==0)|(strcmp(WordTable->wt[2].Str,"X")==0)){
  40   4                                      adr=Num;len=WordTable->Num-3;
  41   4                                      for(i=0;i<len;i++){
  42   5                                              if(StrToHEX(WordTable->wt[i+3].Str,&Num)==0){PrintStr("Data error!\7\n");return;}
  43   5                                              dat[i]=Num;
  44   5                                      }                               
  45   4                                      for(i=0;i<len;i++){
  46   5                                      //
  47   5                                      do{
  48   6                                              opx5045(RDSR,0,0,&WIP);
  49   6                                      }while((WIP&0x1)==1);
  50   5                                      //
  51   5                                      tadr=adr;tadr=tadr+i;tadr=tadr&0x1FF;
C51 COMPILER V7.02b   MYSHELL                                                              08/25/2006 12:00:12 PAGE 2   

  52   5                                      opx5045(WREN,tadr,1,&dat[i]);
  53   5                                      opx5045(WRITE,tadr,1,&dat[i]);                                                  
  54   5                                      }
  55   4                                      PrintStr("Sir:Write X5045 finished!\n");
  56   4                              }
  57   3                              else{                   
  58   4                                      adr=Num;len=WordTable->Num-2;
  59   4                                      for(i=0;i<len;i++){
  60   5                                              if(StrToNum(WordTable->wt[i+2].Str,&Num)==0){PrintStr("Data error!\7\n");return;}
  61   5                                              dat[i]=Num;
  62   5                                      }
  63   4                                      for(i=0;i<len;i++){
  64   5                                      //                              
  65   5                                      do{
  66   6                                              opx5045(RDSR,0,0,&WIP);
  67   6                                      }while((WIP&0x1)==1);
  68   5                                      //
  69   5                                      tadr=adr;tadr=tadr+i;tadr=tadr&0x1FF;                           
  70   5                                      opx5045(WREN,tadr,1,&dat[i]);
  71   5                                      opx5045(WRITE,tadr,1,&dat[i]);                                          
  72   5                                      }
  73   4                                      PrintStr("Sir:Write X5045 finished!\n");
  74   4                              }
  75   3                      }
  76   2              }
  77   1      }
  78          
  79          void ReadDataX(WORDTABLE *WordTable)//读出X5045给定地址数据
  80          {
  81   1              long int Num;
  82   1              int i,j,adr,LineNum;
  83   1              unsigned char dat[ROMSIZE];
  84   1              unsigned char ch;
  85   1      
  86   1              if(WordTable->Num==1) {adr=0;LineNum=1;}
  87   1              else if(WordTable->Num==2){
  88   2                      if(StrToNum(WordTable->wt[1].Str,&Num)==0){PrintStr("Address error!\7\n");return;}
  89   2                      adr=Num;LineNum=1;
  90   2              }
  91   1              else{
  92   2                      if(StrToNum(WordTable->wt[1].Str,&Num)==0){PrintStr("Address error!\7\n");return;}
  93   2                      adr=Num;
  94   2                      if(StrToNum(WordTable->wt[2].Str,&Num)==0){PrintStr("Line number error!\7\n");return;}
  95   2                      LineNum=Num;
  96   2              }
  97   1              if(LineNum>(ROMSIZE/16)){PrintStr("Line number error!\7\n");return;}
  98   1              opx5045(READ,adr,LineNum*16,dat);
  99   1              for(i=0;i<LineNum;i++){
 100   2                      adr=adr&0x1FF;
 101   2                      ch=adr>>8;PrintByte(ch);ch=adr&0xFF;PrintByte(ch);PrintStr("  ");adr=adr+0x10;
 102   2                      for(j=0;j<8;j++){
 103   3                              PrintByte(dat[i*16+j]);
 104   3                              PrintStr(" ");                  
 105   3                      }
 106   2                      PrintStr("    ");
 107   2                      for(j=0;j<8;j++){
 108   3                              PrintByte(dat[i*16+j+8]);
 109   3                              PrintStr(" ");                  
 110   3                      }
 111   2                      PrintStr("   ");
 112   2                      for(j=0;j<16;j++){
 113   3                              ch=dat[i*16+j];
C51 COMPILER V7.02b   MYSHELL                                                              08/25/2006 12:00:12 PAGE 3   

 114   3                              if((ch>=0x20)&&(ch<=0x7F))      PrintChar(ch);
 115   3                              else PrintChar('.');
 116   3                      }
 117   2                      PrintStr("\n");
 118   2              }
 119   1      }
 120          
 121          void WriteXReg(WORDTABLE *WordTable)//写X5045寄存器
 122          {
 123   1              long int Num;
 124   1              unsigned char dat;
 125   1      
 126   1              if(WordTable->Num==1) PrintStr("Syntax error!\7\n");
 127   1              else{
 128   2                      if(StrToNum(WordTable->wt[1].Str,&Num)==0) PrintStr("Data error!\7\n");
 129   2                      else{
 130   3                              dat=Num;                        
 131   3                              opx5045(WRSR,0,0,&dat);PrintStr("Sir:Write X5045 register finished!\n");
 132   3                      }
 133   2              }
 134   1      }
 135          
 136          void ReadXReg(WORDTABLE *WordTable)//读X5045寄存器
 137          {
 138   1              unsigned char dat;
 139   1              opx5045(RDSR,0,0,&dat);
 140   1              PrintStr("RDSR=");PrintByte(dat);PrintStr("H\n");
 141   1      }
 142          
 143          void Erase66(WORDTABLE *WordTable)//擦除93LC66B
 144          {
 145   1              long int Num;
 146   1              unsigned char adr;
 147   1              unsigned int dat;
 148   1              unsigned char ch;
 149   1      
 150   1              if(WordTable->Num==1) PrintStr("Syntax error!\7\n");
 151   1              else{
 152   2                      yystrlwr(WordTable->wt[1].Str);
 153   2                      if(strcmp(WordTable->wt[1].Str,"all")==0){
 154   3                              PrintStr("This command is too danger!Are you sure to run?(Y/N)");
 155   3                              while(yygetch(&ch)==0);
 156   3                              if(ch!='y'&&ch!='Y'){PrintStr("\n\nAbort!\7\7\7\n");return;}
 157   3                              op93LC66B(EWEN,0,0,&dat);
 158   3                              op93LC66B(ERAL,0,0,&dat);
 159   3                              op93LC66B(EWDS,0,0,&dat);
 160   3                              PrintStr("\n\nSir:Erase all 93LC66B finished!\n");
 161   3                      }
 162   2                      else if(StrToNum(WordTable->wt[1].Str,&Num)==0) PrintStr("Data error!\7\n");
 163   2                      else{
 164   3                              adr=Num;                        
 165   3                              op93LC66B(EWEN,0,0,&dat);
 166   3                              op93LC66B(ERASE,adr,0,&dat);
 167   3                              op93LC66B(EWDS,0,0,&dat);
 168   3                              PrintStr("Sir:Erase 93LC66B finished!\n");
 169   3                      }
 170   2              }
 171   1      }
 172          
 173          void Read66(WORDTABLE *WordTable)//按字读93LC66B数据
 174          {
 175   1              long int Num;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -