|
2 | 2 | " Language: Microsoft Macro Assembler (80x86) |
3 | 3 | " Orig Author: Rob Brady <[email protected]> |
4 | 4 | " Maintainer: Wu Yongwei <[email protected]> |
5 | | -" Last Change: $Date: 2012/02/04 12:45:39 $ |
6 | | -" $Revision: 1.46 $ |
7 | | - |
8 | | -" For version 5.x: Clear all syntax items |
9 | | -" For version 6.x: Quit when a syntax file was already loaded |
10 | | -if version < 600 |
11 | | - syntax clear |
12 | | -elseif exists("b:current_syntax") |
| 5 | +" Last Change: $Date: 2013/11/13 11:49:24 $ |
| 6 | +" $Revision: 1.48 $ |
| 7 | + |
| 8 | +" Quit when a syntax file was already loaded |
| 9 | +if exists("b:current_syntax") |
13 | 10 | finish |
14 | 11 | endif |
15 | 12 |
|
@@ -194,6 +191,10 @@ syn keyword masmRegister R8D R9D R10D R11D R12D R13D R14D R15D |
194 | 191 | syn keyword masmRegister R8W R9W R10W R11W R12W R13W R14W R15W |
195 | 192 | syn keyword masmRegister R8B R9B R10B R11B R12B R13B R14B R15B |
196 | 193 |
|
| 194 | +" SSE/AVX registers |
| 195 | +syn match masmRegister "\(X\|Y\)MM[0-9]\>" |
| 196 | +syn match masmRegister "\(X\|Y\)MM1[0-5]\>" |
| 197 | + |
197 | 198 | " Instruction prefixes |
198 | 199 | syn keyword masmOpcode LOCK REP REPE REPNE REPNZ REPZ |
199 | 200 |
|
@@ -302,50 +303,69 @@ syn keyword masmOpcode FISTTP LDDQU ADDSUBPS ADDSUBPD |
302 | 303 | syn keyword masmOpcode HADDPS HSUBPS HADDPD HSUBPD |
303 | 304 | syn keyword masmOpcode MOVSHDUP MOVSLDUP MOVDDUP MONITOR MWAIT |
304 | 305 |
|
| 306 | +" SSSE3 opcodes (Core and later) |
| 307 | +syn keyword masmOpcode PSIGNB PSIGNW PSIGND PABSB PABSW PABSD |
| 308 | +syn keyword masmOpcode PALIGNR PSHUFB PMULHRSW PMADDUBSW |
| 309 | +syn keyword masmOpcode PHSUBW PHSUBD PHSUBSW PHADDW PHADDD PHADDSW |
| 310 | + |
| 311 | +" SSE 4.1 opcodes (Penryn and later) |
| 312 | +syn keyword masmOpcode MPSADBW PHMINPOSUW PMULDQ PMULLD DPPS DPPD |
| 313 | +syn keyword masmOpcode BLENDPS BLENDPD BLENDVPS BLENDVPD |
| 314 | +syn keyword masmOpcode PBLENDVB PBLENDW |
| 315 | +syn keyword masmOpcode PMINSB PMAXSB PMINSD PMAXSD |
| 316 | +syn keyword masmOpcode PMINUW PMAXUW PMINUD PMAXUD |
| 317 | +syn keyword masmOpcode ROUNDPS ROUNDSS ROUNDPD ROUNDSD |
| 318 | +syn keyword masmOpcode INSERTPS PINSRB PINSRD PINSRQ |
| 319 | +syn keyword masmOpcode EXTRACTPS PEXTRB PEXTRD PEXTRQ |
| 320 | +syn keyword masmOpcode PMOVSXBW PMOVZXBW PMOVSXBD PMOVZXBD |
| 321 | +syn keyword masmOpcode PMOVSXBQ PMOVZXBQ PMOVSXWD PMOVZXWD |
| 322 | +syn keyword masmOpcode PMOVSXWQ PMOVZXWQ PMOVSXDQ PMOVZXDQ |
| 323 | +syn keyword masmOpcode PTEST PCMPEQQ PACKUSDW MOVNTDQA |
| 324 | + |
| 325 | +" SSE 4.2 opcodes (Nehalem and later) |
| 326 | +syn keyword masmOpcode PCMPESTRI PCMPESTRM PCMPISTRI PCMPISTRM PCMPGTQ |
| 327 | +syn keyword masmOpcode CRC32 POPCNT LZCNT |
| 328 | + |
| 329 | +" AES-NI (Westmere (2010) and later) |
| 330 | +syn keyword masmOpcode AESENC AESENCLAST AESDEC AESDECLAST |
| 331 | +syn keyword masmOpcode AESKEYGENASSIST AESIMC PCLMULQDQ |
| 332 | + |
| 333 | +" AVX (Sandy Bridge (2011) and later) |
| 334 | +syn keyword masmOpcode VBROADCASTSS VBROADCASTSD VBROADCASTF128 |
| 335 | +syn keyword masmOpcode VINSERTF128 VEXTRACTF128 VMASKMOVPS VMASKMOVPD |
| 336 | +syn keyword masmOpcode VPERMILPS VPERMILPD VPERM2F128 |
| 337 | +syn keyword masmOpcode VZEROALL VZEROUPPER |
| 338 | + |
305 | 339 | " Other opcodes in Pentium and later processors |
306 | 340 | syn keyword masmOpcode CMPXCHG8B CPUID UD2 |
307 | 341 | syn keyword masmOpcode RSM RDMSR WRMSR RDPMC RDTSC SYSENTER SYSEXIT |
308 | 342 | syn match masmOpcode "CMOV\(P[EO]\|\(N\?\([ABGL]E\?\|[CEOPSZ]\)\)\)\>" |
309 | 343 |
|
310 | 344 |
|
311 | | -" Define the default highlighting. |
312 | | -" For version 5.7 and earlier: only when not done already |
313 | | -" For version 5.8 and later: only when an item doesn't have highlighting yet |
314 | | -if version >= 508 || !exists("did_masm_syntax_inits") |
315 | | - if version < 508 |
316 | | - let did_masm_syntax_inits = 1 |
317 | | - command -nargs=+ HiLink hi link <args> |
318 | | - else |
319 | | - command -nargs=+ HiLink hi def link <args> |
320 | | - endif |
321 | | - |
322 | | - " The default methods for highlighting. Can be overridden later |
323 | | - HiLink masmLabel PreProc |
324 | | - HiLink masmComment Comment |
325 | | - HiLink masmDirective Statement |
326 | | - HiLink masmType Type |
327 | | - HiLink masmOperator Type |
328 | | - HiLink masmOption Special |
329 | | - HiLink masmRegister Special |
330 | | - HiLink masmString String |
331 | | - HiLink masmText String |
332 | | - HiLink masmTitle Title |
333 | | - HiLink masmOpcode Statement |
334 | | - HiLink masmOpFloat Statement |
335 | | - |
336 | | - HiLink masmHexadecimal Number |
337 | | - HiLink masmDecimal Number |
338 | | - HiLink masmOctal Number |
339 | | - HiLink masmBinary Number |
340 | | - HiLink masmFloatRaw Number |
341 | | - HiLink masmFloat Number |
342 | | - |
343 | | - HiLink masmIdentifier Identifier |
344 | | - |
345 | | - syntax sync minlines=50 |
346 | | - |
347 | | - delcommand HiLink |
348 | | -endif |
| 345 | +" The default highlighting |
| 346 | +hi def link masmLabel PreProc |
| 347 | +hi def link masmComment Comment |
| 348 | +hi def link masmDirective Statement |
| 349 | +hi def link masmType Type |
| 350 | +hi def link masmOperator Type |
| 351 | +hi def link masmOption Special |
| 352 | +hi def link masmRegister Special |
| 353 | +hi def link masmString String |
| 354 | +hi def link masmText String |
| 355 | +hi def link masmTitle Title |
| 356 | +hi def link masmOpcode Statement |
| 357 | +hi def link masmOpFloat Statement |
| 358 | + |
| 359 | +hi def link masmHexadecimal Number |
| 360 | +hi def link masmDecimal Number |
| 361 | +hi def link masmOctal Number |
| 362 | +hi def link masmBinary Number |
| 363 | +hi def link masmFloatRaw Number |
| 364 | +hi def link masmFloat Number |
| 365 | + |
| 366 | +hi def link masmIdentifier Identifier |
| 367 | + |
| 368 | +syntax sync minlines=50 |
349 | 369 |
|
350 | 370 | let b:current_syntax = "masm" |
351 | 371 |
|
|
0 commit comments