Added armv5 syntax
This commit is contained in:
parent
965da68eeb
commit
ed0888f0dc
53
syntax/armv4.vim
Normal file
53
syntax/armv4.vim
Normal file
@ -0,0 +1,53 @@
|
||||
" Vim syntax file
|
||||
" Language: ARMv4
|
||||
" Maintainer: ARM9
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case ignore
|
||||
|
||||
so <sfile>:p:h/include/arm_base_syntax.vim
|
||||
|
||||
if version >= 508 || !exists("did_armv4_syntax_inits")
|
||||
if version < 508
|
||||
let did_armv4_syntax_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
HiLink armv4Instr armInstructions
|
||||
HiLink armv4InstrCond armInstructions
|
||||
HiLink armv4InstrNoCond armInstructions
|
||||
HiLink armv4LDR armInstructions
|
||||
HiLink armv4STR armInstructions
|
||||
HiLink armv4Stack armInstructions
|
||||
HiLink armv4SWP armInstructions
|
||||
|
||||
HiLink armNumericOp armOperator
|
||||
HiLink armRelative armOperator
|
||||
|
||||
" Link to standard syn groups so the 'colorschemes' work
|
||||
HiLink armOperator Operator
|
||||
HiLink armNumber Number
|
||||
HiLink armComment Comment
|
||||
HiLink armString String
|
||||
|
||||
HiLink armIdentifier Label
|
||||
HiLink armLabel Label
|
||||
HiLink gasDirective PreProc
|
||||
HiLink armDirective PreProc
|
||||
HiLink armCPreProc Identifier
|
||||
|
||||
HiLink armRegister Type
|
||||
HiLink armInstructions Function
|
||||
|
||||
HiLink armTodo Todo
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "armv4"
|
||||
|
54
syntax/armv5.vim
Normal file
54
syntax/armv5.vim
Normal file
@ -0,0 +1,54 @@
|
||||
" Vim syntax file
|
||||
" Language: ARMv5
|
||||
" Maintainer: ARM9
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case ignore
|
||||
|
||||
so <sfile>:p:h/include/arm_base_syntax.vim
|
||||
|
||||
if version >= 508 || !exists("did_armv5_syntax_inits")
|
||||
if version < 508
|
||||
let did_armv5_syntax_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
HiLink armv4Instr armInstructions
|
||||
HiLink armv5InstrCond armInstructions
|
||||
HiLink armv5InstrNoCond armInstructions
|
||||
HiLink armv5Mul armInstructions
|
||||
HiLink armv5LDR armInstructions
|
||||
HiLink armv5STR armInstructions
|
||||
HiLink armv4Stack armInstructions
|
||||
HiLink armv4SWP armInstructions
|
||||
|
||||
HiLink armNumericOp armOperator
|
||||
HiLink armRelative armOperator
|
||||
|
||||
" Link to standard syn groups so the 'colorschemes' work
|
||||
HiLink armOperator Operator
|
||||
HiLink armNumber Number
|
||||
HiLink armComment Comment
|
||||
HiLink armString String
|
||||
|
||||
HiLink armIdentifier Label
|
||||
HiLink armLabel Label
|
||||
HiLink gasDirective PreProc
|
||||
HiLink armDirective PreProc
|
||||
HiLink armCPreProc Identifier
|
||||
|
||||
HiLink armRegister Type
|
||||
HiLink armInstructions Function
|
||||
|
||||
HiLink armTodo Todo
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "armv5"
|
||||
|
73
syntax/include/arm_base_syntax.vim
Normal file
73
syntax/include/arm_base_syntax.vim
Normal file
@ -0,0 +1,73 @@
|
||||
|
||||
syn keyword armTodo contained todo fixme danger note notice bug author date
|
||||
|
||||
syn match armNumericOp "[+-/*%<>=&|^!]"
|
||||
|
||||
" hex
|
||||
syn match armNumber "[#\$]\?0x\x\+\>"
|
||||
syn match armNumber "[#\$]\?\d\x*h\>"
|
||||
" dec
|
||||
syn match armNumber "[#\$]\?\d\+\>"
|
||||
" bin
|
||||
syn match armNumber "[#\$]\?0b[01]\+\>"
|
||||
syn match armNumber "[#\$]\?[01]\+b\>"
|
||||
" floats
|
||||
syn match armNumber "\d*\.\d\+f\?\>"
|
||||
|
||||
" Comments
|
||||
syn region armComment start="//\|@" end="$" contains=armTodo
|
||||
" syn region armComment start="^#\|//\|@" end="$" contains=armTodo
|
||||
syn region armComment start="/\*" end="\*/" contains=armTodo
|
||||
|
||||
" Strings
|
||||
syn region armString start="\"" skip=+\\"+ end="\"\|$"
|
||||
syn region armString start="'" skip=+\\'+ end="'\|$"
|
||||
|
||||
" Assembler identifiers/labels/directives
|
||||
syn match armIdentifier "\<\h\w*\>"
|
||||
syn match armLabel "\<\h\w*:"
|
||||
syn match armCPreProc "#\h\w*\>"
|
||||
|
||||
so <sfile>:p:h/include/gas_directives.vim
|
||||
so <sfile>:p:h/include/arm_directives.vim
|
||||
|
||||
" Registers
|
||||
syn keyword armRegister R0 R1 R2 R3 R4 R5 R6 R7 R8
|
||||
syn keyword armRegister R9 R10 R11 R12 R13 R14 R15 SP LR PC SPSR CPSR CPSR_c CPSR_cxsf BP
|
||||
syn keyword armRegister A1 A2 A3 A4 V1 V2 V3 V4 V5 V6 V7 V8
|
||||
|
||||
" Conditional field to avoid repetition
|
||||
let armCond = '\%(AL\|CC\|CS\|EQ\|GE\|GT\|HI\|HS\|LE\|LO\|LS\|LT\|MI\|NE\|PL\|VC\|VS\)\?'
|
||||
|
||||
"
|
||||
" ARMv4 and thumb instructions
|
||||
"
|
||||
exec 'syn match armv4Instr "\%(ADC\|ADD\|AND\|BIC\|EOR\|MLA\|MOV\|MUL\|MVN\|NEG\|ORR\|RSB\|RSC\|SBC\|SMLAL\|SMULL\|SUB\|UMLAL\|UMULL\)' . armCond . 'S\?\>"'
|
||||
|
||||
exec 'syn match armv4InstrCond "\%(B\|BL\|BX\|CDP\|CMN\|CMP\|LDC\|MCR\|MRC\|MRS\|MSR\|STC\|SWI\|TEQ\|TST\)' . armCond . '\>"'
|
||||
|
||||
syn match armv4InstrNoCond "\%(ASR\|LSL\|LSR\|NOP\|POP\|PUSH\|ROR\|RRX\)\>"
|
||||
|
||||
exec 'syn match armv4LDR "\%(LDR\)' . armCond . '\%(B\?T\?\|H\|S[BH]\)\?\>"'
|
||||
exec 'syn match armv4STR "\%(STR\)' . armCond . '\%(B\?T\?\|H\)\?\>"'
|
||||
exec 'syn match armv4Stack "\%(LDM\|STM\)' . armCond . '\%([ID][BA]\|[EF][DA]\)\>"'
|
||||
exec 'syn match armv4SWP "SWP' . armCond . 'B\?\>"'
|
||||
|
||||
"
|
||||
" ARMv5 instructions
|
||||
"
|
||||
exec 'syn match armv5InstrCond "\%(BLX\|CLZ\|MCRR\|MRRC\|QADD\|QSUB\|QDADD\|QDSUB\)' . armCond . '\>"'
|
||||
syn match armv4InstrCond armv5InstrCond
|
||||
|
||||
syn match armv5InstrNoCond "\%(BKPT\|CDP2\|LDC2\|MCR2\|MRC2\|PLD\|STC2\)\>"
|
||||
syn match armv4InstrNoCond armv5InstrNoCond
|
||||
|
||||
exec 'syn match armv5Mul "\%(SMLA\|SMLAL\|SMLAW\|SMUL\|SMULW\)[BT][BT]' . armCond . '\>"'
|
||||
|
||||
exec 'syn match armv5LDR "\%(LDR\)' . armCond . 'D\>"'
|
||||
exec 'syn match armv5STR "\%(STR\)' . armCond . 'D\>"'
|
||||
syn match armv4LDR armv5LDR
|
||||
syn match armv4STR armv5STR
|
||||
|
||||
"syn match armRelative "@R[0-7]\|@a\s*+\s*dptr\|@[ab]"
|
||||
|
22
syntax/include/arm_directives.vim
Normal file
22
syntax/include/arm_directives.vim
Normal file
@ -0,0 +1,22 @@
|
||||
syn match armDirective "\.arch_extension"
|
||||
syn match armDirective "\.arm"
|
||||
syn match armDirective "\.code"
|
||||
syn match armDirective "\.dn"
|
||||
syn match armDirective "\.eabi_attribute"
|
||||
syn match armDirective "\.even"
|
||||
syn match armDirective "\.extend"
|
||||
syn match armDirective "\.force_thumb"
|
||||
syn match armDirective "\.ldouble"
|
||||
syn match armDirective "\.ltorg"
|
||||
syn match armDirective "\.movsp"
|
||||
syn match armDirective "\.object_arch"
|
||||
syn match armDirective "\.personality\%(index\)\?"
|
||||
syn match armDirective "\.pool"
|
||||
syn match armDirective "\.qn"
|
||||
syn match armDirective "\.setfp"
|
||||
syn match armDirective "\.secrel32"
|
||||
syn match armDirective "\.syntax"
|
||||
syn match armDirective "\.thumb\%(_func\|_set\)\?"
|
||||
syn match armDirective "\.tlsdescseq"
|
||||
syn match armDirective "\.vsave"
|
||||
|
147
syntax/include/gas_directives.vim
Normal file
147
syntax/include/gas_directives.vim
Normal file
@ -0,0 +1,147 @@
|
||||
syn match gasDirective "\.2byte"
|
||||
syn match gasDirective "\.4byte"
|
||||
syn match gasDirective "\.8byte"
|
||||
syn match gasDirective "\.aent"
|
||||
syn match gasDirective "\.abort"
|
||||
syn match gasDirective "\.align"
|
||||
syn match gasDirective "\.altmacro"
|
||||
syn match gasDirective "\.arch"
|
||||
syn match gasDirective "\.ascii"
|
||||
syn match gasDirective "\.asciz"
|
||||
syn match gasDirective "\.balign[wl]\?"
|
||||
syn match gasDirective "\.bss"
|
||||
syn match gasDirective "\.bundle_align"
|
||||
syn match gasDirective "\.bundle_lock"
|
||||
syn match gasDirective "\.bundle_unlock"
|
||||
syn match gasDirective "\.byte"
|
||||
syn match gasDirective "\.cantunwind"
|
||||
syn match gasDirective "\.cfi_\%(sections\|startproc\|endproc\|personality\|lsda\|def_cfa\|def_cfa_register\|def_cfa_offset\|adjust_cfa_offset\|offset\|rel_offset\|register\|restore\|undefined\|same_value\|remember_state\|return_column\|signal_frame\|window_save\|escape\|val_encoded_addr\)"
|
||||
syn match gasDirective "\.comm"
|
||||
syn match gasDirective "\.cpadd"
|
||||
syn match gasDirective "\.cpload"
|
||||
syn match gasDirective "\.cplocal"
|
||||
syn match gasDirective "\.cprestore"
|
||||
syn match gasDirective "\.cpreturn"
|
||||
syn match gasDirective "\.cpsetup"
|
||||
syn match gasDirective "\.cpu"
|
||||
syn match gasDirective "\.data"
|
||||
syn match gasDirective "\.def"
|
||||
syn match gasDirective "\.desc"
|
||||
syn match gasDirective "\.dim"
|
||||
syn match gasDirective "\.double"
|
||||
syn match gasDirective "\.dword"
|
||||
syn match gasDirective "\.dynsym"
|
||||
syn match gasDirective "\.eject"
|
||||
syn match gasDirective "\.else"
|
||||
syn match gasDirective "\.elseif"
|
||||
syn match gasDirective "\.end"
|
||||
syn match gasDirective "\.endef"
|
||||
syn match gasDirective "\.endfunc"
|
||||
syn match gasDirective "\.endif"
|
||||
syn match gasDirective "\.endm"
|
||||
syn match gasDirective "\.endr"
|
||||
syn match gasDirective "\.equ"
|
||||
syn match gasDirective "\.equiv"
|
||||
syn match gasDirective "\.eqv"
|
||||
syn match gasDirective "\.err"
|
||||
syn match gasDirective "\.error"
|
||||
syn match gasDirective "\.exitm"
|
||||
syn match gasDirective "\.extern"
|
||||
syn match gasDirective "\.fail"
|
||||
syn match gasDirective "\.file"
|
||||
syn match gasDirective "\.fill"
|
||||
syn match gasDirective "\.float"
|
||||
syn match gasDirective "\.fmask"
|
||||
syn match gasDirective "\.fnend"
|
||||
syn match gasDirective "\.fnstart"
|
||||
syn match gasDirective "\.fpu"
|
||||
syn match gasDirective "\.frame"
|
||||
syn match gasDirective "\.func"
|
||||
syn match gasDirective "\.global"
|
||||
syn match gasDirective "\.globl"
|
||||
syn match gasDirective "\.gpvalue"
|
||||
syn match gasDirective "\.gpword"
|
||||
syn match gasDirective "\.gnu_attribute"
|
||||
syn match gasDirective "\.handlerdata"
|
||||
syn match gasDirective "\.hidden"
|
||||
syn match gasDirective "\.hword"
|
||||
syn match gasDirective "\.ident"
|
||||
syn match gasDirective "\.if"
|
||||
syn match gasDirective "\.incbin"
|
||||
syn match gasDirective "\.include"
|
||||
syn match gasDirective "\.inst\%(\.[nw]\)\?"
|
||||
syn match gasDirective "\.int"
|
||||
syn match gasDirective "\.internal"
|
||||
syn match gasDirective "\.irp[c]"
|
||||
syn match gasDirective "\.kdata"
|
||||
syn match gasDirective "\.ktext"
|
||||
syn match gasDirective "\.lab"
|
||||
syn match gasDirective "\.lcomm"
|
||||
syn match gasDirective "\.lflags"
|
||||
syn match gasDirective "\.line"
|
||||
syn match gasDirective "\.linkonce"
|
||||
syn match gasDirective "\.list"
|
||||
syn match gasDirective "\.ln"
|
||||
syn match gasDirective "\.loc"
|
||||
syn match gasDirective "\.loc_mark_labels"
|
||||
syn match gasDirective "\.local"
|
||||
syn match gasDirective "\.long"
|
||||
syn match gasDirective "\.macro"
|
||||
syn match gasDirective "\.mask"
|
||||
syn match gasDirective "\.mri"
|
||||
syn match gasDirective "\.noaltmacro"
|
||||
syn match gasDirective "\.nolist"
|
||||
syn match gasDirective "\.nop"
|
||||
syn match gasDirective "\.octa"
|
||||
syn match gasDirective "\.option"
|
||||
syn match gasDirective "\.org"
|
||||
syn match gasDirective "\.p2align[wl]\?"
|
||||
syn match gasDirective "\.pad"
|
||||
syn match gasDirective "\.popsection"
|
||||
syn match gasDirective "\.previous"
|
||||
syn match gasDirective "\.print"
|
||||
syn match gasDirective "\.protected"
|
||||
syn match gasDirective "\.psize"
|
||||
syn match gasDirective "\.purgem"
|
||||
syn match gasDirective "\.pushsection"
|
||||
syn match gasDirective "\.quad"
|
||||
syn match gasDirective "\.rdata"
|
||||
syn match gasDirective "\.reloc"
|
||||
syn match gasDirective "\.rept"
|
||||
syn match gasDirective "\.repeat"
|
||||
syn match gasDirective "\.req"
|
||||
syn match gasDirective "\.save"
|
||||
syn match gasDirective "\.sbttl"
|
||||
syn match gasDirective "\.scl"
|
||||
syn match gasDirective "\.sdata"
|
||||
syn match gasDirective "\.section"
|
||||
syn match gasDirective "\.set"
|
||||
syn match gasDirective "\.short"
|
||||
syn match gasDirective "\.single"
|
||||
syn match gasDirective "\.size"
|
||||
syn match gasDirective "\.skip"
|
||||
syn match gasDirective "\.sleb128"
|
||||
syn match gasDirective "\.space"
|
||||
syn match gasDirective "\.stab[dns]"
|
||||
syn match gasDirective "\.string"
|
||||
syn match gasDirective "\.struct"
|
||||
syn match gasDirective "\.subsection"
|
||||
syn match gasDirective "\.symver"
|
||||
syn match gasDirective "\.tag"
|
||||
syn match gasDirective "\.text"
|
||||
syn match gasDirective "\.title"
|
||||
syn match gasDirective "\.type"
|
||||
syn match gasDirective "\.uleb128"
|
||||
syn match gasDirective "\.unreq"
|
||||
syn match gasDirective "\.unwind_raw"
|
||||
syn match gasDirective "\.val"
|
||||
syn match gasDirective "\.version"
|
||||
syn match gasDirective "\.verstamp"
|
||||
syn match gasDirective "\.vtable_entry"
|
||||
syn match gasDirective "\.vtable_inherit"
|
||||
syn match gasDirective "\.warning"
|
||||
syn match gasDirective "\.weak"
|
||||
syn match gasDirective "\.weakext"
|
||||
syn match gasDirective "\.weakref"
|
||||
syn match gasDirective "\.word"
|
||||
|
9
test/armv7-test.s
Normal file
9
test/armv7-test.s
Normal file
@ -0,0 +1,9 @@
|
||||
adc r0, r1
|
||||
add R1, R2
|
||||
and R2,r3
|
||||
bic r3 , r4
|
||||
eor r4,r5
|
||||
mla r5,R6
|
||||
mov R6,R7
|
||||
|
||||
@ vim:ft=armv5
|
Loading…
x
Reference in New Issue
Block a user