Hi,
I am compiling a source code (implemented by other team in Canada) using Keil (uvision-4) V4.02, C51 (9.01), to generate the hex and map(.m51) files.
When the same source code is compiled by the Canada team from Keil (uvision-4) V4.00a, C51 (9.00), differnt hex and map file output are observed as compared to mine output.
Infact I tried download the same compiler version C51 v 9.00 (as used by the Canada Team) to generate hex and map files, but still I am getting different hex files. Could anyone comment on why I am getting different hex and map files for the same source code compiled using the same compiler?
In short, my question is, is it normal to get different hex and map files while compiling from slightly different version of the compilers (C51 v9.00 Versus C51 v9.01)? If yes then how to get around with this problem?
Will appreciate the co-operation.
Regards Asad
"In short, my question is, is it normal to get different hex and map files while compiling from slightly different version of the compilers (C51 v9.00 Versus C51 v9.01)?"
Highly likely that there will be a difference. Consider why the version number is different. Maybe a bug fix in the code produced, maybe an enhancement in optimisation. What would be the point of a version number change if there were not differences?
"If yes then how to get around with this problem?"
If you consider it to be a problem, then you're far more likely to get identical output if you use the same version of the tools.
Thanks for your reply.
Even after using the same tools, I am getting differences.On careful observation, I find from the map file that one interrupt procedure is displaced 16 bytes in the two comparing map files. This may screwed up the whole address space. Could anyone suggest me how to remove this 16 byte displacement in the two comparing map files?
"When the same source code is compiled ..."
Are you also using the same project files (.uvopt .uvproj)? location of the file within the project can influence the link order, which can influence the linker output.
Same project with the same files - I get the same output.
"Same project with the same files - I get the same output."
Addition ... On the ARM compiler, it is sometimes useful to build and then rebuild before the final output remains the same. It's quite a while since I did any serious development using C51 and can't remember if it is the same for that.
Even after using the same tools, I am getting differences.On careful observation, I find from the map file that one interrupt procedure is displaced 16 bytes in the two comparing map files. same tools, same version, same computer?
just as an example, renaming a variable can lead to a different .hex file.
Occasionally, when I do things like "cleaning up" I compare .hex file before and after a change and usually it works, however as mentioned even the "most insignificant" change can lead to a different .hex.
Erik
PS if you read K&R you will see you have nothing to complain about.
Yes, I am using the same project files. For your comment regarding location of the file within the project, I observed from the map file that the file linking order/sequence are not the same (although all the files and their names are exactly same, just the order is different). And from the procedure disorderness starts, it goes all the way to the end disturbing all the address spaces.
If this is causing the difference then could you please help me how to make sequence of linking same on my computer as that of Canada team.
Yes, I agree that a single variable name change may change the output hex file. I am using 'BeyondCompare3' software to view the differences in the hex file. But when I want to see the difference in the source code files, I cannot find any difference.
Situation seems strange but it is happening to me!
Eric, What is this K&R? Could you please elaborate it (consider me a new bie)?
"If this is causing the difference then could you please help me how to make sequence of linking same on my computer as that of Canada team."
When the development environment is the same and all the source files are the same and the project files are the same, I would expect to see (and do see) the same executable image produced.
What you need to do is look for differences in your setups - And change them so they are the same.
could you please help me how to make sequence of linking same on my computer as that of Canada team.
To absolutely guarantee that you get the same output, you can put together a virtual machine with Keil tools and the project. Use the virtual machine in both locations. You should get the same output.
K&R == ancient mythology
Asad;
Remember the order of compiling is based on the order of the files in the project window. That is why you were ask if you are using the sme project files for both compiles. Adding even a simple text file in the project can change the compile order even though the text file will never be compiled.
Bradford