📄 startup.s
字号:
;/****************************************Copyright (c)**************************************************
;** Guangzhou ZHIYUAN electronics Co.,LTD.
;** http://www.zyinside.com
;**
;**--------------File Info-------------------------------------------------------------------------------
;** File name: Startup.s
;** Last modified Date: 2006-02-22
;** Last Version: 1.0
;** Descriptions: The start up codes for LPC2200, including the initializing codes for the entry point of exceptions and the stacks of user tasks.
;** Every project should have a independent copy of this file for related modifications
;**------------------------------------------------------------------------------------------------------
;** Created by: Chenmingji
;** Created date: 2005-11-22
;** Version: 1.0
;** Descriptions: The original version
;**
;**------------------------------------------------------------------------------------------------------
;** Modified by: zhangbin
;** Modified date: 2006-6-28
;** Version: 1.1
;** Descriptions: Clear VICVectAddr Register In ResetInit.
;**
;********************************************************************************************************/
preserve8
IRQ_STACK_LEGTH EQU (8 * 3) ;/* 允许3层嵌套 */
StackIRQ EQU (IrqStackSpace + IRQ_STACK_LEGTH * 4 - 4)
INCLUDE LPC2294.INC ; Include the head file 引入头文件
NoInt EQU 0x80
NoFIQ EQU 0x40
UND32Mode EQU 0x1b
USR32Mode EQU 0x10
SVC32Mode EQU 0x13
SYS32Mode EQU 0x1f
IRQ32Mode EQU 0x12
FIQ32Mode EQU 0x11
TMode EQU 0x20
;The exported labels
;给外部使用的标号在这声明
EXPORT Reset
CODE32
AREA vectors,CODE,READONLY
ENTRY
;interrupt vectors
;中断向量表
Reset
LDR PC, Reset_1
Reset_1 DCD ResetInit
B .
B .
B .
DCD -(0xe51ff004 + ResetInit + 0xeafffffe * 3 + 0xe51ffff0 + 0xe25ef004)
LDR PC, [PC, #-0xff0]
SUBS PC, LR, #4
;/*********************************************************************************************************
;** unction name 函数名称: ResetInit
;** Descriptions 功能描述: reset code
;** input parameters 输 入: None 无
;** Returned value 输 出 : None 无
;** Used global variables 全局变量: None 无
;** Calling modules 调用模块: None 无
;**
;** Created by 作 者: Chenmingji 陈明计
;** Created Date 日 期: 2004/03/27 2004年3月27日
;**-------------------------------------------------------------------------------------------------------
;** Modified by 修 改:
;** Modified date 日 期:
;**-------------------------------------------------------------------------------------------------------
;********************************************************************************************************/
ResetInit
MSR CPSR_c, #(IRQ32Mode | NoInt | NoFIQ)
LDR SP, =StackIRQ
MSR CPSR_c, #(SYS32Mode | NoInt | NoFIQ)
LDR SP, =StackUsr
LDR R0, =VICVectAddr
MOV R1, #0x00
STR R1, [R0]
LDR R1, =Main+1
BX R1
LTORG
;/*********************************************************************************************************
;** unction name 函数名称: Main
;** Descriptions 功能描述: user main function
;** input parameters 输 入: None 无
;** Returned value 输 出 : None 无
;** Used global variables 全局变量: None 无
;** Calling modules 调用模块: None 无
;**
;** Created by 作 者: Chenmingji 陈明计
;** Created Date 日 期: 2004/03/27 2004年3月27日
;**-------------------------------------------------------------------------------------------------------
;** Modified by 修 改:
;** Modified date 日 期:
;**-------------------------------------------------------------------------------------------------------
;********************************************************************************************************/
code16
Main
;add usr code
B Main
;/*********************************************************************************************************
;** unction name 函数名称: CrpData
;** Descriptions 功能描述: encrypt the chip
;** input parameters 输 入: None 无
;** Returned value 输 出 : None 无
;** Used global variables 全局变量: None 无
;** Calling modules 调用模块: None 无
;**
;** Created by 作 者: Chenmingji 陈明计
;** Created Date 日 期: 2004/03/27 2004年3月27日
;**-------------------------------------------------------------------------------------------------------
;** Modified by 修 改:
;** Modified date 日 期:
;**-------------------------------------------------------------------------------------------------------
;********************************************************************************************************/
IF :DEF: EN_CRP
IF . >= 0x1fc
INFO 1,"\nThe data at 0x000001fc must be 0x87654321.\nPlease delete some source before this line."
ENDIF
CrpData
WHILE . < 0x1fc
NOP
WEND
CrpData1
DCD 0x87654321 ;/*When the Data is 为0x87654321,user code be protected. 当此数为0x87654321时,用户程序被保护 */
ENDIF
AREA MyStacks, DATA, NOINIT, ALIGN=2
IrqStackSpace SPACE IRQ_STACK_LEGTH * 4 ;Stack spaces for Interrupt ReQuest Mode 中断模式堆栈空间
AREA Stacks, DATA, NOINIT
StackUsr
END
;/*********************************************************************************************************
;** End Of File
;********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -