|
在跟踪 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[p] | (UNIC[p+1]<<8);
c1 = UNICicon[p]; // 这行
c2 = UNICicon[p+1];
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) |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|