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.
i have the followin program float a; long int c; float b;
now i haave an expression a = b- c*0.05
however when i run this expression in simulator the values are correct...however in the machine it gives me some other garbage value...
realtime values are c = 102929 b= 457461
expected value of a = 452314.6 found value of a = 1358481 wat cld be the problem..
What processor/core type?
printf?
debugger?
or what?
8032 generic
its an sprintf();
sprintf(buffer,".2f",a);
values are cumin correct in debugger(simulator)..however if i make the machine write to rs232 or the display its some other value...
Does your project build with zero errors and zero warnings?
nopes there are lots of warning.....but no errors....the code runs...only these values are corrupt...rest all is fine...
linking... *** WARNING L13: RECURSIVE CALL TO SEGMENT
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL .
I have extended the recursive call warning to 100....
and you're surprised that you get corrupt results?!
Fix the warnings!
You're not trying to do something like printf from an ISR, are you...?
That's always a bad thing - doubly so with floating-point on an 8051!!
pardon??