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

📄 yyshellsub.lst

📁 UCOS在C51上实现的两个例子
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.50   YYSHELLSUB                                                            04/11/2006 17:11:50 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE YYSHELLSUB
OBJECT MODULE PLACED IN yyshellsub.OBJ
COMPILER INVOKED BY: D:\Keil C\C51\BIN\C51.EXE yyshellsub.c LARGE BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include  <includes.h>
   2          
   3          extern xdata union ip_address_type my_ip_address;       //本机的ip地址
   4          extern xdata union ip_address_type temp_ip_address;     //临时变量
   5          extern xdata union ip_address_type mask_ip_address;     //子网掩码
   6          extern xdata union ip_address_type gateway_ip_address;  //网关的ip地址
   7          extern xdata union ip_address_type ping_ip_address;     //用于ping命令
   8          
   9          extern WORDTABLE WordTable;
  10          
  11          void DisplayTask(WORDTABLE *WordTable) reentrant//显示任务
  12          {
  13   1              PrintStr("\n\tDisplay Task command excuted.\n\n");
  14   1      }
*** WARNING C280 IN LINE 11 OF YYSHELLSUB.C: 'WordTable': unreferenced local variable
  15          
  16          void Kill(WORDTABLE *WordTable) reentrant//杀死任务
  17          {
  18   1              PrintStr("\n\tKill Task command excuted.\n\n");
  19   1      }
*** WARNING C280 IN LINE 16 OF YYSHELLSUB.C: 'WordTable': unreferenced local variable
  20          
  21          void PingCommand(WORDTABLE *WordTable) reentrant//ping命令
  22          {
  23   1              if(WordTable->Num==1)
  24   1                      PrintStr("\n\tPlease input IP address!\n\n");
  25   1              else{
  26   2                      if(IPadrToHEX(WordTable->wt[1].Str,&ping_ip_address)==0){
  27   3                              PrintStr("\n\tIP address error!\n\n");return;
  28   3                      }
  29   2                      else{   
  30   3                              //trans_pack(&txdnet,ping_ip_address,74,PINGTYPE);
  31   3                              PrintStr("\n\tPing command is excuted.\n\n");                   
  32   3                      }
  33   2              }
  34   1      }
  35          
  36          void UDPCommand(WORDTABLE *WordTable) reentrant//udp命令
  37          {
  38   1              if(WordTable->Num==1)
  39   1                      PrintStr("\n\tPlease input IP address!\n\n");
  40   1              else if(WordTable->Num==2){
  41   2                      PrintStr("\n\tPlease input UDP data(String)!\n\n");
  42   2              }
  43   1              else{
  44   2                      if(IPadrToHEX(WordTable->wt[1].Str,&temp_ip_address)==0){
  45   3                              PrintStr("\n\tIP address error!\n\n");return;
  46   3                      }
  47   2                      else{                   
  48   3                              //make_udp(&txdnet,temp_ip_address,WordTable->wt[2].Str,strlen(WordTable->wt[2].Str)+1,1025);
  49   3                              PrintStr("\n\tUDP command is excuted.\n\n");
  50   3                      }
  51   2              }
  52   1      }
  53          
C51 COMPILER V7.50   YYSHELLSUB                                                            04/11/2006 17:11:50 PAGE 2   

  54          void CfgHost(WORDTABLE *WordTable) reentrant//配置主机IP地址
  55          {
  56   1              unsigned char ipstr[16];
  57   1              union ip_address_type tmy_ip_address;
  58   1              
  59   1              if(WordTable->Num==1){
  60   2                      //getadr(HOST,&my_ip_address.bytes[0]);//读出本机IP地址存到my_ip_address.bytes[4]里
  61   2                      PrintStr("\nHOST IP ADDRESS=");
  62   2                      HEXToIPadr(ipstr,&my_ip_address);
  63   2                      PrintStr(ipstr);PrintStr("\n\n");       
  64   2              }
  65   1              else{           
  66   2                      if(IPadrToHEX(WordTable->wt[1].Str,&tmy_ip_address)==0){
  67   3                              PrintStr("\n\tIP address error!\n\n");return;
  68   3                      }
  69   2                      else{
  70   3                              //getadr(HOST,&temp_ip_address.bytes[0]);//读出本机IP地址存到my_ip_address.bytes[4]里
  71   3                              temp_ip_address.dwords=my_ip_address.dwords;
  72   3                              
  73   3                              PrintStr("\nOLD HOST IP ADDRESS=");
  74   3                              HEXToIPadr(ipstr,&temp_ip_address);
  75   3                              PrintStr(ipstr);PrintStr("\n");
  76   3      
  77   3                              //setadr(HOST,&tmy_ip_address.bytes[0]);                        
  78   3                              //getadr(HOST,&my_ip_address.bytes[0]);
  79   3                              my_ip_address.dwords=tmy_ip_address.dwords;
  80   3                              
  81   3                              PrintStr("\nNEW HOST IP ADDRESS=");
  82   3                              HEXToIPadr(ipstr,&my_ip_address);
  83   3                              PrintStr(ipstr);PrintStr("\n\n");
  84   3                      }               
  85   2              }
  86   1      }
  87          
  88          void CfgMask(WORDTABLE *WordTable) reentrant//配置子网掩码
  89          {
  90   1              unsigned char ipstr[16];
  91   1              union ip_address_type tmask_ip_address;
  92   1      
  93   1              if(WordTable->Num==1){
  94   2                      //getadr(MASK,&mask_ip_address.bytes[0]);//读出本机掩码存到mask_ip_address.bytes[4]里
  95   2                      PrintStr("\nSUBNET MASK=");
  96   2                      HEXToIPadr(ipstr,&mask_ip_address);
  97   2                      PrintStr(ipstr);PrintStr("\n\n");
  98   2              }
  99   1              else{           
 100   2                      if(IPadrToHEX(WordTable->wt[1].Str,&tmask_ip_address)==0){
 101   3                              PrintStr("\n\tSUBNET MASK error!\n\n");return;
 102   3                      }
 103   2                      else{
 104   3                              //getadr(MASK,&temp_ip_address.bytes[0]);//读出本机IP地址存到my_ip_address.bytes[4]里
 105   3                              temp_ip_address.dwords=mask_ip_address.dwords;
 106   3                              
 107   3                              PrintStr("\nOLD SUBNET MASK=");
 108   3                              HEXToIPadr(ipstr,&temp_ip_address);
 109   3                              PrintStr(ipstr);PrintStr("\n");
 110   3      
 111   3                              //setadr(MASK,&tmask_ip_address.bytes[0]);
 112   3                              //getadr(MASK,&mask_ip_address.bytes[0]);
 113   3                              mask_ip_address.dwords=tmask_ip_address.dwords;
 114   3                              
 115   3                              PrintStr("\nNEW SUBNET MASK=");
C51 COMPILER V7.50   YYSHELLSUB                                                            04/11/2006 17:11:50 PAGE 3   

 116   3                              HEXToIPadr(ipstr,&mask_ip_address);
 117   3                              PrintStr(ipstr);PrintStr("\n\n");                       
 118   3                      }               
 119   2              }
 120   1      }
 121          
 122          void CfgGateway(WORDTABLE *WordTable) reentrant//配置网关IP地址
 123          {
 124   1              unsigned char ipstr[16];
 125   1              union ip_address_type tgateway_ip_address;
 126   1      
 127   1              if(WordTable->Num==1){
 128   2                      //getadr(GATEWAY,&gateway_ip_address.bytes[0]);//读出网关IP地址存到gateway_ip_address.bytes[4]里                
 129   2                      PrintStr("\nGATEWAY IP ADDRESS=");
 130   2                      HEXToIPadr(ipstr,&gateway_ip_address);
 131   2                      PrintStr(ipstr);PrintStr("\n\n");
 132   2              }
 133   1              else{           
 134   2                      if(IPadrToHEX(WordTable->wt[1].Str,&tgateway_ip_address)==0){
 135   3                              PrintStr("\n\tIP address error!\n\n");return;
 136   3                      }
 137   2                      else{
 138   3                              //getadr(GATEWAY,&temp_ip_address.bytes[0]);//读出本机IP地址存到my_ip_address.bytes[4]里
 139   3                              temp_ip_address.dwords=gateway_ip_address.dwords;

⌨️ 快捷键说明

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