blob: a4b71229ec6c67875f907de0d6f8a94cd0dd4aed [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: (VAX) Macro Assembly
3" Maintainer: Tom Uijldert <tom.uijldert [at] cmg.nl>
4" Last change: 2004 May 16
5"
6" This is incomplete. Feel free to contribute...
7"
8
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02009" quit when a syntax file was already loaded
10if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000011 finish
12endif
13
14syn case ignore
15
16" Partial list of register symbols
17syn keyword vmasmReg r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12
18syn keyword vmasmReg ap fp sp pc iv dv
19
20" All matches - order is important!
21syn keyword vmasmOpcode adawi adwc ashl ashq bitb bitw bitl decb decw decl
22syn keyword vmasmOpcode ediv emul incb incw incl mcomb mcomw mcoml
23syn keyword vmasmOpcode movzbw movzbl movzwl popl pushl rotl sbwc
24syn keyword vmasmOpcode cmpv cmpzv cmpc3 cmpc5 locc matchc movc3 movc5
25syn keyword vmasmOpcode movtc movtuc scanc skpc spanc crc extv extzv
26syn keyword vmasmOpcode ffc ffs insv aobleq aoblss bbc bbs bbcci bbssi
27syn keyword vmasmOpcode blbc blbs brb brw bsbb bsbw caseb casew casel
28syn keyword vmasmOpcode jmp jsb rsb sobgeq sobgtr callg calls ret
29syn keyword vmasmOpcode bicpsw bispsw bpt halt index movpsl nop popr pushr xfc
30syn keyword vmasmOpcode insqhi insqti insque remqhi remqti remque
31syn keyword vmasmOpcode addp4 addp6 ashp cmpp3 cmpp4 cvtpl cvtlp cvtps cvtpt
32syn keyword vmasmOpcode cvtsp cvttp divp movp mulp subp4 subp6 editpc
33syn keyword vmasmOpcode prober probew rei ldpctx svpctx mfpr mtpr bugw bugl
34syn keyword vmasmOpcode vldl vldq vgathl vgathq vstl vstq vscatl vscatq
35syn keyword vmasmOpcode vvcvt iota mfvp mtvp vsync
36syn keyword vmasmOpcode beql[u] bgtr[u] blss[u]
37syn match vmasmOpcode "\<add[bwlfdgh][23]\>"
38syn match vmasmOpcode "\<bi[cs][bwl][23]\>"
39syn match vmasmOpcode "\<clr[bwlqofdgh]\>"
40syn match vmasmOpcode "\<cmp[bwlfdgh]\>"
41syn match vmasmOpcode "\<cvt[bwlfdgh][bwlfdgh]\>"
42syn match vmasmOpcode "\<cvtr[fdgh]l\>"
43syn match vmasmOpcode "\<div[bwlfdgh][23]\>"
44syn match vmasmOpcode "\<emod[fdgh]\>"
45syn match vmasmOpcode "\<mneg[bwlfdgh]\>"
46syn match vmasmOpcode "\<mov[bwlqofdgh]\>"
47syn match vmasmOpcode "\<mul[bwlfdgh][23]\>"
48syn match vmasmOpcode "\<poly[fdgh]\>"
49syn match vmasmOpcode "\<sub[bwlfdgh][23]\>"
50syn match vmasmOpcode "\<tst[bwlfdgh]\>"
51syn match vmasmOpcode "\<xor[bwl][23]\>"
52syn match vmasmOpcode "\<mova[bwlfqdgho]\>"
53syn match vmasmOpcode "\<push[bwlfqdgho]\>"
54syn match vmasmOpcode "\<acb[bwlfgdh]\>"
55syn match vmasmOpcode "\<b[lng]equ\=\>"
56syn match vmasmOpcode "\<b[cv][cs]\>"
57syn match vmasmOpcode "\<bb[cs][cs]\>"
58syn match vmasmOpcode "\<v[vs]add[lfdg]\>"
59syn match vmasmOpcode "\<v[vs]cmp[lfdg]\>"
60syn match vmasmOpcode "\<v[vs]div[fdg]\>"
61syn match vmasmOpcode "\<v[vs]mul[lfdg]\>"
62syn match vmasmOpcode "\<v[vs]sub[lfdg]\>"
63syn match vmasmOpcode "\<v[vs]bi[cs]l\>"
64syn match vmasmOpcode "\<v[vs]xorl\>"
65syn match vmasmOpcode "\<v[vs]merge\>"
66syn match vmasmOpcode "\<v[vs]s[rl]ll\>"
67
68" Various number formats
69syn match vmasmdecNumber "[+-]\=[0-9]\+\>"
70syn match vmasmdecNumber "^d[0-9]\+\>"
71syn match vmasmhexNumber "^x[0-9a-f]\+\>"
72syn match vmasmoctNumber "^o[0-7]\+\>"
73syn match vmasmbinNumber "^b[01]\+\>"
74syn match vmasmfloatNumber "[-+]\=[0-9]\+E[-+]\=[0-9]\+"
75syn match vmasmfloatNumber "[-+]\=[0-9]\+\.[0-9]*\(E[-+]\=[0-9]\+\)\="
76
77" Valid labels
78syn match vmasmLabel "^[a-z_$.][a-z0-9_$.]\{,30}::\="
79syn match vmasmLabel "\<[0-9]\{1,5}\$:\=" " Local label
80
81" Character string constants
82" Too complex really. Could be "<...>" but those could also be
83" expressions. Don't know how to handle chosen delimiters
84" ("^<sep>...<sep>")
85" syn region vmasmString start="<" end=">" oneline
86
87" Operators
88syn match vmasmOperator "[-+*/@&!\\]"
89syn match vmasmOperator "="
90syn match vmasmOperator "==" " Global assignment
91syn match vmasmOperator "%length(.*)"
92syn match vmasmOperator "%locate(.*)"
93syn match vmasmOperator "%extract(.*)"
94syn match vmasmOperator "^[amfc]"
95syn match vmasmOperator "[bwlg]^"
96
97syn match vmasmOperator "\<\(not_\)\=equal\>"
98syn match vmasmOperator "\<less_equal\>"
99syn match vmasmOperator "\<greater\(_equal\)\=\>"
100syn match vmasmOperator "\<less_than\>"
101syn match vmasmOperator "\<\(not_\)\=defined\>"
102syn match vmasmOperator "\<\(not_\)\=blank\>"
103syn match vmasmOperator "\<identical\>"
104syn match vmasmOperator "\<different\>"
105syn match vmasmOperator "\<eq\>"
106syn match vmasmOperator "\<[gl]t\>"
107syn match vmasmOperator "\<n\=df\>"
108syn match vmasmOperator "\<n\=b\>"
109syn match vmasmOperator "\<idn\>"
110syn match vmasmOperator "\<[nlg]e\>"
111syn match vmasmOperator "\<dif\>"
112
113" Special items for comments
114syn keyword vmasmTodo contained todo
115
116" Comments
117syn match vmasmComment ";.*" contains=vmasmTodo
118
119" Include
120syn match vmasmInclude "\.library\>"
121
122" Macro definition
123syn match vmasmMacro "\.macro\>"
124syn match vmasmMacro "\.mexit\>"
125syn match vmasmMacro "\.endm\>"
126syn match vmasmMacro "\.mcall\>"
127syn match vmasmMacro "\.mdelete\>"
128
129" Conditional assembly
130syn match vmasmPreCond "\.iff\=\>"
131syn match vmasmPreCond "\.if_false\>"
132syn match vmasmPreCond "\.iftf\=\>"
133syn match vmasmPreCond "\.if_true\(_false\)\=\>"
134syn match vmasmPreCond "\.iif\>"
135
136" Loop control
137syn match vmasmRepeat "\.irpc\=\>"
138syn match vmasmRepeat "\.repeat\>"
139syn match vmasmRepeat "\.rept\>"
140syn match vmasmRepeat "\.endr\>"
141
142" Directives
143syn match vmasmDirective "\.address\>"
144syn match vmasmDirective "\.align\>"
145syn match vmasmDirective "\.asci[cdiz]\>"
146syn match vmasmDirective "\.blk[abdfghloqw]\>"
147syn match vmasmDirective "\.\(signed_\)\=byte\>"
148syn match vmasmDirective "\.\(no\)\=cross\>"
149syn match vmasmDirective "\.debug\>"
150syn match vmasmDirective "\.default displacement\>"
151syn match vmasmDirective "\.[dfgh]_floating\>"
152syn match vmasmDirective "\.disable\>"
153syn match vmasmDirective "\.double\>"
154syn match vmasmDirective "\.dsabl\>"
155syn match vmasmDirective "\.enable\=\>"
156syn match vmasmDirective "\.endc\=\>"
157syn match vmasmDirective "\.entry\>"
158syn match vmasmDirective "\.error\>"
159syn match vmasmDirective "\.even\>"
160syn match vmasmDirective "\.external\>"
161syn match vmasmDirective "\.extrn\>"
162syn match vmasmDirective "\.float\>"
163syn match vmasmDirective "\.globa\=l\>"
164syn match vmasmDirective "\.ident\>"
165syn match vmasmDirective "\.link\>"
166syn match vmasmDirective "\.list\>"
167syn match vmasmDirective "\.long\>"
168syn match vmasmDirective "\.mask\>"
169syn match vmasmDirective "\.narg\>"
170syn match vmasmDirective "\.nchr\>"
171syn match vmasmDirective "\.nlist\>"
172syn match vmasmDirective "\.ntype\>"
173syn match vmasmDirective "\.octa\>"
174syn match vmasmDirective "\.odd\>"
175syn match vmasmDirective "\.opdef\>"
176syn match vmasmDirective "\.packed\>"
177syn match vmasmDirective "\.page\>"
178syn match vmasmDirective "\.print\>"
179syn match vmasmDirective "\.psect\>"
180syn match vmasmDirective "\.quad\>"
181syn match vmasmDirective "\.ref[1248]\>"
182syn match vmasmDirective "\.ref16\>"
183syn match vmasmDirective "\.restore\(_psect\)\=\>"
184syn match vmasmDirective "\.save\(_psect\)\=\>"
185syn match vmasmDirective "\.sbttl\>"
186syn match vmasmDirective "\.\(no\)\=show\>"
187syn match vmasmDirective "\.\(sub\)\=title\>"
188syn match vmasmDirective "\.transfer\>"
189syn match vmasmDirective "\.warn\>"
190syn match vmasmDirective "\.weak\>"
191syn match vmasmDirective "\.\(signed_\)\=word\>"
192
193syn case match
194
195" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200196" Only when an item doesn't have highlighting yet
197command -nargs=+ HiLink hi def link <args>
Bram Moolenaar071d4272004-06-13 20:20:40 +0000198
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200199" The default methods for highlighting. Can be overridden later
200" Comment Constant Error Identifier PreProc Special Statement Todo Type
201"
202" Constant Boolean Character Number String
203" Identifier Function
204" PreProc Define Include Macro PreCondit
205" Special Debug Delimiter SpecialChar SpecialComment Tag
206" Statement Conditional Exception Keyword Label Operator Repeat
207" Type StorageClass Structure Typedef
Bram Moolenaar071d4272004-06-13 20:20:40 +0000208
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200209HiLink vmasmComment Comment
210HiLink vmasmTodo Todo
Bram Moolenaar071d4272004-06-13 20:20:40 +0000211
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200212HiLink vmasmhexNumber Number " Constant
213HiLink vmasmoctNumber Number " Constant
214HiLink vmasmbinNumber Number " Constant
215HiLink vmasmdecNumber Number " Constant
216HiLink vmasmfloatNumber Number " Constant
Bram Moolenaar071d4272004-06-13 20:20:40 +0000217
218" HiLink vmasmString String " Constant
219
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200220HiLink vmasmReg Identifier
221HiLink vmasmOperator Identifier
Bram Moolenaar071d4272004-06-13 20:20:40 +0000222
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200223HiLink vmasmInclude Include " PreProc
224HiLink vmasmMacro Macro " PreProc
225" HiLink vmasmMacroParam Keyword " Statement
Bram Moolenaar071d4272004-06-13 20:20:40 +0000226
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200227HiLink vmasmDirective Special
228HiLink vmasmPreCond Special
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229
230
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200231HiLink vmasmOpcode Statement
232HiLink vmasmCond Conditional " Statement
233HiLink vmasmRepeat Repeat " Statement
Bram Moolenaar071d4272004-06-13 20:20:40 +0000234
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200235HiLink vmasmLabel Type
236delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +0000237
238let b:current_syntax = "vmasm"
239
240" vim: ts=8 sw=2