Forum : 8051
Post Information | Post |
---|---|
May 17, 2007 - 10:10pm
|
I have a problem with this function: ... at 0x0700 xdata unsigned char tmp_array[128]; ... void store_float_array(unsigned int address, unsigned int item, float value) anythings works fine except line: from unexplained reason this simple count doesnt work. But when I put estimated value directly to variable, everythings works fine. After some experiments I found the solution and changed input parameter type from unsigned int to unsigned char as follows: ... void store_float_array(unsigned int address, unsigned char item, float value) and everythings works fine with unsigned char. Thank you at all Hupi |
1. Compare the assembler generated for the 2 code types
2. In the compiler code-generation options, do you have ANSI char->int promotion on or off?
Steven Pruzina
Hi Steven, thank you for your ideas. I dont have so much time to compare assembler codes, due to my exams season, but I will do this soon. What effect does "ANSI char->int promotion"? I had this switched to on in my project.
Thank you Michal Hupka