標(biāo)題: [求助]這段程序有什么毛病嗎 為什么在 keil上調(diào)試 變量不正確 [打印本頁]

作者: zl90659064    時(shí)間: 2012-10-9 22:05
標(biāo)題: [求助]這段程序有什么毛病嗎 為什么在 keil上調(diào)試 變量不正確

  #include <reg52.h>
        #include <intrins.h>
  在 keil上調(diào)試 為什么變量顯示不正確   

  #include <stdio.h>
   unsigned char disbuff[4]={ 0,0,0,0,};
void Display2(unsigned char *str)
{
 unsigned char astt;
astt=*str;   // 變量不正確 astt=??
astt=*(str+1);  //調(diào)試出現(xiàn)錯(cuò)誤 astt =??
astt=6;  //調(diào)試出現(xiàn)錯(cuò)誤
astt=7;


}

 void  main(  void  )
              {      
  while(1){
   disbuff[0]=1;    //“-”
         disbuff[1]=1;    //“-”
         disbuff[2]=2;    //“-”
    Display2(disbuff);
    printf("helloworld!\n");
        }
     }  






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1