Porting NASM Assembly to GCC
From OMAPpedia
(Difference between revisions)
(→Basics) |
m (Added category tag) |
||
| Line 21: | Line 21: | ||
CONSTANTS: ([a-zA-Z0-9_]+)\s+EQU\s+([0-9a-zA-Z_]+) -> .equ \1, \2 | CONSTANTS: ([a-zA-Z0-9_]+)\s+EQU\s+([0-9a-zA-Z_]+) -> .equ \1, \2 | ||
</pre> | </pre> | ||
| + | |||
| + | |||
| + | [[Category:Tools]] | ||
Latest revision as of 15:18, 25 May 2010
Contents |
[edit] Replacements
[edit] Using Notepad++ and Regular Expressions
[edit] Basics
- Replace INCLUDE with .include
- Replace EXPORT with .global
- Replace MACRO with .macro
- Replace MEND with .endm
- Replace TEXTAREA with .text or .arm
- Replace END with .end
- Replace DCD with .long
[edit] Regular Expressions
FUNCTION START: \s+LEAF_ENTRY\s+([a-zA-Z0-9_]+) -> \1: FUNCTION END: \s+ENTRY_END\s+[a-zA-Z0-9_]+ -> nothing LABELS: ^([a-zA-Z0-9_]+)([^:])$ -> \1\2: REGISTER RENAMES: RN\s([0-9]+)-> .req r\1 LINE COMMENTS: ; -> # then (\s+)#\s(.*) -> \1/* \2 */ and (\s+)#(=)(.*) -> \1/* \2\3 */ CONSTANTS: ([a-zA-Z0-9_]+)\s+EQU\s+([0-9a-zA-Z_]+) -> .equ \1, \2