EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
单片机STARTUP.A51详解
% x$ k2 w2 H% K% y9 E" p$ \+ k2 g2 p
" l$ v Y# i: @3 a# x( aStartup 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.2 S8 U1 ]7 m- l* {- V8 w
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. | 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.; n/ x8 D. i w
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./ A5 s n4 P* `- G
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. | 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. |
上面这些只是标号,如果愿意,自己可以换成其他的名字。这样写意义更直观。 |