bootloader.asm

来自「TMS320C6416的BOOTLOADER程序代码」· 汇编 代码 · 共 97 行

ASM
97
字号

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                                                                   ;;;
;;;                       bootloader.asm                              ;;;
;;;                                                                   ;;;
;;;         The program is the second bootloader to load the prg      ;;;
;;;                                                                   ;;;
;;;            Copyright2003.9-2004.9 by ZhangXiaoPing   HEU          ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 


        .title    "TMS320C6416 BOOTLOADER SECTION"        ;  show the title for the asm file
        
        .sect     ".boot_load"
        
        .ref      _c_int00      ;  reference the c entry point for c_int00()

        
  
        
        
        
        .global   _boot
        
_boot:

        ;CONFIG THE EMIFB_GBLCTL
        
        MVKL      0x01A80000, A4
      ||MVKL      0x00000038, B4
        MVKH      0x01A80000, A4
      ||MVKH      0x00000038, B4
        STW       B4        ,*A4
        
        ;CONFIG THE EMIFB_CE1CTL
        
        MVKL      0x01A80004, A4
      ||MVKL      0x2162C403, B4
        MVKH      0x01A80004, A4
      ||MVKH      0x2162C403, B4
        STW       B4        ,*A4
      
        ;SETUP THE START ADDRESS OF NEEDED COPYED PROGRAM
        
        MVKL      0x64000400, A3
        MVKH      0x64000400, A3
        
        ;SETUP THE DESTINATION ADDRESS
        
        MVKL      0x00000400, A4
        MVKH      0x00000400, A4
        
        ;SETUP THE LENGTH OF COPYED PROGRAM
        
        MVKL      0x00056200, B0
        MVKH      0x00056200, B0
        
        ;EXECUTE THE COPY PROGRAM
        
        NOP       5
        
        .def      COPY_LOOP
        
COPY_LOOP:
        
        LDBU      *A3++,      B5
        NOP       5
        STB       B5   ,    *A4++
        SUB       B0   ,1,    B0
  [B0]  B         COPY_LOOP
        NOP       5
  
        .def      COPY_DONE
        ;在完成程序的拷贝之后,跳转到应用程序的开头执行
COPY_DONE:
        
        MVKL        _c_int00,B4         ; load destination function address to b4
        MVKH        _c_int00,B4 
        B           B4              
        NOP 5
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?