risha wrote:
Thank u for the reply sir. But the mistake lies on my part in not
making things clear. For conveinence I have numbered the prm
statements.
1.void FlashReadM(volatile unsigned long *fl_ad,unsigned long abb) {
2. unsigned long ulvald;
3. abb=2;
4. ulvald=0;
5. //fl_ad=(volatile unsigned long *)0x8020;
6. ulvald = *(fl_ad);
7. return ulvald;
}
************************************************** *****************
1> My question is in line #4 the varaible ulvald is assigned 0 after
line #4 is executed it should have initialzed the variable ulvald as
0 at this point. (memory in the debugger window indicates junk value)
What sort of optimization is the compiler doing? There is no
reason for it to generate any code for line 4, because that value
is never used, and is immediately overwritten by line 6.
BTW, please DO NOT use nuisance abbreviations such as 'u' or
'prm'. They only serve to make your article hard to read and to
annoy.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson