【单片机软硬件开发|keil编译后ROM和RAM变化】KEIL中编译后几个空间大小
1.Code=656:程序代码占用的空间
2.RO-data=https://www.it610.com/article/208:程序中常量占用的空间,只读数据如const+变量类型
3.RW-data=https://www.it610.com/article/0:初值不为0已被初始化的可读/写数据,运行时变量调用到RAM中。
4.ZI-data=https://www.it610.com/article/1632:初值为0未进行初始化的可读/写数据
RO:指令和常量=RO-data+RW-data
RW:初始化变量=RW-data+ZI-data
烧写的文件=RO+RW
RAM空间=RW+ZI
flash:Code+RO-data+RW-data
ram:RW-data+ZI-data
int main(void){}
//Program Size: Code=656 RO-data=https://www.it610.com/article/208 RW-data=0 ZI-data=1632
int main(void){char mm;
}
//Program Size: Code=656 RO-data=https://www.it610.com/article/208 RW-data=0 ZI-data=1632
char mm;
int main(void){}
//Program Size: Code=656 RO-data=https://www.it610.com/article/208 RW-data=0 ZI-data=1632
const char mm=10;
int main(void){}
//Program Size: Code=656 RO-data=https://www.it610.com/article/208 RW-data=0 ZI-data=1632
char mm=10;
int main(void){}
//Program Size: Code=656 RO-data=https://www.it610.com/article/208 RW-data=0 ZI-data=1632
char mm=10;
int main(void){mm++;
}
//Program Size: Code=700 RO-data=https://www.it610.com/article/224 RW-data=4 ZI-data=1636
int main(void){char mm=10;
}
//Program Size: Code=660 RO-data=https://www.it610.com/article/208 RW-data=0 ZI-data=1632
int main(void){char mm=10;
mm++;
}
//Program Size: Code=660 RO-data=https://www.it610.com/article/208 RW-data=0 ZI-data=1632
const char mm=10;
char tt;
int main(void){}
//Program Size: Code=656 RO-data=https://www.it610.com/article/208 RW-data=0 ZI-data=1632
const char mm=10;
char tt;
int main(void){if(mm==10)tt++;
}
//Program Size: Code=700 RO-data=https://www.it610.com/article/224 RW-data=4 ZI-data=1636
const char mm[10]={1,2,3,4,5,6,7,8,9,10};
char tt;
int main(void){if(mm[2]==3)tt++;
}
//Program Size: Code=712 RO-data=https://www.it610.com/article/236 RW-data=4 ZI-data=1636
char mm[10]={1,2,3,4,5,6,7,8,9,10};
char tt;
int main(void){if(mm[2]==3)tt++;
}
//Program Size: Code=712 RO-data=https://www.it610.com/article/224 RW-data=12 ZI-data=1636
推荐阅读
- 单片机|STM32/KEIL/MDK 查看 FLASH 和 RAM 使用情况
- 嵌入式|陀螺仪数据处理(BMI088)
- 嵌入式|CAN通讯
- STM32的使用|STM32F4软件IIC的使用
- 嵌入式|STM32 0.96寸4针IOLED显示器驱动IIC(HAL库)
- stm32|STM32Cubemx——IIC驱动0.96寸OLED
- stm32|基于I2C/SPI总线的温湿度采集与OLED显示
- STM32|STM32控制0.96寸OLED(4针/4Pin)汉字以及数字,英文显示
- 智能手环|基于STM32单片机的蓝牙智能手环系统