cancel
Showing results for 
Search instead for 
Did you mean: 

Hex file code size

Yun Chia Hsieh
Associate
Posted on December 13, 2016 at 04:35

Hi,

I'm using IAR to create a hex file which size is 233KB.

However, when I look into the .map file, it told below:

183 710 bytes of readonly   code memory

    4 265 bytes of  readonly  data memory

  62 327 bytes of readwrite  data memory.

The ROM size is 183710+4265=187975.

This is not the same with hex file size.

Which one is correct?

Thanks.

1 REPLY 1
Posted on December 13, 2016 at 04:59

My guess would be all of them are correct.

Your .hex file is a representation of your program's machine code binaries. Each byte is represented by two displayable ASCII values with a value of 0-F. Then the file has the addresses of where the values should go, byte counts, record types, checksums, and a whole whack of colons.

Take a look at the wikipedia entry for Intel Hex Format and all will be revealed. 

https://en.wikipedia.org/wiki/Intel_HEX

 

Andrei from The Great White North