We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
/*******************************************/ /*Name:Main Function */ /* Memory model: LARGE */ unsigned char Temp; unsigned char *pTemp; void func(void); void main(void) { unsigned char i = 6; pTemp = &Temp; *pTemp = 98; func(); i = *pTemp; } /*************************************************/ /*-------------------------------------- compile following program to assembly , then link with the main function.No Error! But the " i " cannot get the number "0xdd". Why and how to chang the assembly . please help me,thank you.! ------------------------------------------*/ #pragma src(MYPTR.A51) large extern unsigned char *pTemp; void func(void) { *pTemp = 0xdd; }
"the compiler generated wrong code for 'i = *pTemp;'." In what way was it "wrong?"