How much memory program occupy

Thread Starter

mukesh1

Joined Mar 22, 2020
68
When you write program for any microcontroller. How do you find how much memory, program occupy.

I work with XC8. I have no idea. Does complier tell size of your program?
 

Papabravo

Joined Feb 24, 2006
21,157
When you write program for any microcontroller. How do you find how much memory, program occupy.

I work with XC8. I have no idea. Does complier tell size of your program?
Most compilers will provide a listing that shows the memory used by the program. If the compiler allows you to combine "relocatable modules" into a single executable, this is often called a "linkage editor" map. This information should be produced by default, but in some cases you may have to look for a configuration option to turn it on.

Looking at the hex files is a good idea, but doesn't tell you much about the individual nodules. It can also trick you if the code does not reside in a single contiguous block. The linkage editor map is the way to go if you're looking for details.
 
Top