This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

2k limitation code

Hi guys,

I am currently using the evaluation software C51 tool kit to compile my c code into machine code. Apparently, this version of software has a limitation of 2k of object code. At first I thought that will be a .hex file, but then after I manage to squeeze my code size to a size that the version is able to compile (before that it always comes out with a message saying I exceed the 2k limit), I realise that my .hex file is around 8kB, so it is clear that that is not the one. I would like to ask what does it mean by object code? Which will be the file that cannot exceed 2k of size? Shouldn't be the one with .obj as well I think, as those exceed 2k as well.

Thanks guys.

Regards,
Siang

Parents
  • An object file constains a lot of data besides the "machine code" you talk about. The size of the object files will also be affected by debug information. Obviously it wouldn't be good if max size would be affected by the length of your variable names or function names.

    A hex file is just a more verbose representation of a program, where each byte in the processor is represented by two bytes in the hex file. The hex file also contains checksum information, address information etc. Oviously it isn't meaningful to use the size of the hex file.

    The only meaningful way is to count number of bytes inside the processor after a program is loaded.

Reply
  • An object file constains a lot of data besides the "machine code" you talk about. The size of the object files will also be affected by debug information. Obviously it wouldn't be good if max size would be affected by the length of your variable names or function names.

    A hex file is just a more verbose representation of a program, where each byte in the processor is represented by two bytes in the hex file. The hex file also contains checksum information, address information etc. Oviously it isn't meaningful to use the size of the hex file.

    The only meaningful way is to count number of bytes inside the processor after a program is loaded.

Children