SC6600D_init.s

;  Copyright ARM Ltd 2000. All rights reserved.
;
;
 This module performs ROM/RAM remapping (if required), initializes stack pointers and 
;
 interrupts for each mode, and finally branches to __main in the C library (which eventually calls main()).
;
;
 On reset, the ARM core starts up in Supervisor (SVC) mode, in ARM state, with IRQ and FIQ disabled.


        AREA    Init
,  CODE ,  READONLY


;  --- Standard definitions of mode bits and interrupt (I & F) flags in PSRs

Mode_SVC_NO_IRQ EQU     0xD3 
;  0x13 or ox80 or 0x40
I_Bit           EQU     0x80  ;  when I bit is set, IRQ is disabled
F_Bit           EQU     0x40  ;  when F bit is set, FIQ is disabled


;  --- System memory locations

        ENTRY

        IMPORT  stack_bottom
        
        EXPORT  Reset_Handler
    CODE32
Reset_Handler

;  --- Initialise stack pointer registers

;  Enter SVC mode and set up the SVC stack pointer
    MOV     a1 ,  #Mode_SVC_NO_IRQ             ;  Build SVC mode CPSR
    MSR     CPSR_c ,  a1                       ;  Enter SVC mode    
    LDR     a2 ,   [ pc, #SVC_STACK-.-8 ]          ;  Pickup SVC mode stack address                                            
    LDR     a2 ,   [ a2,#0 ]                          
                                            
;  max RAM size of out chip is 8M Bits
    MOV     sp ,  a2                           ;  Setup SVC MODE stack pointer
    
;  Set up other stack pointers if necessary
         ;  ...

;  --- Initialise memory system
         ;  ...

;  --- Initialise critical IO devices
         ;  ...

;  --- Initialise interrupt system variables here
         ;  ...

        IMPORT  main_entry

;  --- Now enter the C code
      B      main_entry    ;  note use B not BL, because an application will never return this way
        

;  --- Now enter the FDL code
;
 jump to target address
;
 on entry
;
 r0 = int startaddr
;
 no exit
          
        EXPORT  JumpToTarget
JumpToTarget    
        MOV  pc
,  r0
        
SVC_STACK                               
    DCD     stack_bottom

    END
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值