本帖最后由 457878 于 2012-4-24 09:58 编辑
下面这个,多复位几次堆栈就溢出了。怎么处理?
-
- #include<pic.h>
- #include<math.h>
- __CONFIG(0x3FD4);
- void SoftReset(void)
- { PCLATH = 0;
- asm("GOTO 0x00");
- }
- double tmp1,tmp2,tmp3,tmp4;
- void main(void)
- {
- NOP();
- NOP();
- while(1)
- {
- tmp1 = sqrt(10000);
- tmp2 = sin(10000);
- tmp3 = cos(10000);
- tmp4 = tan(10000);
- NOP();
- if(tmp1 == tmp2 == tmp3 == tmp4)
- {
- NOP();
- }
- NOP();
- NOP();
- SoftReset();
- NOP();
- NOP();
- NOP();
- }
- }
|