ngyg12 发表于 2011-3-11 11:48:46

MDK S3C2440 编译奇怪的问题!

在跟踪 MDK 的汇编代码时,出现了这样的问题:当我在对一个变量进行赋值时,汇编代码有对 PC 的操作,而且在本次函数调用后,就死机了,程序直接进入了void HaltUndef(void)这个函数,不知道为什么,小弟是菜鸟,望大侠们指点。

这个是我调用的函数:

void DisplayUNICicon(ushort startx,ushort starty)
{
colorType color = 0,c1=0,c2=0;
uint p = 0;
ushort endx=0,endy=0,remaind=0;

endx = startx + UNICwidth;
endy = starty + UNICheight;

remaind = (UNICwidth<<1)%4;
remaind = 4 - remaind;
   
for(;endy > starty;endy --)
{
      for(;startx < endx;startx++ )
      {
            //color = UNIC | (UNIC<<8);
                c1 =UNICicon;       // 这行
                c2 =UNICicon;
                c2 <<= 8;               // 这里也是
                color = c1|c2;          
                     
      DrawnPointOnLCD(startx,endy,color,0);         
            p += 2;   
       }
      p+=remaind;
       startx = endx - UNICwidth;
}
}

http://cache.amobbs.com/bbs_upload782111/files_37/ourdev_621665Q2TWWD.png
(原文件名:MDK 编译代码.png)
页: [1]
查看完整版本: MDK S3C2440 编译奇怪的问题!