Article transferred from http://blog.csdn.net/gasbi/article/details/6186312
When we compile our code using Keil, the Build Output window below appears:
Program size:code=49220 ro-data=7060 rw-data=264 zi-data=4584
Code: is the amount of space that is consumed
Ro-data : Is read only, the size of the ReadOnly constant (such as const type)
Rw-data: Is read write, initialized or initialized with a value that is not 0 of the size of a readable variable
zi-data : The size of a read-write variable that is Zero Initialize, has no initialization, or has an initialized value of 0
If a variable is initialized to 0, the variable is treated in the same way as an uninitialized Zi in the region.
And in an ARM C program, all uninitialized variables are automatically initialized to 0.
In short, when writing code:
FLASH: Code + ro-data + rw-data
At run time:
RAM: Rw-data + zi-data
(This does not contain stack space ~)
MDK for ARM (Keil) compiled information