初始化lpc2106开发工程

单片机型号:lpc2106.
Init.s:初始化pc指针和sp指针.
    AREA    Init, CODE, READONLY
    IMPORT  test1_main
    EXPORT  Reset_Handler

Reset_Handler
    ; Set up the stack pointer...
    MOV   SP, #0x40000000
    ADD   SP, SP, #0x4000
    LDR   PC, Main_Address
Main_Address      DCD test1_main
    END

vector.s:向量表
    AREA    Vectors, CODE, READONLY
    ENTRY
    LDR          PC, Reset_Address ;复位时执行Reset_Handler函数
    LDR          PC, Undefined_Address
    LDR          PC, SWI_Address ;软件中断接管
    LDR          PC, Prefetch_Address
    LDR          PC, Abort_Address ;异常退出
    DCD          0x0  ; Generated by the ISP tool (sum of other vectors instructions)
    LDR          PC, IRQ_Address ;IRQ中断
    LDR          PC, FIQ_Address ;FIQ中断
    IMPORT       Reset_Handler   ;in init.s
    IMPORT   irq_handler
    IMPORT   fiq_handler
    IMPORT   swi_Handler
    IMPORT   Undef_handler
    IMPORT   fetch_handler
    IMPORT   Abort_handler

Reset_Address      DCD     Reset_Handler
Undefined_Address  DCD     Undef_handler
SWI_Address        DCD     swi_Handler
Prefetch_Address   DCD     fetch_handler
Abort_Address      DCD     Abort_handler
                   DCD     0x0
IRQ_Address        DCD     irq_handler
FIQ_Address        DCD     fiq_handler
   END

你可能感兴趣的:(初始化)