您当前的位置:五五电子网电子知识单片机-工控设备源码-程序ARM启动代码研究(附源代码) 正文
ARM启动代码研究(附源代码)

ARM启动代码研究(附源代码)

点击数:7935 次   录入时间:03-04 12:03:42   整理:http://www.55dianzi.com   源码-程序
8: InitStack    
        MOV     R0, LR
;Build the SVC stack
;设置管理模式堆栈
        MSR     CPSR_c, #0xd3  
        LDR     SP, StackSvc 
;Build the IRQ stack 
;设置中断模式堆栈
        MSR     CPSR_c, #0xd2
        LDR     SP, StackIrq
;Build the FIQ stack
;设置快速中断模式堆栈
        MSR     CPSR_c, #0xd1
        LDR     SP, StackFiq
;Build the DATAABORT stack
;设置中止模式堆栈
        MSR     CPSR_c, #0xd7
        LDR     SP, StackAbt
;Build the UDF stack
;设置未定义模式堆栈
        MSR     CPSR_c, #0xdb
        LDR     SP, StackUnd
;Build the SYS stack
;设置系统模式堆栈
        MSR     CPSR_c, #0x5f                  ;#0xdf
        LDR     SP, =StackUsr
        MOV     PC, R0

9:  BL  InitStack               ;初始化堆栈 Initialize the stack
    BL  TargetResetIni;目标板基本初始化                                        ;跳转到c语言入口 Jump to the entry point of C program
B       __main

周立功启动代码:
;/****************************************Copyright (c)**************************************************
;**                               Guangzou ZLG-MCU Development Co.,LTD.
;**                                      graduate school
;**                                 http://www.zlgmcu.com
;**
;**--------------File Info-------------------------------------------------------------------------------
;** File name:    Startup.s
;** Last modified Date:  2004-09-17
;** Last Version:   1.0
;** Descriptions:   The start up codes for LPC2100, 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:     2004-02-02
;** Version:    1.0
;** Descriptions:   The original version//原著
;**
;**------------------------------------------------------------------------------------------------------
;** Modified by:   Chenmingji
;** Modified date:  2004-09-17
;** Version:    1.01
;** Descriptions:   Modified the bus setting to adapt for many common situations 
;**                             //改进了总线,可以根据这里的更改来控制总线的速率
;**------------------------------------------------------------------------------------------------------
;** Modified by:   Chenmingji
;** Modified date:  2004-09-17
;** Version:    1.02
;** Descriptions:   Added codes to support the enciphering of the Chip
;**                             //增加了芯片加密
;**------------------------------------------------------------------------------------------------------
;** Modified by:   Chenmingji
;** Modified date:  2004-09-17
;** Version:    1.04
;** Descriptions:   Renewed the template, added codes to support more compilers 
;**                             //重建模板,加入更多代码来支持更多的编译
;**------------------------------------------------------------------------------------------------------
;** Modified by:   
;** Modified date:
;** Version: 
;** Descriptions: 
;**
;********************************************************************************************************/

;define the stack size
;定义堆栈的大小
SVC_STACK_LEGTH         EQU         0
FIQ_STACK_LEGTH         EQU         0
IRQ_STACK_LEGTH         EQU         256
ABT_STACK_LEGTH         EQU         0
UND_STACK_LEGTH         EQU         0

NoInt       EQU 0x80

;定义处理器模式,用户/管理/系统/中断
USR32Mode   EQU 0x10
SVC32Mode   EQU 0x13
SYS32Mode   EQU 0x1f
IRQ32Mode   EQU 0x12
FIQ32Mode   EQU 0x11

PINSEL2     EQU 0xE002C014//定义PINSEL2地址,这个地址的值一般用户不需要改变,和芯片的加密有关
                            //更改后有可能使得JTAG调试失效,进入芯片加密状态.
BCFG0       EQU 0xFFE00000
BCFG1       EQU 0xFFE00004
BCFG2       EQU 0xFFE00008
BCFG3       EQU 0xFFE0000C//定义存储器组配置寄存器

BCFG_16DEF EQU     0x10000400      ;// 16Bit Bus
BCFG_CS3    EQU  (BCFG_16DEF | (0x01<<00) | (0x07<<05) | (0x07<<11))   ;// 分别是IDCY/WST1/WST2对应读写速率等
                                  ;//从第0位开始对其写入0001,

上一页  [1] [2] [3] [4] [5]  下一页


本文关键字:源代码  源码-程序单片机-工控设备 - 源码-程序

《ARM启动代码研究(附源代码)》相关文章>>>