main.lst

来自「modbus modbus modbus」· LST 代码 · 共 76 行

LST
76
字号
C51 COMPILER V8.01   MAIN                                                                  03/26/2007 20:26:46 PAGE 1   


C51 COMPILER V8.01, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN Main.OBJ
COMPILER INVOKED BY: C:\Program Files\Keil\C51\BIN\C51.EXE Main.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include "reg52.h"
   2          #include<modbus.h>
   3          /*==============*/
   4          /*==系统主函数==*/
   5          /*==============*/
   6          
   7          unsigned char idata MBFrame_OK=0;//接收到一个命令结束,等待处理时为1;否则为0.
   8          unsigned char idata test[5]={0xff,0x00,0x00,0x00,0x00};
   9          int Parameter_Table[10]={0,1,2,3,4,5,6,7,8,9,};
  10          #define Parameter_Num 10 
  11          
  12          void main (void)
  13              {
  14   1           unsigned int temp;
  15   1           MBSerialInit();
  16   1      //       IE    =0x92;
  17   1      //   IP    =0x00;
  18   1               TR0=1;
  19   1           while(1)
  20   1               {
  21   2                       if(MBFrame_OK==1)
  22   2                         {
  23   3                               ModBusProtocolProcess();
  24   3                   temp=Parameter_Table[0];
  25   3                               if((temp&0x8000)==0x8000)
  26   3                                  {
  27   4                                   test[1]=27;//显示负号
  28   4                               temp=temp-1;
  29   4                                   temp=~temp;
  30   4                       test[2] = (unsigned char)(temp/100);
  31   4                       temp=temp-test[2]*100;
  32   4                                   test[3] = (unsigned char)(temp/10);
  33   4                                   temp=temp-test[3]*10;
  34   4                                   test[4] = (unsigned char)(temp%10);
  35   4                       test[0] = 0xff;
  36   4                                      }
  37   3                               else
  38   3                                  { 
  39   4                                   test[1]= (unsigned char)(temp/1000);
  40   4                       temp=temp-test[1]*1000;
  41   4                       test[2] = (unsigned char)(temp/100);
  42   4                       temp=temp-test[2]*100;
  43   4                                   test[3] = (unsigned char)(temp/10);
  44   4                                   temp=temp-test[3]*10;
  45   4                                   test[4] = (unsigned char)(temp%10);
  46   4                       test[0] = 0x00;
  47   4                                   }
  48   3                         }
  49   2               }
  50   1          }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    252    ----
   CONSTANT SIZE    =   ----    ----
C51 COMPILER V8.01   MAIN                                                                  03/26/2007 20:26:46 PAGE 2   

   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     20       2
   IDATA SIZE       =      6    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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