关于proteus程序编译的

2019-07-18 09:24发布

各路大神求帮忙,在我在keil里编译程序没有错误,而且hex文件在仿真软件里也能用,可是吧程序复制到prodeus的编译器里就不能用了。。。查了一下说是语言的问题。可是不知道怎么改。求大神们帮忙!!!程序在这儿,谢谢了
#include <reg51.h>
#include <stdio.h>
sbit S1 = P3^0;
sbit S2 = P3^1;
unsigned char code LedChar[] = {
  0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,
  0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E,
};
unsigned char LedBuff[2] = {
0xFF,0xFF
};
unsigned char flag1s = 0;

void main()
{
   unsigned char sec = 0;
   EA = 1;
   TMOD = 0x01;
   TH0 = 0xFC;
   TL0 = 0x67;
   TR0 = 1;
   ET0 = 1;

   while(1)
   {
     if(flag1s == 1)
     {
       flag1s = 0;
       sec++;
       if(sec>=100)
       {
         sec = 0;
       }
       LedBuff[0] = LedChar[sec%10];
       LedBuff[1] = LedChar[sec/10%10];
     }
   }
   
}
void Interrupttimer0() interrupt 1
{

   static unsigned int cnt = 0;
   static unsigned char i = 0;
   TH0 = 0xFC;
   TL0 = 0x67;
   cnt++;
   if(cnt>=1000)
   {
     cnt = 0;
     flag1s = 1;     
   }
   P2 = 0xFF;
  switch(i)
  {
    case 0:S1 = 0;S2 = 1;i++;P2 = LedBuff[0];break;
    case 1:S1 = 1;S2 = 0;i=0;P2 = LedBuff[1];break;
    default:break;
  }
}
发出的警告如下:
"................Program Files (x86)Labcenter Electronicsproteus 8 ProfessionalToolsMAKERunTool.exe" --good-exits=0,1 --executable=C51.exe "..main.c" ROM(SMALL) BROWSE DEBUG CODE OBJECTEXTEND PREPRINT  OBJECT("main.OBJ")
C51 COMPILER V9.02 - SN: Eval VersionCOPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2010
C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)"................Program Files (x86)Labcenter ElectronicsProteus 8 ProfessionalToolsMAKERunTool.exe" --good-exits=0,1 --executable=BL51.exe "main.OBJ" TO "Debug.OMF"  
BL51 BANKED LINKER/LOCATER V6.22 - SN: Eval VersionCOPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2009
*** ERROR L121: IMPROPER FIXUP    MODULE:  MAIN.OBJ (MAIN)    SEGMENT: ABSOLUTE    OFFSET:  000BH
******************************************************************************* RESTRICTED VERSION WITH 0800H BYTE CODE SIZE LIMIT; USED: 00A8H BYTE ( 8%) *make: *** [Debug.OMF] Error 1
******************************************************************************
Program Size: data=15.0 xdata=0 code=312LINK/LOCATE RUN COMPLETE.  0 WARNING(S),  1 ERROR(S)Error code 2

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。