找回密码
 注册
关于网站域名变更的通知
查看: 390|回复: 2
打印 上一主题 下一主题

单片机STARTUP.A51详解

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2019-2-16 09:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
单片机STARTUP.A51详解$ L* e8 e# G9 [5 t4 W6 n! b3 V/ L8 X

# T5 G7 B5 h: ~! C  R" e
Startup code:启动代码。在Keil中,启动代码在复位目标系统后立即被执行。启动代码主要实现以下功能:
(1) 清除内部数据存储器
(2) 清除外部数据存储器
(3) 清除外部页存储器
(4) 初始化small模式下的可重入栈和指针
(5) 初始化large模式下的可重入栈和指针
(6) 初始化compact模式下的可重入栈和指针
(7) 初始化8051硬件栈指针
(8) 传递初始化全局变量的控制命令或者在没有初始化全局变量时给main函数传递命令。
在每一个启动文件中,提供了可供用户自己修改有来控制程序执行的汇编常量。见表1
表1

Name

Description

IDATALEN

Specifies the number of bytes of idata to clear to 0. The default is 80h because most 8051 derivatives contain at least 128 bytes of internal data memory. Use a value of 100h for the 8052 and other derivatives that have 256 bytes of internal data memory.

XDATASTART

Specifies the initial xdata address to clear to 0.

XDATALEN

Indicates the number of bytes of xdata to clear to 0. The default is 0.

PDATASTART

Specifies the initial pdata address to clear to 0.

PDATALEN

Specifies the number of bytes of pdata to clear to 0. The default is 0.

IBPSTACK

Specifies whether or not the small model reentrant stack pointer (?C_IBP) should be initialized. A value of 1 causes this pointer to be initialized. A value of 0 prevents initialization of this pointer. The default is 0.

IBPSTACKTOP

Specifies the top of the small model reentrant stack. The default is 0xFF in idata memory.
8 Y" K* q, q/ p  X: zThe Cx51 Compiler does not check to see if the stack area available satisfies the requirements of the application. It is your responsibility to peRForm such a test.

XBPSTACK

Specifies whether or not the large model reentrant stack pointer (?C_XBP) should be initialized. A value of 1 causes this pointer to be initialized. A value of 0 prevents initialization of this pointer. The default is 0.

XBPSTACKTOP

Specifies the top of the large model reentrant stack. The default is 0xFFFF in xdata memory.
/ p" @7 c: x! @4 r7 @The Cx51 Compiler does not check to see if the stack area available satisfies the requirements of the application. It is your responsibility to perform such a test.

PBPSTACK

Specifies whether the compact model reentrant stack pointer (?C_PBP) should be initialized. A value of 1 causes this pointer to be initialized. A value of 0 prevents initialization of this pointer. The default is 0.

PBPSTACKTOP

Specifies the top of the compact model reentrant stack. The default is 0xFF in pdata memory.
0 g- y' l+ d9 q* K4 ?5 u0 C1 lThe Cx51 Compiler does not check to see if the stack area available satisfies the requirements of the application. It is your responsibility to perform such a test.

PPAGEENABLE

Enables (a value of 1) or disables (a value of 0) Port 2 initialization for pdata memory access. The default is 0. pdata addressing uses Port 2 for the upper address (or page) byte.

PPAGE

Specifies the value to write to Port 2 of the 8051 for pdata memory access. This value represents the xdata memory page to use for pdata. This is the upper 8 bits of the absolute address range to use for pdata. For example, if the pdata area begins at address 1000h (page 10h) in xdata memory, PPAGEENABLE should be set to 1, and PPAGE should be set to 10h. You must specify the starting pdata address to use to the BL51 Linker using the PDATA directive. For example:

BL51 input modules PDATA (1050H)

Neither the BL51 Linker nor the Cx51 Compiler checks to see if the PDATA directive and the PPAGE startup constant are correctly specified. You must ensure that these parameters contain suitable values.

上面这些只是标号,如果愿意,自己可以换成其他的名字。这样写意义更直观。
游客,如果您要查看本帖隐藏内容请回复

该用户从未签到

2#
发表于 2019-2-16 10:05 | 只看该作者
发帖是心得 回帖是美德
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-6-14 09:10 , Processed in 0.078125 second(s), 23 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表