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

📄 main.lst

📁 这是铁路各工区
💻 LST
📖 第 1 页 / 共 3 页
字号:
 224   1       //天数
 225   1       binary_24wcxx.days =(ulong)bcd_24wcxx.days[0]*10000;
 226   1       binary_24wcxx.days+=(ulong)bcd_24wcxx.days[1]*1000 ;
 227   1       binary_24wcxx.days+=(ulong)bcd_24wcxx.days[2]*100  ;
 228   1       binary_24wcxx.days+=(ulong)bcd_24wcxx.days[3]*10   ;
 229   1       binary_24wcxx.days+=(ulong)bcd_24wcxx.days[4]      ;
 230   1      }
 231          /**************************************************/
 232          void disp1(uchar hp)
 233          {uchar i,j,x;
 234   1       uchar *p;
 235   1       if(hp==0)
 236   1       {p=(uchar *)&bcd2_realtime;
 237   2        for(i=0;i<12;i++)
 238   2        {P2=clktab[hp][i];
 239   3         j =regtab[hp][i];
 240   3         j =(j<<4)|(*p++);
 241   3         wr_bc728x(A_BCDReg,j);
C51 COMPILER V6.12  MAIN                                                                   11/29/2007 10:36:15 PAGE 5   

 242   3        }
 243   2       }
 244   1       else if(hp==1)
 245   1       {p=(uchar *)&bcd_24wcxx;
 246   2        p+=7;
 247   2        x=0x0f;
 248   2        for(i=8;i<12;i++,p++)
 249   2        {P2=clktab[hp][i];
 250   3         j =regtab[hp][i];
 251   3         if((*p!=0)||(x!=0x0f)||(i==11))x=*p;
 252   3         j =(j<<4)|x;
 253   3         wr_bc728x(A_BCDReg,j);
 254   3        }
 255   2       }
 256   1       else if(hp==2)
 257   1       {p=(uchar *)&bcd_24wcxx;
 258   2        p+=6;
 259   2        x=0x0f;
 260   2        for(i=7;i<12;i++,p++)
 261   2        {P2=clktab[hp][i];
 262   3         j =regtab[hp][i];
 263   3         if((*p!=0)||(x!=0x0f)||(i==11))x=*p;
 264   3         j =(j<<4)|x;
 265   3         wr_bc728x(A_BCDReg,j);
 266   3        }
 267   2       }
 268   1       else if(hp<29)
 269   1       {p=(uchar *)&bcd_24wcxx;
 270   2        for(i=1;i<7;i++)
 271   2        {P2=clktab[hp][i];
 272   3         j =regtab[hp][i];
 273   3         j =(j<<4)|(*p++);
 274   3         wr_bc728x(A_BCDReg,j);
 275   3        }
 276   2        x=0x0f;
 277   2        for(i=7;i<12;i++,p++)
 278   2        {P2=clktab[hp][i];
 279   3         j =regtab[hp][i];
 280   3         if((*p!=0)||(x!=0x0f)||(i==11))x=*p;
 281   3         j =(j<<4)|x;
 282   3         wr_bc728x(A_BCDReg,j);
 283   3        }
 284   2       }
 285   1      }
 286          
 287          void disp2(uchar hp)
 288          {uchar i,j,x;
 289   1       uchar *p;
 290   1       if(hp==0)
 291   1       {p=(uchar *)&bcd2_realtime;
 292   2        for(i=0;i<12;i++)
 293   2        {P2=clktab[hp][i];
 294   3         j =regtab[hp][i];
 295   3         j =(j<<4)|(*p++);
 296   3         wr_bc728x(A_BCDReg,j);
 297   3        }
 298   2       }
 299   1       else if(hp==1||hp==2)
 300   1       {p=(uchar *)&bcd_24wcxx;
 301   2        p+=6;
 302   2        x=0x0f;
 303   2        for(i=7;i<12;i++)
C51 COMPILER V6.12  MAIN                                                                   11/29/2007 10:36:15 PAGE 6   

 304   2        {P2=clktab[hp][i];
 305   3         j =regtab[hp][i];
 306   3         j =(j<<4)|(*p++);
 307   3         wr_bc728x(A_BCDReg,j);
 308   3        }
 309   2       }
 310   1       else if(hp<29)
 311   1       {p=(uchar *)&bcd_24wcxx;
 312   2        for(i=1;i<12;i++)
 313   2        {P2=clktab[hp][i];
 314   3         j =regtab[hp][i];
 315   3         j =(j<<4)|(*p++);
 316   3         wr_bc728x(A_BCDReg,j);
 317   3        }
 318   2       }
 319   1      }
 320          
 321          void disptime(void)
 322          {rd_date();
 323   1       bcd1_binary_time();
 324   1       timejudge();
 325   1       binary_bcd2_time();
 326   1       P2=0xf7;   //
 327   1       while(rd_bc728x(A_ModReg)!=D_ModReg)wr_bc728x(A_ModReg,D_ModReg);      //工作模式设置
 328   1       disp1(0);
 329   1      }
 330          
 331          void dispall(void)
 332          {uchar hp,i;
 333   1       RST=0;
 334   1       delay(0xff);
 335   1       RST=1;
 336   1       delay(0xff);
 337   1       for(i=0xf7;i>=0xe0;i--)
 338   1       {P2=i;
 339   2        while(rd_bc728x(A_ModReg)!=D_ModReg)wr_bc728x(A_ModReg,D_ModReg);      //工作模式设置
 340   2       }
 341   1       for(hp=0;hp<29;hp++)
 342   1       {if(hp==0)
 343   2        {rd_date();
 344   3         bcd1_binary_time();
 345   3         timejudge();
 346   3         binary_bcd2_time();
 347   3         disp1(hp);
 348   3        }
 349   2        else if(hp==1||hp==2)
 350   2        {rd_24wcxx(addrtab[hp]);
 351   3         datejudge();
 352   3         nextday(hp);
 353   3         binary_bcd();
 354   3         if(flag_key)disp2(hp);
 355   3         else disp1(hp);
 356   3        }
 357   2        else if(hp<29)
 358   2        {rd_24wcxx(addrtab[hp]);
 359   3         datejudge();
 360   3         nextdays(hp);
 361   3         binary_bcd();
 362   3         if(flag_key)disp2(hp);
 363   3         else disp1(hp);
 364   3        }
 365   2       }
C51 COMPILER V6.12  MAIN                                                                   11/29/2007 10:36:15 PAGE 7   

 366   1      }
 367          
 368          void dispone(uchar hp,uchar lp,uchar value)
 369          {P2=clktab[hp][lp];
 370   1       value|=(regtab[hp][lp]<<4);
 371   1       wr_bc728x(A_BCDReg,value);
 372   1       wr_bc728x(0x10,0xff);
 373   1       wr_bc728x(0x19,0xff);
 374   1      }
 375          
 376          void dispstop(uchar hp,uchar lp)
 377          {P2=clktab[hp][lp];
 378   1       wr_bc728x(0x10,0xff);
 379   1       wr_bc728x(0x19,0xff);
 380   1      }
 381          
 382          void dispflicker(uchar hp,uchar lp)
 383          {uchar j;
 384   1       uint i;
 385   1       P2=clktab[hp][lp];
 386   1       i=(0x0001<<regtab[hp][lp]);
 387   1       i^=0xffff;
 388   1       j=(uchar)i;
 389   1       wr_bc728x(0x10,j);
 390   1       i>>=8;
 391   1       j=(uchar)i;
 392   1       wr_bc728x(0x19,j);
 393   1      }
 394          
 395          /*************************************************/
 396          int main(void)
 397          {
 398   1       TMOD=0;
 399   1       TCON=0;
 400   1       SCON=0;
 401   1       IP=0;
 402   1       IE=0;
 403   1       P0=0XFF;
 404   1       P1=0XFF;
 405   1       P2=0XFF;
 406   1       P3=0XFF;
 407   1       flag_key=FALSE;
 408   1       kmg();
 409   1       init_bc728x();
 410   1       init_sd2300api();
 411   1       kmg();
 412   1       dispall();
 413   1       //init_int0();
 414   1       while(1)
 415   1       {kmg();
 416   2        if(flag_key)
 417   2        {if(num_t1>0xf0)
 418   3         keyout();
 419   3        }
 420   2        else if(!INT0)
 421   2        //else if(flag_int0)
 422   2        {if(binary_realtime.minute==0&&binary_realtime.second==0)
 423   3         {while(!wr_control2());
 424   4          dispall();
 425   4          kmg();
 426   4         }
 427   3         else                  //秒中断
C51 COMPILER V6.12  MAIN                                                                   11/29/2007 10:36:15 PAGE 8   

 428   3         {while(!wr_control2());
 429   4          disptime();
 430   4         }
 431   3         while(!INT0)wr_control2();
 432   3         //flag_int0=FALSE;
 433   3        // EX0=1;
 434   3        }
 435   2        //else EX0=1;
 436   2        if(!D)
 437   2        {//EX0=0;
 438   3         ET1=0;
 439   3         init_t0();
 440   3         while(!flag_frame);
 441   3         key();
 442   3         ET1=1;
 443   3         //if(!flag_key)EX0=1;
 444   3        }
 445   2       }
 446   1      }
C51 COMPILER V6.12  MAIN                                                                   11/29/2007 10:36:15 PAGE 9   

NAME                                    CLASS   MSPACE  TYPE    OFFSET  SIZE
====                                    =====   ======  ====    ======  ====


P0 . . . . . . . . . . . . . . . . . .  SFR      DATA   U_CHAR   0080H  1

⌨️ 快捷键说明

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