Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> Linux教程 >> ARM ADS匯編和Gnu匯編的轉換

ARM ADS匯編和Gnu匯編的轉換

日期:2017/2/7 14:38:58      編輯:Linux教程
 

將ARM ADS下的匯編碼移植到GCC for ARM編譯器時,有如下規則:
1, 注釋行以"@"或"/* ... */"代替";"

2, GET或INCLUDE => .INCLUDE
如:get option.a => .include "option.a"

3, EQU => .equ
TCLK2 EQU PB25 => .equ TCLK2, PB25
SETA ==> .equ
SETL ==> .equ
BUSWIDTH SETA 16 => .equ BUSWIDTH, 16

4, EXPORT => .global
IMPORT => .extern
GBLL => .global
GBLA => .global

5, DCD => .long

6, IF :DEF: => .IFDEF
ELSE => .ELSE
ENDIF => .ENDIF
:OR: => |
:SHL: => <<

7, END =>.end
NOTE:在被include的頭文件中,如"option.a"中,不再需要.end,否則會導致主匯編程序結束。

8, 符號定義加":"號
Entry => Entry:
AREA Word, CODE, READONLY ==> .text
AREA Block, DATA, READWRITE ==> .data
CODE32 ==> .arm
CODE16 ==> .thumb

9, MACRO ==> .macro
MEND ==> .endm

Copyright © Windows教程網 All Rights Reserved