ARM汇编和Gnu汇编的转换
时间:11-20
来源:互联网
点击:
将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
Reference:
http://blog.21ic.com/user1/3858/archives/2007/43113.html
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
Reference:
http://blog.21ic.com/user1/3858/archives/2007/43113.html
ARM汇编Gnu汇编转 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)