寫ARM組譯工具的一個注意事項

來源:互聯網
上載者:User

2009-04-01 09:54:32

  剛才,給nboot加入了一個彙編的宏,結果導致大面積錯誤。如下

; Turn on all LEDs.
MACRO
    pLED_ON $data

    ldr  r0, =GPFCON
    ldr  r1, =0x55aa
    str  r1, [r0]
    ldr  r0, =GPFUP
    ldr  r1, =0xff
    str  r1, [r0]
    ldr  r0, =GPFDAT
    ldr  r1, =$data
    str  r1, [r0]
    b .       ; programme is dead here

 MEND

 

BUILD: [01:0000000025:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(75) : error A0051: unknown opcode: pLED_ON
BUILD: [01:0000000027:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(77) : error A0064: code inside data section
BUILD: [01:0000000029:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(78) : error A0064: code inside data section
BUILD: [01:0000000031:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(79) : error A0064: code inside data section
BUILD: [01:0000000033:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(80) : error A0064: code inside data section
BUILD: [01:0000000035:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(81) : error A0064: code inside data section
BUILD: [01:0000000037:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(82) : error A0064: code inside data section
BUILD: [01:0000000039:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(83) : error A0064: code inside data section
BUILD: [01:0000000041:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(84) : error A0064: code inside data section
BUILD: [01:0000000043:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(84) : error A0017: illegal $ substitution, non assembler variable
BUILD: [01:0000000045:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(84) : error A0227: syntax error in expression
BUILD: [01:0000000047:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(85) : error A0064: code inside data section
BUILD: [01:0000000049:ERRORE] C:/WINCE500/PLATFORM/SMDK2440A/Src/Bootloader/Stepldr/startup.s(86) : error A0064: code inside data section

 

後來發現是MACRO定格導致的問題,縮排就好了

; Turn on all LEDs.
    MACRO
    pLED_ON $data

    ldr  r0, =GPFCON
    ldr  r1, =0x55aa
    str  r1, [r0]
    ldr  r0, =GPFUP
    ldr  r1, =0xff
    str  r1, [r0]
    ldr  r0, =GPFDAT
    ldr  r1, =$data
    str  r1, [r0]
    b .       ; programme is dead here

    MEND

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.