-
Notifications
You must be signed in to change notification settings - Fork 3
/
Assembly x86 AT&T.JSON-tmLanguage
364 lines (364 loc) · 22.2 KB
/
Assembly x86 AT&T.JSON-tmLanguage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
{
"patterns": [
{
"name": "entity.name.function.instructions",
"match": "\\b(?i:aa[adms]|adc[bwlq]?|x?add[bwlq]?|and[bwlq]?|arpl|bound[wl]?|bs[fr][wlq]?|bswap[lq]?|bt[crs]?[wlq]?|call[wlq]?|clc|cld|cli|cltd[dqw]?|clts|cmc|cmov(?:n?[abgl]e?|n?[ceosz]|np|p[eo]?)?[lqw]?|cmp[bwlq]?|cmps[bwdlq]?|cmpxchg[bwlq]?|cmpxchg(?:8|16)b|cpuid|c[lw]td[bwlq]?|daa|das|dec[bwlq]?|div[bwlq]?|enter[wl]?|esc|hlt|idiv[bwlq]?|imul[bwlq]?|in[bwlq]?|inc[bwlq]?|insd?[bwlq]?|int(?:\\s*3|o)?|inv(?:d|pcid)?|invlpg|iret[dfwq]?|j(?:n?[abgl]e?|n?[ceosz]|np|p[eo]?)|jmp[lq]?|j[er]?cxz|[ls]ahf|lar|lcall[wlq]?|l[d-gs]s[wl]|lea[bwlq]?|leave[lwq]?|l[defgs]s|[ls][gil]dt[wl]?|ljmp[wl]?|lmsw|loadall|lods[bwdlq]?|loop(?:n?[ez][dw]?)?|loopw|lret|lsl|ltr|mov(?:(s?(?:b[lwq]?|w[lq]?|lq?|q)?)|(?:z?(?:b[lwq]|w[lq]|l|q)))?|movd|movabs[bwlq]?A?|movs(?:x?d|w)|mov[sz]x[bwl]?|movzb|mul[bwlq]?|neg[bwlq]?|nop|not[bwlq]?|x?or[bwlq]?|out[bwlq]?|outs[bdwl]?|pop[bwlq]?|popal?|pop[af]d|popf[wlq]?|push[bwlq]?|pushal?|push[af]d|pushf[wlq]?|rc[lr][bwlq]?|(?:rd|wr)msr|rdtscp?|ret[fw]?[ql]?|ro[lr][bwlq]?|rsm|sa[lr][bwlq]?|sbb[bwlq]?|scas[bwdlq]?|set(?:n?[abgl]e?|n?[ceosz]|np|p[eo]?)b?|sh[lr]d?[bwlq]?|smsw|stc|std|sti|stos[bdqlw]?|str|sub[bwlq]?|swapgs|syscall|sysret|sysenter|sysexit|test[bwlq]?|ud1|ud2[ab]?|ver[rw]|fwait|wbinvd|xchg[bwlq]?A?|x[gs]etbv|xlatb?|xsave[cs]?(?:64)?|xrstors?(?:64)?)(?!:)\\b",
"comment" : "I may organize these later based on processor additions. Please investigate pop/pushq_cfi instructions."
},
{
"name": "entity.name.function.conversion.instructions",
"match": "\\b(?i:cbw|cdqe?|cwde?|cdo|cqo|cbtw|cwt[ld]|clt[dq]|cqto)(?!:)\\b",
"comment": "Data type conversions. Apparently the Intel ones work too. I tried it."
},
{
"name": "keyword.name.function.prefixes",
"match": "\\b(?i:rep(?:n?[ez])?|[c-gs]s|(?:addr|data)(?:16|32)|lock|wait|rex(?:64(?:xyz)?)?)(?!:)\\b",
"comment": "Not really instructions."
},
{"comment": "Begin feature stuff:"},
{
"name": "entity.name.function.mmx_instructions",
"match": "\\b(?i:emms|movdq|mov[dq]b|pack(?:ssdw|[us]swb)|padd(?:[bdw]|u?s[bw])|pandn?|pcmp(?:eq|gt)[bdw]|pmaddwd|pmul[hl]w|psll[dqw]|psr(?:a[dw]|l[dqw])|psub(?:[bdw]|u?s[bw])|punpck[hl](?:bw|dq|wd)|px?or|rdpmc)(?!:)\\b",
"comment": "cpuid | grep -i mmx"
},
{
"name": "entity.name.function.sse",
"match": "\\b(?i:maskmovq|movntps|movntq|prefetcht[012]|prefetchnta|sfence)(?!:)\\b",
"comment": "cpuid | grep -i 'sse ext'"
},
{
"name": "entity.name.function.sse_simd",
"match": "\\b(?i:add[sp]s|cmp[ps]s|u?comiss|cvt(?:p(?:i2ps|s2pi)|s(?:i2ss|s2sd)q?|t(?:ps2pi|s[sd]2siq?))|div[ps]s|ldmxcsr|(?:max|min)[ps]s|mov(?:a|hl?|lh?|msk|nt)ps|v?mov(?:s|up)s|mul[ps]s|rcp[ps]s|r?sqrt[ps]s|shufps|stmxcsr|sub[ps]s|unpck[hl]ps|andn?ps|x?orps|pavg[bw]|pextrw|pminsrw|p(?:max|min)(?:sw|ub)|pmovmskb|pmulhuw|psadbw|pshufw)(?!:)\\b",
"comment": "cpuid | grep -i 'sse ext'"
},
{
"name": "entity.name.function.sse2",
"match": "\\b(?i:clflush|[lm]fence|maskmovdqu|v?movnt(?:dq|i[lw]?|pd)|pause)(?!:)\\b",
"comment": "cpuid | grep -i 'sse2'"
},
{
"name": "entity.name.function.sse2_simd",
"match": "\\b(?i:v?add[ps][ds]|andn?pd|bzhi[wl]?|cmp[ps]d|u?comisd|cvtdq2p[ds]|cvtt?pd2(?:dq|pi)|cvtpd2ps|cvtp[is]2pd|cvtt?ps2dq|cvtt?sd2s[is]|cvts[is]2sd|div[ps][ds]|v?(?:max|min)[ps][ds]|v?mov[ahlu]pd|v?movmskpd|v?mul[ps]d|x?orpd|shufpd|sqrt[ps]d|sub[ps]d|unpck[hl]pd|unpcklpd|movdq(?:2q|[au])|movq2dq|paddq|psubq|pmuludq|pshuf(?:[hl]w|d)|ps[lr]ldq|punpck[hl]qdq)(?!:)\\b",
"comment": "cpuid | grep -i 'sse2'"
},
{
"name": "entity.name.function.sse3",
"match": "\\b(?i:lddqu|monitor|mwait)(?!:)\\b",
"comment" : "cpuid | grep -i 'pni/sse3'"
},
{
"name": "entity.name.function.ssse3_simd",
"match": "\\b(?i:addsubp[ds]|haddp[ds]|hsubp[ds]|v?mov(?:d|s[hl])dup|psign[bdw]|pshufb|pmulhrsw|pmaddubsw|phsub(?:s?w|d)|phadd(?:s?w|d)|palignr|pabs[bdw])(?!:)\\b",
"comment" : "cpuid | grep -i 'ssse3'"
},
{
"name": "entity.name.function.sse4_simd",
"match": "\\b(?i:v?mpsadbw|phminposuw|pmul(?:ld|dq)|dpp[ds]|blendv?p[ds]|pblendvb|pblendw|pswapd|p(?:max|min)(?:s[bd]|u[wd])|roundp[ds]|rounds[ds]|insertps|pinsr[bwdq]|extractps|pextr[bdq]|pmov[sz]xb[dwq]|pmov[sz]xw[dq]|pmov[sz]xdq|pmov[sz]x|ptest|pcmpeqq|packusdw|v?movntdqa|lzcnt|popcnt|extrq|insertq|movnts[ds]|crc32|pcmp[ei]str[im]|pcmpgtq)(?!:)\\b",
"comment" : "cpuid | grep -i 'sse4'"
// I combined sse4.1 and 2 instructions here. Don't kill me.
},
{
"name": "entity.name.function.fpu_x87",
"match": "\\b(?i:f(?:2xm1|abs|add[psl]?|bld|b?stp|chs|n?clex|fcomp?l|u?comp{0,2}|decstp|n?disi|divr?[psl]?|n?eni|nsetpm|rstpm|free(?:p|\\s*ST)?|iadd[sl]?|icomp?|idivr?[sl]?|ildl?|imul[sl]?|incstp|n?init|ist(?:(?:pl?|l)|tp)?|isubr?[sl]?|ld[1slt]?|ldcw|ldenv[dw]?|ldl2[et]|ldl[gn]2|ldpi|ldz|mul[psl]?|nop|n?stenv[wd]?|n?stsw|pa?tan|prem1?|rndint|rstor[dw]?|n?savew?|scale|sqrt|st(?:p?[slt])|n?stcw|subr?[psl]?|tst|wait|xam|xch|xtract|yl2x(?:p1)?|setpm|cos|saved|sin(?:cos)?|cmovn?b?e?|cmovn?u|u?comip?|xrstor(?:64)?|xsave(?:64)?))(?!:)\\b",
"comment" : "cpuid | grep -i x87"
},
{
"name": "entity.name.function.aes_functions",
"match": "\\b(?i:v?aes(?:en|de)c(?:last)?|v?aeskeygenassist|aesimc)(?!:)\\b",
"comment" : "cpuid | grep -i aes"
},
{
"name": "entity.name.function.sha_functions",
"match": "\\b(?i:sha(?:(?:1|256)msg[12]|1nexte|1rnds4|256rnds2))(?!:)\\b",
"comment" : "cpuid | grep SHA"
},
{
"name": "entity.name.function.bmi1",
"match": "\\b(?i:andn[lq]?|bextr[lq]?|blsi[lq]?|blsmsk[lq]?|blsr[dlq]?|tzcnt[wlq]?)(?!:)\\b",
"comment" : "cpuid | grep -i 'bmi i'"
},
{
"name": "entity.name.function.bmi2",
"match": "\\b(?i:mulx[lq]?|pdep[lq]?|pext[lq]?|rorx[lq]?|s(?:h[lr]|ar)x)(?!:)\\b",
"comment" : "cpuid | grep -i 'bmi2'"
},
{
"name": "entity.name.function.adx",
"match": "\\b(?i:ad[co]x)l?(?!:)\\b",
"comment" : "cpuid | grep -i 'adx'"
},
{
"name": "entity.name.function.clmul",
"match": "\\b(?i:pclmulqdq)(?!:)\\b",
"comment" : "cpuid | grep -i 'clmul'"
},
{
"name": "entity.name.function.prefetchwt",
"match": "\\b(?i:prefetchw(t1)?)(?!:)\\b",
"comment": "cpuid | grep 'PREFETCHW'"
// Check for both prefetchw and prefetchwt
},
{
"name": "entity.name.function.amd3DNow",
"match": "\\b(?i:prefetch|femms|pavgusb|pf2id|pfacc|pfadd|pfcmpeq|pfcmpge|pfcmpgt|pfmax|pfmin|pfmul|pfrcp|pfrcpit[12]|pfrsqit1|pfrsqrt|pfsubr?|pi2fd|pmulhrw)\\b",
"comment": "cpuid | grep '3dnow' ???"
},
{
"name": "entity.name.function.amdnops",
"match": "\\b(?:nop[lwq])",
"comment": "Pretty sure this is AMD specific."
},
{
"name": "entity.name.function.clflushopt",
"match": "\\b(?i:clflushopt)(?!:)\\b",
"comment": "cpuid | grep -i 'clflush i'"
},
{
"name": "entity.name.function.rdseed",
"match": "\\b(?i:rdseed)(?!:)\\b",
"comment": "cpuid | grep -i 'rdseed'"
},
{
"name": "entity.name.function.mpx",
"match": "\\b(?i:bnd(?:c[uln]|mk|stx))(?!:)\\b",
"comment": "cpuid | grep -i 'mpx'"
// May not show up at all.
},
{
"name": "entity.name.function.fsgsbase",
"match": "\\b(?i:(?:rd|wr)[fg]sbase)(?!:)\\b",
"comment": "cpuid | grep -i 'fsgs'"
},
{
"name": "entity.name.function.rdrand",
"match": "\\b(?i:rdrand)(?!:)\\b",
"comment": "cpuid | grep -i 'rdrand'"
},
{
"name": "entity.name.function.AVX",
"match": "\\b(?i:vadd(?:sub)?p[ds]|vandn?p[ds]|vblendv?p[ds]|vbroadcastf128|vbroadcasts[ds]|vroundp[ds]|vcmp[ps][ds]|vcvtdq2p[ds]|vcvtpd2(?:dq|ps)[xy]?|vcvtps2(?:dq|pd)|vcvttpd2dq[xy]?|vcvttps2dq|vdivp[ds]|vdpps|vextractf128|vh(?:add|sub)p[ds]|vinsertf128|vlddqu|vmovap[ds]|vmovd(?:q[au])?|vmovup[ds]|vmaskmovp[ds]|v(?:max|min)p[ds]|vmov(?:d|s[hl])?dup|vmovmskp[ds]|vmulp[ds]|vx?orp[ds]|vpermilp[ds]|vperm2f128|vrcpps|vrsqrtps|vpxor|vshufp[ds]|vsqrtp[ds]|vmovntp[ds]|vmovntdq|vsubp[ds]|vtestp[ds]|vptest|vunpck[lh]p[ds]|vzero(?:all|upper)|vpcmp[ei]str[im])(?!:)\\b",
"comment": "Regular AVX:",
"comment": "cpuid | grep -i 'avx:'"
},
{
"name": "entity.name.function.AVX2",
"match": "\\b(?i:vpabs[bdw]|vpadd[bdqw]|vpaddu?s[bw]|vpalignr|vpandn?|vpavg[bw]|vpblend[dw]|vpblendvb|vpbroadcast[bdqw]|movddup|vbroadcasts[ds]|vbroadcasti128|vps[lr]ldq|vpcmp(?:eq|gt)[bdqw]|vpmovsx(?:wd|wq|dq|bw)|v(?:extract|insert)i128|vperm2i128|vph(?:add|sub)(?:d|s?w)|vpmaskmov[dq]|vpmovmskb|vpor|vpsign[bdw]|vp(?:ext|ins)rq|vphminposuw|vaesimc)(?!:)\\b",
"comment": "cpuid | grep -i 'avx2'"
},
{
"name": "entity.name.function.AVX512",
"match": "\\b(?i:vpabs[bdqw]|vpandn?[dq]|vpadd[bdwq]|valignq|vpblendm[bdqw]|vbroadcast[if]32x[248]|vbroadcast[if]64x[24]|vpbroadcastm(?:b2q|w2d)|vpcmpu?[bdqw]|vcomis[ds]|vpcompress[dq]|vcompressp[ds]|vpconflict[dq]|vcvtqq2ps[xy]?|vcvtqq2pd|vcvtudq2p[ds]|vcvtuqq2pd|vcvtuqq2ps[xy]|vcvtsi2sd|vcvtsi2ssl?|vcvtt?p[ds]2u?[dq]q|vcvtt?sd2(?:u?si|s[is])|vcvtss2u?si|vcvtss2s[di]|vcvtusi2s[sd]l?|vpmov[sz]x(?:w[dq]|dq|b[wdq])|vpmovu?s?(?:wb|d[wb]|q[wdb])|vcvtts[ds]2u?si|vdbpsadbw|vdiv[ps][ds]|vexp2p[ds]|vpexpand[dq]|vexpandp[ds]|v(?:extract|insert)[fi]32x[48]|v(?:extract|insert)[if]64x[24]|vfixupimm[ps][ds]|vfpclassp[ds][xyz]?|vfpclasss[ds]|vgetexp[ps][ds]|vgetmant[ps][ds]|vp?(?:gather|scatter)[dq](?:ps|[qd]|pd)|kandn?w|kmovw|knotw|k(?:xn?)?orw|kortestw|kunpck(?:bw|dq|wd)|vmovq|vmovdqa(?:32|64)|vmovs[ds]|vmovdqu(?:8|16|32|64)|vplzcnt[dq]|vpmadd(?:wd|52[hl]uq|ubsw)|vp(?:max|min)[su][bdqw]|vpmov[bdqw]2m|vpmovm2[bdqw]|vpmulu?dq|vmulss|vpmulhu?w|vpmulhrsw|vpmull[dqw]|vpmultishiftqb|vpor[dq]|vpack[us]s(?:wb|dw)|vperm[bdqw]|vpermp[ds]|vperm[it]2[bdqw]|vperm[it]2p[ds]|v(?:gather|scatter)pf[01][dq]p[ds]|v(?:range|reduce)[ps][ds]|vrcp(?:14|28)[ps][ds]|vpro[lr]v?[dq]|vrndscale[ps][ds]|vrsqrt(?:14|28)[ps][ds]|vpsadbw|vscalef[ps][ds]|vpxor[dq]|vpshuf[bd]|vshuf[if]32x4|vshuf[if]64x2|vpshuf[hl]w|vpsllv?[wdq]|vsqrts[ds]|vpsr[al]v?[dqw]|vpsub[bdqw]|vsubs[ds]|vpsubu?s[bw]|vpternlog[dq]|vptestn?m[bdqw]|vpunpck[hl](?:wd|q?dq|bw)|vpxord|vucomis[ds]|vcvtpd2udq[xy]|vpclmul[lh]q[lh]qdq)(?!:)\\b",
"comment": "May be redundat, but oh well.",
"comment": "cpuid | grep -i 'avx512'"
},
{
"name": "entity.name.function.AVX512BW",
"match": "\\b(?i:k(?:andn?|or|xn?or|not|ortest|test|shift[rl]w?|mov[qd]|add)[dq]|cmp(?:eq|le|lt|neq|nle[p]s|nlt|ord|unord)[ps]s)(?!:)\\b",
"comment": "I won't care much for this section."
},
{
"name": "entity.name.function.AVX512DQ",
"match": "\\b(?i:k(?:andn?b|orb|xn?orb|notb|ortestb|test[bw]|shift[rl]b|movb|add[bw])[bw])(?!:)\\b"
},
{
"name": "entity.name.function.F16c",
"match": "\\b(?i:vcvt(?:ph2ps|ps2ph))(?!:)\\b",
"comment": "cpuid | grep -i 'f16c'"
},
{
"name": "entity.name.function.FMA",
"match": "\\b(?i:vfn?m(?:(?:add(?:sub)?|sub(?:add)?)(?:(?:132|213|231)?[ps][ds])))(?!:)\\b",
"comment": "cpuid | grep -i 'fma'"
},
{
"name": "entity.name.function.KNC",
"match": "\\b(?i:vpandn?[dq]|vpad[cd]d|vaddn?p[ds]|vpaddset[cs]d|vaddsetsps|valignd|vpblendm[dq]|vblendmp[ds]|clevict[01]|vpcmpu?d)(?!:)\\b",
"comment": "cpuid | grep -i 'avx512'"
},
{
"name": "entity.name.function.RTM",
"match": "\\b(?i:x(?:abort|begin|end|test))(?!:)\\b",
"comment": "cpuid | grep -i 'rtm'"
},
{
"name": "entity.name.function.HLE",
"match": "\\b(?i:x(?:acquire|release|test))(?!:)\\b",
"comment": "cpuid | grep -i 'HLE'"
},
{
"name": "entity.name.function.xsave",
"match": "\\b(?i:xsaveopt(?:64)?)(?!:)\\b",
"comment":"cpuid | grep -i 'xsaveopt'"
},
{
"name": "entity.name.function.crc32",
"match": "\\b(?i:crc32[bwlq])(?!:)\\b",
"comment":"Passed in thru compiler opts, I think."
},
{
"name": "entity.name.function.miscellaneous",
"match": "\\b(?i:xstorerng|vmxoff|getsec|vpclmulqdq|movbe|invept|invvpid|vmload|blcfill|v(?:ld|st)mxcsr)(?!:)\\b",
"comment": "I don't know where these are supposed to go."
},
{
"comment": "END feature stuff"
},
{
"name": "comment.define",
"match": "^\\s*##.*$",
"comment": "This is a workaround."
},
{
"name": "variable.parameter.other_keywords",
"match": "(?:#(?:alloc|write|execinstr|exclude|tls)|@(?:(?:prog|no)bits|note|(?:(?:pre)?init|fini)_array)|[#@%](?:(?:gnu_indirect_)?function|(?:tls_)?object|common|notype|gnu_unique_object)|comdat|\\.gnu\\.linkonce|discard|one_only|same_(?:size|contents)|STT_(?:(?:GNU_I)?FUNC|OBJECT|TLS|COMMON|NOTYPE))\\b",
"comment": "Non-instructions. Often params to pseudo-ops."
},
{
"name": "support.constant.preprocessor",
"match": "^\\s*(?<!#)(?:#(?:#(?!#)|(?:un)?assert|define|elif|else|endif|error|ident|(?:ifn?|un)?def|if|import|include(?:_next)?|line|pragma|sccs|warning))\\b",
"comment": "Normal directives"
},
{
"name": "support.constant.preprocessor",
"match": "\\b__(?:FILE|LINE|DATE|TIME(?:STAMP)?|STDC_(?:VERSION|HOSTED)?|GNUC(?:_MINOR|_PATCHLEVEL)?|VERSION|STRICT_ANSI|BASE_FILE|INCLUDE_LEVEL|OPTIMIZE(?:_SIZE)?|NO_INLINE|CHAR_UNSIGNED|CHAR_BIT|INT_SHORT|SCHAR_MAX|SHRT_MAX|INT_MAX|LONG_MAX|LONG_LONG_MAX|REGISTER_PREFIX|USER_LABEL_PREFIX)__\\b",
"comment": "Non-hashtag directives."
},
{
"name": "support.constant.preprocessor",
"match": "^\\s*(?:#\\s+(?:(?:un)?assert|define|elif|else|endif|error|ident|(?:ifn?|un)?def|if|import|include(?:_next)?|line|pragma|sccs|warning)\\b)",
"comment": "Used to be an error. Just flag as a preprocessor now."
},
{
"name": "comment.assembly",
"match": "(?:#|//).*$"
},
{
"begin": "\\s*/\\*",
"end": "\\*/",
"name": "comment.multiline"
},
{
"name": "comment.slashes",
"match": "^[ \\t]*/.*$"
},
{
"name": "label.assembly",
"match": "((\\s+|;|^)(([A-Za-z$_.0-9]|C-[BA])+[:]))",
"captures":{
"3": {"name":"keyword.label.assembly"}
},
"comment": "Assembly label/symbols."
},
{
"name": "support.constant.alternatives",
"match": "\\b(?<!\\.if )([A-Za-z$_.0-9]+)\\s*(==?)\\s*",
"captures": {
"0": { "name": "variable.parameter.symbol" },
"1": { "name": "keyword.operator.assignment"}
},
"comment": "Alternative ways of writing the .set and .eqv directives."
},
{
"name": "constant.numeric.float",
"match": "(?<!\\w)(?i)0[DFT][+-]?(?:\\d+(?:\\.\\d*)|\\.\\d+)(?:e[+-]?[0-9]+)?",
"comment": "H8/300, Renesas/SuperH SH, and AMD 29K: use prefix 0[DFPRSX]. ARC: 0[DFRS]. Intel 960: 0[DFT]. HPPA: 0[E] (Captial E only. Others don't matter.)"
},
{
"name": "constant.other.float",
"match": "(?<!\\w)[$](?i)0[DFT][+-]?(?:\\d+(?:\\.\\d*)|\\.\\d+)(?:e[+-]?[0-9]+)?",
"comment": "See above for details."
},
{
"name": "constant.numeric.hex",
"match": "(?<!\\w)[-+~]?(?i)(?:0x)[A-F0-9]+\\b"
},
{
"name": "constant.other.hex",
"match": "(?<!\\w)[$][-+~]?(?i)(?:0x)[A-F0-9]+\\b"
},
{
"name": "constant.numeric.binary",
"match": "(?<!\\w)[-+~]?(?:0[Bb])[01]+\\b"
},
{
"name": "constant.other.binary",
"match": "(?<!\\w)[$][-+~]?(?:0[Bb])[01]+\\b"
},
{
"name": "constant.numeric.octal",
"match": "(?<!\\w)[-+~]?0[0-7]*\\b"
},
{
"name": "constant.other.octal",
"match": "(?<!\\w)[$][-+~]?0[0-7]*\\b"
},
{
"name": "constant.numeric.decimal",
"match": "(?<!\\w)[-+~]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?[0-9]+)?(?=[-\\s,;<>/+~$%(?:)]|$)",
"comment": "By the way, the ~ is a bitwise not. I decided to put the two prefix operators together."
},
{
"name": "constant.other.decimal",
"match": "(?<!\\w)[$][-+~]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?[0-9]+)?(?=[-\\s,;<>/+~$%(?:){}]|$)"
},
{
"name": "constant.character",
"match": "(?<!\\w)[$]?(?i)'(?:[!-\\[\\]-~]|\\\\(?:[\\\\bfnrt]|x[0-9a-f]{1,2}|[0-9]{3}))(?!')"
},
{
"name": "string.quoted",
// "match": "(?:\".*?(?<![^!][!]|[^\\\\][\\\\])\"|<.*?(?<![^!]!)>|'.*?(?<![^!]!)')",
// Uncomment this one if you don't make frequent use of altmacro:
"match": "(?:\".*?(?:[^\\\\](?:[\\\\][\\\\])*)\"|<.*?(?:[^\\\\](?:[\\\\][\\\\])*)>)",
"comment": "Note that delimiting strings by any other means besides the double quotes are forbidden unless .altmacro is present or --alternate flag is given to as. ! means next char is a literal, useful for delimiters."
},
{
"name": "variable.parameter.registers",
"match": "%\\s*(?i:[er]?[a-d]x|[a-d][lh]|[re]?s[ip]|s[ip]l|[re]?di|dil|[re]?bp|bpl|[c-gs]s|[re]?ip|e?flags|db(?:[0236-9]|1[0-5]?)|tr[0267]?|st(?!\\(?:(?:[89]|\\d{2,})\\))|esp[0-2]|[xy]?mm(?:[02-9]|1[0-5]?)|zmm(?:[4-9]|[12][0-9]?|3[10]?)|xmcrt|[gli]dtr|[cd]r(?:[02-9]|1[0-5]?)|msr|r(?:[89]|1[0-5])[dwb]?|[cst]w|fp_(?:[id]p|[cd]s|opc)|mxcsr|msw)\\b",
"comment": "Registers case insensitive. Not sure about some of these (?:Like the last few). I found some on Wikipedia."
},
{
"name": "variable.parameter.opmaskregs",
"match": "%\\s*(?:k[0-7])\\b"
},
{
"name": "invalid.weirdland.eiz",
"match": "%\\s*[er]iz\\b"
// See Stack Overflow about this one. It's interesting.
},
{
"name": "invalid.instructions",
"match": "\\b(?i:movz(?:lq)?)\\b"
},
{
"name": "invalid.directives",
"match": "(?<!\\w)\\.(?i:abort|line|ln|loc_mark_blocks|intel_syntax(?:\\s*(?:no)?prefix)?|att_syntax\\s*noprefix)\\b",
"comment" : "You probably won't be using these anyway... but still. Good to have reminders, I guess?"
},
{
"name": "support.constant.subsections",
"match": "(?<!\\w)(?i:\\.(?:allow_index_reg|app-file|asci[iz]|b?align|bundle_(?:align_mode|(?:un)?lock)|bss|[248]?byte|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)|code(?:16(?:gcc)?|32|64)|data|dc(?:\\.[abdlswx])?|dcb(?:\\.[bdlswx])?|ds(?:\\.[bdlpswx])?|def|desc|dim|double|eject|else(?:if)?|end(?:[ei]f|func|[mr])?|exitm|equ(?:iv)?|eqv|err(?:or)?|extern|fail|file|fill|t?float|func|globa?l|gnu_attribute|hidden|hword|ident|if(?:def|eqs?|[gl][et]|n?[bc]|n(?:ot)?def|nes?)?|incbin|include|int(?:ernal)?|irpc?|l?comm|lflags|linkonce|loc(?:_mark_labels|al)?|mri|(?:no)?list|long|macro|(?:no)?altmacro|nops|octa|offset|operand_check|org|p2align[wl]?|(?:pop|push)?section|previous|print|protected|p?size|purgem|quad|reloc|rept|sbttl|scl|set|secrel32|short|single|skip|sleb128|space|sse_check|stab[dns]|string(?:8|16|32|64)?|struct|subsection|symver|tag|text|title|type|uleb128|val(?:ue)?|version|vtable_(?:entry|inherit)|warning|weak(?:ref)?|word|zero|att_syntax(?:\\s*prefix)?)\\b)|(?:LOCAL\\b)",
"comment": "Pseudo-ops, directives, or subsection markers.",
"comment": "Note: undocumented pseudo ops:",
"comment": ".value val: val is 2 byte value",
"comment": ".tfloat: 80-bit floating point format.",
"comment": ".secrel32: LLVM related stuff?",
"comment": ".sse_check"
},
{
"name": "support.constant.arch_specification",
"match": "(?<!\\w)\\.(?i:(arch) (i8086|i[1-6]86|pentium(pro|iii?|4)?|prescott|nocona|core(2|i7)?|[lk]1om|k6(_2)?|athlon|k8|amdfam10|bdver[1-3]|btver[12]|generic(32|64)|.(8087|[32]87|mmx|sse([235]|4(\\.[12]|a)?)?|ssse3|avx[2]?|[vs]mx|ept|clflush|movbe|xsave(opt)?|aes|pclmul|fma|fsgsbase|rdrnd|f16c|bmi2|lzcnt|invpcid|vmfunc|hle|rtm|adx|rdseed|prfchw|smap|mpx|sha|3dnowa?|syscall|rdtscp|svme|abm|lwp|fma4|xop|cx16|padlock|avx512(p?f|cd|er)?)))(,\\s*(no)?jumps)?",
"captures": {
"2": { "name": "keyword.arch" }
}
}
],
"uuid": "245288b9-8026-4e7f-8b27-d4ff081a25bf",
"fileTypes": [
"s",
"S",
"sx"
],
"name": "GAS/AT&T x86/x64",
"scopeName": "source.x86"
}