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)
2>When it reaches line #6 it should now load the value which is at
address location fl_ad which has the value passed as a parameter in
the function.The value at that location here in my case 0x8020 has
value 0x03.After the execution of line #6 in the debugger window for
memory it should indicate the new value atleast but here it neither
shows 0 in the beginnning nor 3 as the value.So it is junk value
again!!!
3>"what if fl_ad is NULL? check for ptr==Null before dereferencing."
The debugger indicates the correct address 0x8020.Hence not null.
4>so my assumption is that you want to read the value at location
pointed
to by fl_ad,
Absolutely right sir thats what I am trying to do.
Probably since it did not even initiaze i think something is really
wrong here....
I am a student and any help will do me good,(sorry for the long
message)
Thanks in advance,