当前位置:网站首页>ARM处理器与51单片机程序编写的区别
ARM处理器与51单片机程序编写的区别
2022-06-23 08:59:00 【七月流星.】
(1)int变量
在51单片机中占2个字节;在ARM处理器中占4个字节。
(2)结构体对齐
在51单片机中按照一个字节对齐;在ARM中按照结构体默认对齐规则对齐。
(3)字节在内存的排列顺序
在51单片机中是大端;在ARM中,大多数是小端,部分可以大小端选择。
大端堆栈和小端堆栈的区别:
大端堆栈往上生长,小端堆栈往下生长;
大端初始化的SP往往在地址低端,小端初始化的SP往往在地址高端。
(4)局部变量
在51单片机中存放在数据段中;在ARM中存放于堆栈中;
(5)指令长度
在51单片机中指令长度一般是1~3个字节;在ARM处理器中指令长度一般是一个字(32位)。
(6)编址方法
在51单片机中是空间独立编址;在ARM中是空间统一编址。
(7)ARM中没有bool变量;在51单片机中可采用bit变量
使用typedef enum(false,true)bool;
赋初值的ROM变量定位方法:
ARM方法:
const u8 bootsoftver __at(0x8001000)=BOOT32_SOFTVER;
MCS51方法:
首先,建立一个bootver.c文件:
unsigned char code
version=BOOTVERSION; //BOOT固件版本
然后,在BL51 Locate--?CO?BOOTVER(0x0FD00)
(8)主函数和中断调用同一函数
在51单片机中显示告警信息WARNING 15(MULTIPLE CALL TO SEGMENT);函数不可重入
在ARM中编译后不显示告警;函数可重入
边栏推荐
- 670. Maximum Swap
- Which is better, semrush or ahrefs? Which is more suitable for GoogleSEO keyword analysis
- General paging (1)
- In depth interpretation of poca smart contract platform gear: the road to parallel architecture public chain
- Utilisation du cookie du module de demande de noeud
- 125. Valid Palindrome
- 670. Maximum Swap
- Use newbeecoder UI implements data paging
- Intelligent operation and maintenance exploration | anomaly detection method in cloud system
- GeoServer adding mongodb data source
猜你喜欢

6月《中国数据库行业分析报告》发布!智能风起,列存更生

In depth interpretation of poca smart contract platform gear: the road to parallel architecture public chain

'coach, I want to play basketball!'—— AI Learning Series booklet for system students

986. Interval List Intersections

3. caller service call - dapr

Custom tags - JSP tag enhancements

Typora设置图片上传服务

Community article | mosn building subset optimization ideas sharing

Simple student management

Testing -- automated testing selenium (about API)
随机推荐
How postman does interface testing 1: how to import swagger interface documents
Can portals be the next decentraland?
线性表(LinkList)的链式表示和实现----线性结构
'教练,我想打篮球!' —— 给做系统的同学们准备的 AI 学习系列小册
Geoserver添加mongoDB数据源
How to use "tomato working method" in flowus, notation and other note taking software?
297. Serialize and Deserialize Binary Tree
[QNX Hypervisor 2.2用户手册]6.2 网络
如何在 FlowUs、Notion 等笔记软件中使用「番茄工作法」?
[learning resources] understand and love mathematics
How can I handle the "unable to load" exception when easyplayer plays webrtcs?
6、 Web Architecture Design
自定义标签——jsp标签增强
In depth interpretation of poca smart contract platform gear: the road to parallel architecture public chain
173. Binary Search Tree Iterator
设CPU有16根地址线,8根数据线,并用MREQ作为访存控制线号......存储器与CPU的连接
GeoServer adding mongodb data source
523. Continuous Subarray Sum
在小程序中实现视频通话及互动直播的一种方法
438. Find All Anagrams in a String