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

📄 sectodata.lst

📁 单片机C源程序souce
💻 LST
字号:
C51 COMPILER V7.06   SECTODATA                                                             11/17/2006 09:08:33 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE SECTODATA
OBJECT MODULE PLACED IN sectodata.OBJ
COMPILER INVOKED BY: E:\keil\C51\BIN\C51.EXE sectodata.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          /**************************************
   2          File          :  SECTODATA.C
   3          Project       :  BDTRV20_MCU_V07
   4          Description   :  将秒值转换成时分秒,日月年。秒从1969年1月1日开始计
   5          Created       :  2006.11.7
   6          Last updata   :  
   7          Author        :  Sunzehui   sunzehui@zzvcom.com
   8          Compile Tool  :  Keil uVision2
   9          Target Device :  SST89V564RD
  10          Circuit Board :  BD7700
  11          ************************************
  12          Modification History
  13          ************************************
  14           Version      : v2.0
  15           Date         : MM/DD/YYYY
  16           Modifier     :
  17           Description  :
  18          
  19           **********************************
  20           -- Copyright (c)
  21          *************************************/
  22          
  23          extern unsigned char *sectodata(unsigned long tod)
  24                  {
  25   1              unsigned char xdata hour;
  26   1              unsigned char xdata day;
  27   1              unsigned char xdata minute;
  28   1              unsigned char xdata second;
  29   1              unsigned char xdata month;
  30   1              unsigned int xdata year;
  31   1              unsigned long xdata p;
  32   1      //      unsigned long xdata whole_minutes;
  33   1      //      unsigned long xdata whole_hours;
  34   1      //      unsigned long xdata whole_days;
  35   1              unsigned long xdata whole_days_since_1968;
  36   1              unsigned long xdata leap_year_periods;
  37   1              unsigned long xdata days_since_current_lyear;
  38   1      //      unsigned long xdata whole_years;
  39   1              unsigned long xdata days_since_first_of_year;
  40   1              unsigned long xdata days_to_month;
  41   1              unsigned int DaysToMonth[] = {0,0,31,59,90,120,151,181,212,243,273,304,334};
  42   1              unsigned char xdata b[7];
  43   1              if (tod == 0) return 0;
  44   1      
  45   1           p= tod / 60;//whole_minutes
  46   1          //second = binary - (60 * whole_minutes); /* leftover seconds*/
  47   1              second = tod%60;
  48   1          
  49   1          //minute = whole_minutes - (60 * whole_hours); /* leftover minutes*/
  50   1              minute = p%60;
  51   1              p = p / 60;//whole_hours
  52   1          
  53   1         // hour = whole_hours - (24 * whole_days); /* leftover hours*/
  54   1         hour = p%24;
  55   1          p= p / 24;//whole_days
C51 COMPILER V7.06   SECTODATA                                                             11/17/2006 09:08:33 PAGE 2   

  56   1      
  57   1          whole_days_since_1968 = p;// + 365 + 366;//whole_days
  58   1          leap_year_periods = whole_days_since_1968 / ((4 * 365) + 1);
  59   1          days_since_current_lyear = whole_days_since_1968 % ((4 * 365) + 1);
  60   1          /* if days are after a current leap year then add a leap year period*/
  61   1          if ((days_since_current_lyear >= (31 + 29)))
  62   1              {leap_year_periods++;} 
  63   1          p = (whole_days_since_1968 - leap_year_periods)  / 365;//whole_years
  64   1          days_since_first_of_year = whole_days_since_1968 - (p * 365) - leap_year_periods;
  65   1        
  66   1          if ((days_since_current_lyear <= 365) && (days_since_current_lyear >= 60)) 
  67   1              {days_since_first_of_year++;}
  68   1          year = p + 1980;//68;
  69   1       
  70   1          /* setup for a search for what month it is based on how many days have past*/
  71   1          /* within the current year*/
  72   1          month = 13;
  73   1          days_to_month = 366;
  74   1          while (days_since_first_of_year < days_to_month)
  75   1              { 
  76   2              month--; 
  77   2              days_to_month = DaysToMonth[month]; 
  78   2              if ((month >= 2) && ((year % 4) == 0)) 
  79   2              {days_to_month++;}
  80   2              } 
  81   1          day = days_since_first_of_year - days_to_month + 1;
  82   1              b[0]=hour; //时
  83   1              b[1]=minute;//分
  84   1              b[2]=second;//秒
  85   1              b[3]=year>>8;
  86   1              b[4]=year;//年
  87   1              b[5]=month;//月
  88   1              b[6]=day;  //日
  89   1          return b;
  90   1              }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    793    ----
   CONSTANT SIZE    =     26    ----
   XDATA SIZE       =   ----      38
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----      30
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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