This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP28035 混合编程

本人是新手,在看28035程序,由于是混合编程,有一段代码看不懂什么意思。

在汇编文件里定义了 .global _InitRAMPointer   ,_InitRAM

下面又写了这条语句_InitRAMPointer  LB _InitRAM

在.C文件有 有这条语句extern void InitRAMPointer(void);

之后在主程序里调用的 InitRAMPointer();    写的备注是//ram initialize

请问是什么意思呢? ram是怎样初始化的? 程序如何执行的?

谢谢!

  • 请问能否给出具体信息或者代码?
  • The second level boot loader and application depend on these
    ; constants being exactly where they are. Their addresses are
    ; hard coded in the linkder command files because the DSECT
    ; liker directive does not prevent overlaying code on the
    ; specified section but instead puts code wherever it wants.

    ; THE NUMBER AND LOCATION OF THESE CONSTANTS CANNOT BE CHANGED
    ; WITHOUT ALSO CHANGING THE SECOND LEVEL BOOT AND APPLICATION!

    ;.global _ApplicationValidPointer, _Application_Valid
    .global _Application_Valid
    .global _WatchDogKickPointer, _Watch_Dog_Kick ;C语言中调用汇编函数,汇编文件中用 .global定义,程序标号前加_
    .global _B1AppEntryPointer , _B1_App_Entry
    .global _B1RstEntryPointer , _B1_Rst_Entry
    .global _MemCopyPointer , _MemCopy

    .global _InitSysCtrlPointer , _InitSysCtrl
    .global _InitGpioPointer , _InitGpio
    .global _DisableDogPointer , _DisableDog
    .global _EnableDogPointer , _EnableDog

    .global _InitCpuTimersPointer , _InitCpuTimers
    .global _InitPieCtrlPointer , _InitPieCtrl
    .global _InitPieVectTablePointer , _InitPieVectTable
    .global _InitPeripheralsPointer , _InitPeripherals

    .global _InitRAMPointer ,_InitRAM
    .global _USER_ISR_Pointer , _USER_ISR

    .global _uiI2caWriteDataPointer, _uiI2caWriteData
    .global _uiI2caReadDataPointer , _uiI2caReadData
    .global _fReadFloatDataThreePointer , _fReadFloatDataThree

    .global _Boot_Version;_Hardware_Version
    .global _StartTimer;, _StartTimerPointer
    .global _TimeIsUp;, _TimeIsUpPointer
    .global _uiI2caWriteData1Pointer, _uiI2caWriteData1
    .global _uiI2caWriteData2Pointer, _uiI2caWriteData2
    .global _uiI2caReadData1Pointer, _uiI2caReadData1
    .global _uiI2caReadData2Pointer, _uiI2caReadData2
    .global _InitSciPointer , _InitSci
    .global _ucAsc2HexPointer , _ucAsc2Hex
    .global _uiHex2AscPointer , _uiHex2Asc
    .sect ".bootvec"
    _Boot_Version .int 0x0100
    .int 0x0100

    _B1AppEntryPointer LB _B1_App_Entry ;0x3F7002/0x3F6002
    _WatchDogKickPointer LB _Watch_Dog_Kick ;0x3F7004/0x3F6004
    _B1RstEntryPointer LB _B1_Rst_Entry ;0x3F7008/0x3F6008
    _MemCopyPointer LB _MemCopy ;0x3F700A/0x3F600A
    _InitSysCtrlPointer LB _InitSysCtrl ;0x3F700C/0x3F600C
    _InitGpioPointer LB _InitGpio ;0x3F700E/0x3F600E

    _DisableDogPointer LB _DisableDog ;0x3F7016/0x3F6016
    _EnableDogPointer LB _EnableDog ;0x3F7018/0x3F6018
    _InitCpuTimersPointer LB _InitCpuTimers ;0x3F701A/0x3F601A

    _InitPieCtrlPointer LB _InitPieCtrl ;0x3F7022/0x3F6022
    _InitPieVectTablePointer LB _InitPieVectTable;0x3F7024/0x3F6024

    ;#定义 _InitRAM 为外部程序可以访问的标签
    _InitRAMPointer LB _InitRAM ;0x3F7028/0x3F6028
    _USER_ISR_Pointer LB _USER_ISR ;0x3F702A/0x3F602A

    _uiI2caWriteDataPointer LB _uiI2caWriteData ;0x3F702C
    _uiI2caReadDataPointer LB _uiI2caReadData ;0x3F702E


    _fReadFloatDataThreePointer LB _fReadFloatDataThree ;0x3F703C
    _uiI2caWriteData1Pointer LB _uiI2caWriteData1 ;0x3F703E
    _uiI2caWriteData2Pointer LB _uiI2caWriteData2 ;0x3F7040
    _uiI2caReadData1Pointer LB _uiI2caReadData1 ;0x3F7042
    _uiI2caReadData2Pointer LB _uiI2caReadData2 ;0x3F7044
    _InitSciPointer LB _InitSci
    _ucAsc2HexPointer LB _ucAsc2Hex
    _uiHex2AscPointer LB _uiHex2Asc
    ;********************************************************************

    .ref _c_int00
    .global _BOOT_MAIN
    .global _g_u16FromApplication,_g_u16MdlAddr
    __stack: .usect ".stack",0

    .sect "FlashBoot"
    _B1_Rst_Entry:
    MOV AL,#__stack
    MOV @SP,AL
    SPM 0
    SETC OBJMODE
    CLRC AMODE
    .c28_amode
    SETC M0M1MAP
    CLRC PAGE0 ;28x mode
    MOVW DP,#0x0000
    CLRC OVM
    ASP

    SETC INTM
    MOV AL,#0
    MOVW DP,#_g_u16MdlAddr ; _uiMdlAddr = 0
    MOV @_g_u16MdlAddr,AL
    LB ContinueB1
    _B1_App_Entry:
    SETC INTM
    MOV AL,#0FFH

    ContinueB1:
    MOVW DP,#_g_u16FromApplication
    MOV @_g_u16FromApplication,AL

    LCR _BOOT_MAIN
    SETC INTM ; disable interrupts
    justdie:
    LB justdie


    ;***********************************************************************

    .global _main,_exit
    .sect ".appvec"
    _Application_Entry_Point:
    MOV AL,#__stack
    MOV @SP,AL

    LCR _main ;LB _c_int00,0x003F4000

    _exit_entry LCR _exit


    ;***********************************************************************
    .global _CRC16_CheckWord
    .sect "appcrc"
    _CRC16_CheckWord:
    .int 0x4616
    ;***********************************************************************

    .end
    ;===========================================================================
    ; No more.
    ;===========================================================================




    这个是asm文件的全部代码。
  • 建议您给出程序的详细出处/路径

    对汇编也不太熟悉
  • 这是艾默生系数字电源代码常用写法,历史代码而已,没什么用处。