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