导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→新手:关于用KEIL 调试中的问题,请高手看过来[guest]

 *第24012篇: 新手:关于用KEIL 调试中的问题,请高手看过来

  
楼 主:guest 2004年7月23日11:08
 新手:关于用KEIL 调试中的问题,请高手看过来
我用KEIL调试以下程序是出现这样的对话框提示:
Error:Could not load file 'C:\Documents and Settings\adminstrator\My Documents\DIANJI'
Debugger aborted!
请帮我看看这是什么原因吧,我的程序如下:#include   <reg51.h>  
#define DL 500;
#define DR 1;
#define uchar unsigned char;
#define uint unsigned int;

void dlms (uint x);

void ctrl (cf,n){
bit cf;
uint n;
{ uint i;
  uchar j=0x01;
  if (cf=0) for (i=0;i  <n;i++)
          {P1 = j;
           dlms (DL);
           j=j  <  <1;
           if ((j==0x04)) j=0x01;
 }
else
 {for (i=0;i  <n;i++)
   {P1 = j;
    dlms (DL);
    j=j>  >  1;
    if (j==0) j=0x04;
    }
 }
}

void main (void)
{
   if (DR==1) ctrl(1,100);
    else ctrl(0,100);
}
           

  
2楼:guest 2004年7月23日12:07
 你这个C源代码写的不太好
你这个C源代码写的不太好
  
3楼:guest 2004年7月23日12:09
 #include <reg51.h>

#include   <reg51.h>  
#define DL 500;
#define DR 1;
#define uchar unsigned char
#define uint unsigned int

void dlms (uint x);
void ctrl(bit cf,uint n);

void ctrl (bit cf,uint n)

{ uint idata i;
  uchar idata j=0x01;
  if (!cf)
  for (i=0;i  <n;i++)
          {P1 = j;
           dlms(500);
           j=j  <  <1;
           if ((j==0x04)) j=0x01;
 }
else
 {for (i=0;i  <n;i++)
   {P1 = j;
    dlms (500);
    j=j>  >  1;
    if (j==0) j=0x04;
    }
}
}

void main (void)
{
 char idata DR_T;
 DR_T=DR;
  if (DR_T==1) ctrl(1,100);
    else ctrl(0,100);
}
           
void dlms (uint x)
{

}
我大致的修改了一下,你的代码写的象C++代码,C与C++代码在嵌入式中有本质的细节上的不同,是需要注意的!

  
4楼:xiongfoolboy 2004年7月23日14:10
 谢谢上面几位大哥,现在好了
谢谢上面几位大哥,现在好了

>>>>>>对该主题发表你的看法

本主题贴数4,分页: [第1页]


[上一篇主题]:请问用XC95144如何产生MCU可控制的时间延迟逻辑

[下一篇主题]:OKI ARM 快速入门及应用研讨会,开发板等你拿!