7
|
1 " Vim syntax file
|
|
2 " Language: Flat Assembler (FASM)
|
|
3 " Maintainer: Ron Aaron <ron@ronware.org>
|
3371
|
4 " Last Change: 2012/02/13
|
7
|
5 " Vim URL: http://www.vim.org/lang.html
|
|
6 " FASM Home: http://flatassembler.net/
|
3371
|
7 " FASM Version: 1.56
|
7
|
8
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
3371
|
15 let s:cpo_save = &cpo
|
|
16 set cpo&vim
|
|
17
|
7
|
18 setlocal iskeyword=a-z,A-Z,48-57,.,_
|
|
19 setlocal isident=a-z,A-Z,48-57,.,_
|
|
20 syn case ignore
|
|
21
|
|
22 syn keyword fasmRegister ah al ax bh bl bp bx ch cl cr0 cr1 cr2 cr3 cr4 cr5 cr6
|
|
23 syn keyword fasmRegister cr7 cs cx dh di dl dr0 dr1 dr2 dr3 dr4 dr5 dr6 dr7 ds dx
|
|
24 syn keyword fasmRegister eax ebp ebx ecx edi edx es esi esp fs gs mm0 mm1 mm2 mm3
|
|
25 syn keyword fasmRegister mm4 mm5 mm6 mm7 si sp ss st st0 st1 st2 st3 st4 st5 st6
|
|
26 syn keyword fasmRegister st7 tr0 tr1 tr2 tr3 tr4 tr5 tr6 tr7 xmm0 xmm1 xmm2 xmm3
|
|
27 syn keyword fasmRegister xmm4 xmm5 xmm6 xmm7
|
|
28 syn keyword fasmAddressSizes byte dqword dword fword pword qword tword word
|
|
29 syn keyword fasmDataDirectives db dd df dp dq dt du dw file rb rd rf rp rq rt rw
|
|
30 syn keyword fasmInstr aaa aad aam aas adc add addpd addps addsd addss addsubpd
|
|
31 syn keyword fasmInstr addsubps and andnpd andnps andpd andps arpl bound bsf bsr
|
|
32 syn keyword fasmInstr bswap bt btc btr bts call cbw cdq clc cld clflush cli clts
|
|
33 syn keyword fasmInstr cmc cmova cmovae cmovb cmovbe cmovc cmove cmovg cmovge cmovl
|
|
34 syn keyword fasmInstr cmovle cmovna cmovnae cmovnb cmovnbe cmovnc cmovne cmovng
|
|
35 syn keyword fasmInstr cmovnge cmovnl cmovnle cmovno cmovnp cmovns cmovnz cmovo cmovp
|
|
36 syn keyword fasmInstr cmovpe cmovpo cmovs cmovz cmp cmpeqpd cmpeqps cmpeqsd cmpeqss
|
|
37 syn keyword fasmInstr cmplepd cmpleps cmplesd cmpless cmpltpd cmpltps cmpltsd cmpltss
|
|
38 syn keyword fasmInstr cmpneqpd cmpneqps cmpneqsd cmpneqss cmpnlepd cmpnleps cmpnlesd
|
|
39 syn keyword fasmInstr cmpnless cmpnltpd cmpnltps cmpnltsd cmpnltss cmpordpd cmpordps
|
|
40 syn keyword fasmInstr cmpordsd cmpordss cmppd cmpps cmps cmpsb cmpsd cmpss cmpsw
|
|
41 syn keyword fasmInstr cmpunordpd cmpunordps cmpunordsd cmpunordss cmpxchg cmpxchg8b
|
|
42 syn keyword fasmInstr comisd comiss cpuid cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps
|
|
43 syn keyword fasmInstr cvtpi2pd cvtpi2ps cvtps2dq cvtps2pd cvtps2pi cvtsd2si cvtsd2ss
|
|
44 syn keyword fasmInstr cvtsi2sd cvtsi2ss cvtss2sd cvtss2si cvttpd2dq cvttpd2pi cvttps2dq
|
|
45 syn keyword fasmInstr cvttps2pi cvttsd2si cvttss2si cwd cwde daa das data dec div
|
|
46 syn keyword fasmInstr divpd divps divsd divss else emms end enter extrn f2xm1 fabs
|
|
47 syn keyword fasmInstr fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb
|
|
48 syn keyword fasmInstr fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp
|
|
49 syn keyword fasmInstr fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree
|
|
50 syn keyword fasmInstr ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp
|
|
51 syn keyword fasmInstr finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv
|
|
52 syn keyword fasmInstr fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi
|
|
53 syn keyword fasmInstr fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem
|
|
54 syn keyword fasmInstr fprem1 fptan frndint frstor frstpm fsave fscale fsetpm fsin
|
|
55 syn keyword fasmInstr fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr
|
|
56 syn keyword fasmInstr fsubrp ftst fucom fucomi fucomip fucomp fucompp fwait fxam
|
|
57 syn keyword fasmInstr fxch fxrstor fxsave fxtract fyl2x fyl2xp1 haddpd haddps heap
|
|
58 syn keyword fasmInstr hlt hsubpd hsubps idiv if imul in inc ins insb insd insw int
|
|
59 syn keyword fasmInstr int3 into invd invlpg iret iretd iretw ja jae jb jbe jc jcxz
|
|
60 syn keyword fasmInstr je jecxz jg jge jl jle jmp jna jnae jnb jnbe jnc jne jng jnge
|
|
61 syn keyword fasmInstr jnl jnle jno jnp jns jnz jo jp jpe jpo js jz lahf lar lddqu
|
|
62 syn keyword fasmInstr ldmxcsr lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw
|
|
63 syn keyword fasmInstr load loadall286 loadall386 lock lods lodsb lodsd lodsw loop
|
|
64 syn keyword fasmInstr loopd loope looped loopew loopne loopned loopnew loopnz loopnzd
|
|
65 syn keyword fasmInstr loopnzw loopw loopz loopzd loopzw lsl lss ltr maskmovdqu maskmovq
|
|
66 syn keyword fasmInstr maxpd maxps maxsd maxss mfence minpd minps minsd minss monitor
|
|
67 syn keyword fasmInstr mov movapd movaps movd movddup movdq2q movdqa movdqu movhlps
|
|
68 syn keyword fasmInstr movhpd movhps movlhps movlpd movlps movmskpd movmskps movntdq
|
|
69 syn keyword fasmInstr movnti movntpd movntps movntq movq movq2dq movs movsb movsd
|
|
70 syn keyword fasmInstr movshdup movsldup movss movsw movsx movupd movups movzx mul
|
|
71 syn keyword fasmInstr mulpd mulps mulsd mulss mwait neg nop not or org orpd orps
|
|
72 syn keyword fasmInstr out outs outsb outsd outsw packssdw packsswb packuswb paddb
|
|
73 syn keyword fasmInstr paddd paddq paddsb paddsw paddusb paddusw paddw pand pandn
|
|
74 syn keyword fasmInstr pause pavgb pavgusb pavgw pcmpeqb pcmpeqd pcmpeqw pcmpgtb
|
|
75 syn keyword fasmInstr pcmpgtd pcmpgtw pextrw pf2id pf2iw pfacc pfadd pfcmpeq pfcmpge
|
|
76 syn keyword fasmInstr pfcmpgt pfmax pfmin pfmul pfnacc pfpnacc pfrcp pfrcpit1 pfrcpit2
|
|
77 syn keyword fasmInstr pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pi2fw pinsrw pmaddwd pmaxsw
|
|
78 syn keyword fasmInstr pmaxub pminsw pminub pmovmskb pmulhrw pmulhuw pmulhw pmullw
|
|
79 syn keyword fasmInstr pmuludq pop popa popad popaw popd popf popfd popfw popw por
|
|
80 syn keyword fasmInstr prefetch prefetchnta prefetcht0 prefetcht1 prefetcht2 prefetchw
|
|
81 syn keyword fasmInstr psadbw pshufd pshufhw pshuflw pshufw pslld pslldq psllq psllw
|
|
82 syn keyword fasmInstr psrad psraw psrld psrldq psrlq psrlw psubb psubd psubq psubsb
|
|
83 syn keyword fasmInstr psubsw psubusb psubusw psubw pswapd punpckhbw punpckhdq punpckhqdq
|
|
84 syn keyword fasmInstr punpckhwd punpcklbw punpckldq punpcklqdq punpcklwd push pusha
|
|
85 syn keyword fasmInstr pushad pushaw pushd pushf pushfd pushfw pushw pxor rcl rcpps
|
|
86 syn keyword fasmInstr rcpss rcr rdmsr rdpmc rdtsc rep repe repne repnz repz ret
|
|
87 syn keyword fasmInstr retd retf retfd retfw retn retnd retnw retw rol ror rsm rsqrtps
|
|
88 syn keyword fasmInstr rsqrtss sahf sal salc sar sbb scas scasb scasd scasw seta
|
|
89 syn keyword fasmInstr setae setalc setb setbe setc sete setg setge setl setle setna
|
|
90 syn keyword fasmInstr setnae setnb setnbe setnc setne setng setnge setnl setnle
|
|
91 syn keyword fasmInstr setno setnp setns setnz seto setp setpe setpo sets setz sfence
|
|
92 syn keyword fasmInstr sgdt shl shld shr shrd shufpd shufps sidt sldt smsw sqrtpd
|
|
93 syn keyword fasmInstr sqrtps sqrtsd sqrtss stc std sti stmxcsr store stos stosb
|
|
94 syn keyword fasmInstr stosd stosw str sub subpd subps subsd subss sysenter sysexit
|
|
95 syn keyword fasmInstr test ucomisd ucomiss ud2 unpckhpd unpckhps unpcklpd unpcklps
|
|
96 syn keyword fasmInstr verr verw wait wbinvd wrmsr xadd xchg xlat xlatb xor xorpd
|
|
97 syn keyword fasmPreprocess common equ fix forward include local macro purge restore
|
|
98 syn keyword fasmPreprocess reverse struc
|
|
99 syn keyword fasmDirective align binary code coff console discardable display dll
|
|
100 syn keyword fasmDirective elf entry executable export extern far fixups format gui
|
|
101 syn keyword fasmDirective import label ms mz native near notpageable pe public readable
|
|
102 syn keyword fasmDirective repeat resource section segment shareable stack times
|
3371
|
103 syn keyword fasmDirective use16 use32 virtual wdm writable writeable
|
7
|
104 syn keyword fasmOperator as at defined eq eqtype from mod on ptr rva used
|
|
105
|
|
106 syn match fasmNumericOperator "[+-/*]"
|
|
107 syn match fasmLogicalOperator "[=|&~<>]\|<=\|>=\|<>"
|
|
108 " numbers
|
|
109 syn match fasmBinaryNumber "\<[01]\+b\>"
|
|
110 syn match fasmHexNumber "\<\d\x*h\>"
|
|
111 syn match fasmHexNumber "\<\(0x\|$\)\x*\>"
|
|
112 syn match fasmFPUNumber "\<\d\+\(\.\d*\)\=\(e[-+]\=\d*\)\=\>"
|
|
113 syn match fasmOctalNumber "\<\(0\o\+o\=\|\o\+o\)\>"
|
|
114 syn match fasmDecimalNumber "\<\(0\|[1-9]\d*\)\>"
|
|
115 syn region fasmComment start=";" end="$"
|
|
116 syn region fasmString start="\"" end="\"\|$"
|
|
117 syn region fasmString start="'" end="'\|$"
|
|
118 syn match fasmSymbol "[()|\[\]:]"
|
|
119 syn match fasmSpecial "[#?%$,]"
|
|
120 syn match fasmLabel "^\s*[^; \t]\+:"
|
|
121
|
|
122 hi def link fasmAddressSizes type
|
|
123 hi def link fasmNumericOperator fasmOperator
|
|
124 hi def link fasmLogicalOperator fasmOperator
|
|
125
|
|
126 hi def link fasmBinaryNumber fasmNumber
|
|
127 hi def link fasmHexNumber fasmNumber
|
|
128 hi def link fasmFPUNumber fasmNumber
|
|
129 hi def link fasmOctalNumber fasmNumber
|
|
130 hi def link fasmDecimalNumber fasmNumber
|
|
131
|
|
132 hi def link fasmSymbols fasmRegister
|
|
133 hi def link fasmPreprocess fasmDirective
|
|
134
|
|
135 " link to standard syn groups so the 'colorschemes' work:
|
|
136 hi def link fasmOperator operator
|
|
137 hi def link fasmComment comment
|
|
138 hi def link fasmDirective preproc
|
|
139 hi def link fasmRegister type
|
|
140 hi def link fasmNumber constant
|
|
141 hi def link fasmSymbol structure
|
|
142 hi def link fasmString String
|
|
143 hi def link fasmSpecial special
|
|
144 hi def link fasmInstr keyword
|
|
145 hi def link fasmLabel label
|
|
146 hi def link fasmPrefix preproc
|
|
147 let b:current_syntax = "fasm"
|
3371
|
148
|
|
149 let &cpo = s:cpo_save
|
|
150 unlet s:cpo_save
|
|
151
|
7
|
152 " vim: ts=8 sw=8 :
|