|
很少看到有关于这个段的定义,希望有朋友解释一下
可是在程序中见到过他的用法:
我看到前面有一个朋友提供了其烧写成功的CMD文件,他是把.reset段定位在了3F7FF6处,不知道这又是为什么?
MEMORY
{
PAGE 0 :
。。。。
BEGIN : origin = 0x3F7FF6, length = 0x000002
PASSWDS : origin = 0x3F7FF8, length = 0x000008
ROM : origin = 0x3FF000, length = 0x000FC0
。。。。
}
SECTIONS
{
.reset : > BEGIN PAGE = 0
vectors : > VECTORS PAGE = 0
。。。}
另外,我也看到咱们论坛有的朋友不用.reset段(即用到语句“ .reset : > RESET, PAGE = 0, TYPE = DSECT ”屏蔽掉了,而是用了自己定义的段codestart。
.sect \"codestart\"
code_start:
.if WD_DISABLE == 1
LB wd_disable ;Branch to watchdog disable code
.else
LB _c_int00 ;Branch to start of boot.asm in RTS library
.endif
MEMORY
{
PAGE 0: /* Program Memory */
...
BEGIN_FLASH : origin = 0x3F7FF6, length = 0x000002 /* Part of FLASHA. Used for \"boot to flash\" bootloader mode. */
BEGIN_H0 : origin = 0x3F8000, length = 0x000002 /* Part of H0. Used for \"boot to H0\" bootloader mode. */
...
ROM : origin = 0x3FF000, length = 0x000FC0 /* boot ROM available if MP/MCn=0 */
RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM (MP/MCn=0) or XINTF zone 7 (MP/MCn=1) */
VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM (MP/MCn=0) or XINTF zone 7 (MP/MCn=1) */
PAGE 1 : /* Data Memory */
....
....
}
SECTIONS
{
。。。。
.reset : > RESET, PAGE = 0, TYPE = DSECT /* We are not using the .reset section */
.......。。。
。。。。。
/*** User Defined Sections ***/
codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
。。。。。
} |
阿莫论坛20周年了!感谢大家的支持与爱护!!
一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。
|