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

📄 xsj_liudong_car.lst

📁 基于89c2051开发的ptr8000一对多无线通信程序.
💻 LST
字号:
C51 COMPILER V6.23a  XSJ_LIUDONG_CAR                                                       01/04/2000 07:41:01 PAGE 1   


C51 COMPILER V6.23a, COMPILATION OF MODULE XSJ_LIUDONG_CAR
OBJECT MODULE PLACED IN xsj_liudong_car.OBJ
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE xsj_liudong_car.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          #include <reg51.h>
   2          #include <absacc.h> 
   3          #include <stdio.h>
   4          unsigned char TLV=0x00;
   5          unsigned char THV=0xe7;
   6          unsigned short SECTICKS=240; //24; //65536/(65536-(THV*256+TLV))*18;
   7          unsigned short HALFSECTICKS=120; //12;
   8          unsigned char sbuff[7];
   9          unsigned char count=0,triggle=0,chno=0;
  10          unsigned char ticks=0,oldP1Stat;
  11          sbit RLed = P1^3;
  12          bit direction=0,direction1=0,direction2=0;
  13          /*void delay()
  14          {
  15           unsigned short i,j;
  16           for(i=0;i<30;i++) j=i;
  17          }*/
  18          void t0int() interrupt 1
  19          {
  20   1       //unsigned char i;
  21   1       TH0=THV; //Bcause TLV=0,no need to init TL0;
  22   1       count++;
  23   1       if ((oldP1Stat&0x10)==0x10 && (P1&0x10)==0x00) //UP triggle.
  24   1       {
  25   2        if ((P1&0x20)==0x20) direction1=1;
  26   2        else direction1=0;
  27   2       }
  28   1       if ((oldP1Stat&0x20)==0x20 && (P1&0x20)==0x00) //UP triggle.
  29   1       {
  30   2        if ((P1&0x10)==0x10) direction2=1;
  31   2        else direction2=0;
  32   2       }
  33   1       if(direction1 && !direction2) direction=1;
  34   1       if(!direction1 && direction2) direction=0;
  35   1       if((oldP1Stat^P1) & 0x10) ticks++;
  36   1       if((oldP1Stat^P1) & 0x20) ticks++;
  37   1       oldP1Stat=P1;
  38   1       if(count == HALFSECTICKS)
  39   1       {
  40   2        RLed=1;
  41   2        //triggle=1;
  42   2       }
  43   1       if(count == SECTICKS)
  44   1       {
  45   2        count=0; 
  46   2        RLed=0;
  47   2        sbuff[3]=P1;
  48   2        //Notice P1 had been modified.
  49   2        if (direction) sbuff[3]=sbuff[3] | 0x20;
  50   2        else sbuff[3]=(sbuff[3] & 0xDF);
  51   2        sbuff[4]=ticks;
  52   2        ticks=0;
  53   2        triggle=1;
  54   2       }
  55   1      }
C51 COMPILER V6.23a  XSJ_LIUDONG_CAR                                                       01/04/2000 07:41:01 PAGE 2   

  56          void main (void)
  57          {
  58   1       unsigned char i;
  59   1       sbuff[0]=0xD7;
  60   1       sbuff[1]=6;
  61   1       sbuff[2]='S';
  62   1       sbuff[5]=0;
  63   1       sbuff[6]='E';
  64   1       SCON  = 0x50;                  /* SCON: mode 1, 8-bit UART, enable rcvr      */
  65   1       TMOD |= 0x21;               /* TMOD: timer 1, mode 2, 8-bit reload        */
  66   1       TH1   = 0xd8; //1200bps .0xfb; // 9600 bps,0xd8;        /* TH1:  reload value for 1200 baud @ 18.432MHz  
             - */
  67   1       TR1   = 1;                  /* TR1:  timer 1 run                          */
  68   1       TR0   = 1;
  69   1       TI    = 1;
  70   1       oldP1Stat=P1;
  71   1       IE    = 0x82;
  72   1       while (1)
  73   1       {
  74   2        if (triggle)
  75   2        {
  76   3         triggle=0; 
  77   3         for(i=0;i<7;i++) putchar(sbuff[i]);
  78   3        }
  79   2       }
  80   1      }
  81          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    220    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     18       1
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      3    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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