masm.vim 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. " Vim syntax file
  2. " Language: Microsoft Macro Assembler (80x86)
  3. " Orig Author: Rob Brady <robb@datatone.com>
  4. " Maintainer: Wu Yongwei <wuyongwei@gmail.com>
  5. " Last Change: 2020-05-09 22:55:38 +0800
  6. " Quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. let s:cpo_save = &cpo
  11. set cpo&vim
  12. syn iskeyword @,48-57,_,36,60,62,63,@-@
  13. syn case ignore
  14. syn match masmIdentifier "[@a-z_$?][@a-z0-9_$?<>]*"
  15. syn match masmLabel "^\s*[@a-z_$?][@a-z0-9_$?]*:"he=e-1
  16. syn match masmDecimal "[-+]\?\d\+[dt]\?"
  17. syn match masmBinary "[-+]\?[0-1]\+[by]" "put this before hex or 0bfh dies!
  18. syn match masmOctal "[-+]\?[0-7]\+[oq]"
  19. syn match masmHexadecimal "[-+]\?[0-9]\x*h"
  20. syn match masmFloatRaw "[-+]\?[0-9]\x*r"
  21. syn match masmFloat "[-+]\?\d\+\.\(\d*\(E[-+]\?\d\+\)\?\)\?"
  22. syn match masmComment ";.*" contains=@Spell
  23. syn region masmComment start=+COMMENT\s*\z(\S\)+ end=+\z1.*+ contains=@Spell
  24. syn region masmString start=+'+ end=+'+ oneline contains=@Spell
  25. syn region masmString start=+"+ end=+"+ oneline contains=@Spell
  26. syn region masmTitleArea start=+\<TITLE\s+lc=5 start=+\<SUBTITLE\s+lc=8 start=+\<SUBTTL\s+lc=6 end=+$+ end=+;+me=e-1 contains=masmTitle
  27. syn region masmTextArea start=+\<NAME\s+lc=4 start=+\<INCLUDE\s+lc=7 start=+\<INCLUDELIB\s+lc=10 end=+$+ end=+;+me=e-1 contains=masmText
  28. syn match masmTitle "[^\t ;]\([^;]*[^\t ;]\)\?" contained contains=@Spell
  29. syn match masmText "[^\t ;]\([^;]*[^\t ;]\)\?" contained
  30. syn region masmOptionOpt start=+\<OPTION\s+lc=6 end=+$+ end=+;+me=e-1 contains=masmOption
  31. syn region masmContextOpt start=+\<PUSHCONTEXT\s+lc=11 start=+\<POPCONTEXT\s+lc=10 end=+$+ end=+;+me=e-1 contains=masmOption
  32. syn region masmModelOpt start=+\.MODEL\s+lc=6 end=+$+ end=+;+me=e-1 contains=masmOption,masmType
  33. syn region masmSegmentOpt start=+\<SEGMENT\s+lc=7 end=+$+ end=+;+me=e-1 contains=masmOption,masmString
  34. syn region masmProcOpt start=+\<PROC\s+lc=4 end=+$+ end=+;+me=e-1 contains=masmOption,masmType,masmRegister,masmIdentifier
  35. syn region masmAssumeOpt start=+\<ASSUME\s+lc=6 end=+$+ end=+;+me=e-1 contains=masmOption,masmOperator,masmType,masmRegister,masmIdentifier
  36. syn region masmExpression start=+\.IF\s+lc=3 start=+\.WHILE\s+lc=6 start=+\.UNTIL\s+lc=6 start=+\<IF\s+lc=2 start=+\<IF2\s+lc=3 start=+\<ELSEIF\s+lc=6 start=+\<ELSEIF2\s+lc=7 start=+\<REPEAT\s+lc=6 start=+\<WHILE\s+lc=5 end=+$+ end=+;+me=e-1 contains=masmType,masmOperator,masmRegister,masmIdentifier,masmDecimal,masmBinary,masmHexadecimal,masmFloatRaw,masmString
  37. syn keyword masmOption TINY SMALL COMPACT MEDIUM LARGE HUGE contained
  38. syn keyword masmOption NEARSTACK FARSTACK contained
  39. syn keyword masmOption PUBLIC PRIVATE STACK COMMON MEMORY AT contained
  40. syn keyword masmOption BYTE WORD DWORD PARA PAGE contained
  41. syn keyword masmOption USE16 USE32 FLAT contained
  42. syn keyword masmOption INFO READ WRITE EXECUTE SHARED contained
  43. syn keyword masmOption NOPAGE NOCACHE DISCARD contained
  44. syn keyword masmOption READONLY USES FRAME contained
  45. syn keyword masmOption CASEMAP DOTNAME NODOTNAME EMULATOR contained
  46. syn keyword masmOption NOEMULATOR EPILOGUE EXPR16 EXPR32 contained
  47. syn keyword masmOption LANGUAGE LJMP NOLJMP M510 NOM510 contained
  48. syn keyword masmOption NOKEYWORD NOSIGNEXTEND OFFSET contained
  49. syn keyword masmOption OLDMACROS NOOLDMACROS OLDSTRUCTS contained
  50. syn keyword masmOption NOOLDSTRUCTS PROC PROLOGUE READONLY contained
  51. syn keyword masmOption NOREADONLY SCOPED NOSCOPED SEGMENT contained
  52. syn keyword masmOption SETIF2 contained
  53. syn keyword masmOption ABS ALL ASSUMES CPU ERROR EXPORT contained
  54. syn keyword masmOption FORCEFRAME LISTING LOADDS NONE contained
  55. syn keyword masmOption NONUNIQUE NOTHING OS_DOS RADIX REQ contained
  56. syn keyword masmType STDCALL SYSCALL C BASIC FORTRAN PASCAL
  57. syn keyword masmType PTR NEAR FAR NEAR16 FAR16 NEAR32 FAR32
  58. syn keyword masmType REAL4 REAL8 REAL10 BYTE SBYTE TBYTE
  59. syn keyword masmType WORD DWORD QWORD FWORD SWORD SDWORD
  60. syn keyword masmOperator AND NOT OR SHL SHR XOR MOD DUP
  61. syn keyword masmOperator EQ GE GT LE LT NE
  62. syn keyword masmOperator LROFFSET SEG LENGTH LENGTHOF SIZE SIZEOF
  63. syn keyword masmOperator CODEPTR DATAPTR FAR NEAR SHORT THIS TYPE
  64. syn keyword masmOperator HIGH HIGHWORD LOW LOWWORD OPATTR MASK WIDTH
  65. syn match masmOperator "OFFSET\(\sFLAT:\)\?"
  66. syn match masmOperator ".TYPE\>"
  67. syn match masmOperator "CARRY?"
  68. syn match masmOperator "OVERFLOW?"
  69. syn match masmOperator "PARITY?"
  70. syn match masmOperator "SIGN?"
  71. syn match masmOperator "ZERO?"
  72. syn keyword masmDirective ALIAS ASSUME CATSTR COMM DB DD DF DOSSEG DQ DT
  73. syn keyword masmDirective DW ECHO ELSE ELSEIF ELSEIF1 ELSEIF2 ELSEIFB
  74. syn keyword masmDirective ELSEIFDEF ELSEIFDIF ELSEIFDIFI ELSEIFE
  75. syn keyword masmDirective ELSEIFIDN ELSEIFIDNI ELSEIFNB ELSEIFNDEF END
  76. syn keyword masmDirective ENDIF ENDM ENDP ENDS EQU EVEN EXITM EXTERN
  77. syn keyword masmDirective EXTERNDEF EXTRN FOR FORC GOTO GROUP IF IF1 IF2
  78. syn keyword masmDirective IFB IFDEF IFDIF IFDIFI IFE IFIDN IFIDNI IFNB
  79. syn keyword masmDirective IFNDEF INCLUDE INCLUDELIB INSTR INVOKE IRP
  80. syn keyword masmDirective IRPC LABEL LOCAL MACRO NAME OPTION ORG PAGE
  81. syn keyword masmDirective POPCONTEXT PROC PROTO PUBLIC PURGE PUSHCONTEXT
  82. syn keyword masmDirective RECORD REPEAT REPT SEGMENT SIZESTR STRUC
  83. syn keyword masmDirective STRUCT SUBSTR SUBTITLE SUBTTL TEXTEQU TITLE
  84. syn keyword masmDirective TYPEDEF UNION WHILE
  85. syn match masmDirective "\.8086\>"
  86. syn match masmDirective "\.8087\>"
  87. syn match masmDirective "\.NO87\>"
  88. syn match masmDirective "\.186\>"
  89. syn match masmDirective "\.286\>"
  90. syn match masmDirective "\.286C\>"
  91. syn match masmDirective "\.286P\>"
  92. syn match masmDirective "\.287\>"
  93. syn match masmDirective "\.386\>"
  94. syn match masmDirective "\.386C\>"
  95. syn match masmDirective "\.386P\>"
  96. syn match masmDirective "\.387\>"
  97. syn match masmDirective "\.486\>"
  98. syn match masmDirective "\.486P\>"
  99. syn match masmDirective "\.586\>"
  100. syn match masmDirective "\.586P\>"
  101. syn match masmDirective "\.686\>"
  102. syn match masmDirective "\.686P\>"
  103. syn match masmDirective "\.K3D\>"
  104. syn match masmDirective "\.MMX\>"
  105. syn match masmDirective "\.XMM\>"
  106. syn match masmDirective "\.ALPHA\>"
  107. syn match masmDirective "\.DOSSEG\>"
  108. syn match masmDirective "\.SEQ\>"
  109. syn match masmDirective "\.CODE\>"
  110. syn match masmDirective "\.CONST\>"
  111. syn match masmDirective "\.DATA\>"
  112. syn match masmDirective "\.DATA?"
  113. syn match masmDirective "\.EXIT\>"
  114. syn match masmDirective "\.FARDATA\>"
  115. syn match masmDirective "\.FARDATA?"
  116. syn match masmDirective "\.MODEL\>"
  117. syn match masmDirective "\.STACK\>"
  118. syn match masmDirective "\.STARTUP\>"
  119. syn match masmDirective "\.IF\>"
  120. syn match masmDirective "\.ELSE\>"
  121. syn match masmDirective "\.ELSEIF\>"
  122. syn match masmDirective "\.ENDIF\>"
  123. syn match masmDirective "\.REPEAT\>"
  124. syn match masmDirective "\.UNTIL\>"
  125. syn match masmDirective "\.UNTILCXZ\>"
  126. syn match masmDirective "\.WHILE\>"
  127. syn match masmDirective "\.ENDW\>"
  128. syn match masmDirective "\.BREAK\>"
  129. syn match masmDirective "\.CONTINUE\>"
  130. syn match masmDirective "\.ERR\>"
  131. syn match masmDirective "\.ERR1\>"
  132. syn match masmDirective "\.ERR2\>"
  133. syn match masmDirective "\.ERRB\>"
  134. syn match masmDirective "\.ERRDEF\>"
  135. syn match masmDirective "\.ERRDIF\>"
  136. syn match masmDirective "\.ERRDIFI\>"
  137. syn match masmDirective "\.ERRE\>"
  138. syn match masmDirective "\.ERRIDN\>"
  139. syn match masmDirective "\.ERRIDNI\>"
  140. syn match masmDirective "\.ERRNB\>"
  141. syn match masmDirective "\.ERRNDEF\>"
  142. syn match masmDirective "\.ERRNZ\>"
  143. syn match masmDirective "\.LALL\>"
  144. syn match masmDirective "\.SALL\>"
  145. syn match masmDirective "\.XALL\>"
  146. syn match masmDirective "\.LFCOND\>"
  147. syn match masmDirective "\.SFCOND\>"
  148. syn match masmDirective "\.TFCOND\>"
  149. syn match masmDirective "\.CREF\>"
  150. syn match masmDirective "\.NOCREF\>"
  151. syn match masmDirective "\.XCREF\>"
  152. syn match masmDirective "\.LIST\>"
  153. syn match masmDirective "\.NOLIST\>"
  154. syn match masmDirective "\.XLIST\>"
  155. syn match masmDirective "\.LISTALL\>"
  156. syn match masmDirective "\.LISTIF\>"
  157. syn match masmDirective "\.NOLISTIF\>"
  158. syn match masmDirective "\.LISTMACRO\>"
  159. syn match masmDirective "\.NOLISTMACRO\>"
  160. syn match masmDirective "\.LISTMACROALL\>"
  161. syn match masmDirective "\.FPO\>"
  162. syn match masmDirective "\.RADIX\>"
  163. syn match masmDirective "\.SAFESEH\>"
  164. syn match masmDirective "%OUT\>"
  165. syn match masmDirective "ALIGN\>"
  166. syn match masmOption "ALIGN([0-9]\+)"
  167. syn keyword masmRegister AX BX CX DX SI DI BP SP
  168. syn keyword masmRegister CS DS SS ES FS GS
  169. syn keyword masmRegister AH BH CH DH AL BL CL DL
  170. syn keyword masmRegister EAX EBX ECX EDX ESI EDI EBP ESP
  171. syn keyword masmRegister CR0 CR2 CR3 CR4
  172. syn keyword masmRegister DR0 DR1 DR2 DR3 DR6 DR7
  173. syn keyword masmRegister TR3 TR4 TR5 TR6 TR7
  174. syn match masmRegister "ST([0-7])"
  175. " x86-64 registers
  176. syn keyword masmRegister RAX RBX RCX RDX RSI RDI RBP RSP
  177. syn keyword masmRegister R8 R9 R10 R11 R12 R13 R14 R15
  178. syn keyword masmRegister R8D R9D R10D R11D R12D R13D R14D R15D
  179. syn keyword masmRegister R8W R9W R10W R11W R12W R13W R14W R15W
  180. syn keyword masmRegister R8B R9B R10B R11B R12B R13B R14B R15B
  181. " SSE/AVX registers
  182. syn match masmRegister "\(X\|Y\)MM[0-9]\>"
  183. syn match masmRegister "\(X\|Y\)MM1[0-5]\>"
  184. " Instruction prefixes
  185. syn keyword masmOpcode LOCK REP REPE REPNE REPNZ REPZ
  186. " 8086/8088 opcodes
  187. syn keyword masmOpcode AAA AAD AAM AAS ADC ADD AND CALL CBW CLC CLD
  188. syn keyword masmOpcode CLI CMC CMP CMPS CMPSB CMPSW CWD DAA DAS DEC
  189. syn keyword masmOpcode DIV ESC HLT IDIV IMUL IN INC INT INTO IRET
  190. syn keyword masmOpcode JCXZ JMP LAHF LDS LEA LES LODS LODSB LODSW
  191. syn keyword masmOpcode LOOP LOOPE LOOPEW LOOPNE LOOPNEW LOOPNZ
  192. syn keyword masmOpcode LOOPNZW LOOPW LOOPZ LOOPZW MOV MOVS MOVSB
  193. syn keyword masmOpcode MOVSW MUL NEG NOP NOT OR OUT POP POPF PUSH
  194. syn keyword masmOpcode PUSHF RCL RCR RET RETF RETN ROL ROR SAHF SAL
  195. syn keyword masmOpcode SAR SBB SCAS SCASB SCASW SHL SHR STC STD STI
  196. syn keyword masmOpcode STOS STOSB STOSW SUB TEST WAIT XCHG XLAT XLATB
  197. syn keyword masmOpcode XOR
  198. syn match masmOpcode "J\(P[EO]\|\(N\?\([ABGL]E\?\|[CEOPSZ]\)\)\)\>"
  199. " 80186 opcodes
  200. syn keyword masmOpcode BOUND ENTER INS INSB INSW LEAVE OUTS OUTSB
  201. syn keyword masmOpcode OUTSW POPA PUSHA PUSHW
  202. " 80286 opcodes
  203. syn keyword masmOpcode ARPL LAR LSL SGDT SIDT SLDT SMSW STR VERR VERW
  204. " 80286/80386 privileged opcodes
  205. syn keyword masmOpcode CLTS LGDT LIDT LLDT LMSW LTR
  206. " 80386 opcodes
  207. syn keyword masmOpcode BSF BSR BT BTC BTR BTS CDQ CMPSD CWDE INSD
  208. syn keyword masmOpcode IRETD IRETDF IRETF JECXZ LFS LGS LODSD LOOPD
  209. syn keyword masmOpcode LOOPED LOOPNED LOOPNZD LOOPZD LSS MOVSD MOVSX
  210. syn keyword masmOpcode MOVZX OUTSD POPAD POPFD PUSHAD PUSHD PUSHFD
  211. syn keyword masmOpcode SCASD SHLD SHRD STOSD
  212. syn match masmOpcode "SET\(P[EO]\|\(N\?\([ABGL]E\?\|[CEOPSZ]\)\)\)\>"
  213. " 80486 opcodes
  214. syn keyword masmOpcode BSWAP CMPXCHG INVD INVLPG WBINVD XADD
  215. " Floating-point opcodes as of 487
  216. syn keyword masmOpFloat F2XM1 FABS FADD FADDP FBLD FBSTP FCHS FCLEX
  217. syn keyword masmOpFloat FNCLEX FCOM FCOMP FCOMPP FCOS FDECSTP FDISI
  218. syn keyword masmOpFloat FNDISI FDIV FDIVP FDIVR FDIVRP FENI FNENI
  219. syn keyword masmOpFloat FFREE FIADD FICOM FICOMP FIDIV FIDIVR FILD
  220. syn keyword masmOpFloat FIMUL FINCSTP FINIT FNINIT FIST FISTP FISUB
  221. syn keyword masmOpFloat FISUBR FLD FLDCW FLDENV FLDLG2 FLDLN2 FLDL2E
  222. syn keyword masmOpFloat FLDL2T FLDPI FLDZ FLD1 FMUL FMULP FNOP FPATAN
  223. syn keyword masmOpFloat FPREM FPREM1 FPTAN FRNDINT FRSTOR FSAVE FNSAVE
  224. syn keyword masmOpFloat FSCALE FSETPM FSIN FSINCOS FSQRT FST FSTCW
  225. syn keyword masmOpFloat FNSTCW FSTENV FNSTENV FSTP FSTSW FNSTSW FSUB
  226. syn keyword masmOpFloat FSUBP FSUBR FSUBRP FTST FUCOM FUCOMP FUCOMPP
  227. syn keyword masmOpFloat FWAIT FXAM FXCH FXTRACT FYL2X FYL2XP1
  228. " Floating-point opcodes in Pentium and later processors
  229. syn keyword masmOpFloat FCMOVE FCMOVNE FCMOVB FCMOVBE FCMOVNB FCMOVNBE
  230. syn keyword masmOpFloat FCMOVU FCMOVNU FCOMI FUCOMI FCOMIP FUCOMIP
  231. syn keyword masmOpFloat FXSAVE FXRSTOR
  232. " MMX opcodes (Pentium w/ MMX, Pentium II, and later)
  233. syn keyword masmOpcode MOVD MOVQ PACKSSWB PACKSSDW PACKUSWB
  234. syn keyword masmOpcode PUNPCKHBW PUNPCKHWD PUNPCKHDQ
  235. syn keyword masmOpcode PUNPCKLBW PUNPCKLWD PUNPCKLDQ
  236. syn keyword masmOpcode PADDB PADDW PADDD PADDSB PADDSW PADDUSB PADDUSW
  237. syn keyword masmOpcode PSUBB PSUBW PSUBD PSUBSB PSUBSW PSUBUSB PSUBUSW
  238. syn keyword masmOpcode PMULHW PMULLW PMADDWD
  239. syn keyword masmOpcode PCMPEQB PCMPEQW PCMPEQD PCMPGTB PCMPGTW PCMPGTD
  240. syn keyword masmOpcode PAND PANDN POR PXOR
  241. syn keyword masmOpcode PSLLW PSLLD PSLLQ PSRLW PSRLD PSRLQ PSRAW PSRAD
  242. syn keyword masmOpcode EMMS
  243. " SSE opcodes (Pentium III and later)
  244. syn keyword masmOpcode MOVAPS MOVUPS MOVHPS MOVHLPS MOVLPS MOVLHPS
  245. syn keyword masmOpcode MOVMSKPS MOVSS
  246. syn keyword masmOpcode ADDPS ADDSS SUBPS SUBSS MULPS MULSS DIVPS DIVSS
  247. syn keyword masmOpcode RCPPS RCPSS SQRTPS SQRTSS RSQRTPS RSQRTSS
  248. syn keyword masmOpcode MAXPS MAXSS MINPS MINSS
  249. syn keyword masmOpcode CMPPS CMPSS COMISS UCOMISS
  250. syn keyword masmOpcode ANDPS ANDNPS ORPS XORPS
  251. syn keyword masmOpcode SHUFPS UNPCKHPS UNPCKLPS
  252. syn keyword masmOpcode CVTPI2PS CVTSI2SS CVTPS2PI CVTTPS2PI
  253. syn keyword masmOpcode CVTSS2SI CVTTSS2SI
  254. syn keyword masmOpcode LDMXCSR STMXCSR
  255. syn keyword masmOpcode PAVGB PAVGW PEXTRW PINSRW PMAXUB PMAXSW
  256. syn keyword masmOpcode PMINUB PMINSW PMOVMSKB PMULHUW PSADBW PSHUFW
  257. syn keyword masmOpcode MASKMOVQ MOVNTQ MOVNTPS SFENCE
  258. syn keyword masmOpcode PREFETCHT0 PREFETCHT1 PREFETCHT2 PREFETCHNTA
  259. " SSE2 opcodes (Pentium 4 and later)
  260. syn keyword masmOpcode MOVAPD MOVUPD MOVHPD MOVLPD MOVMSKPD MOVSD
  261. syn keyword masmOpcode ADDPD ADDSD SUBPD SUBSD MULPD MULSD DIVPD DIVSD
  262. syn keyword masmOpcode SQRTPD SQRTSD MAXPD MAXSD MINPD MINSD
  263. syn keyword masmOpcode ANDPD ANDNPD ORPD XORPD
  264. syn keyword masmOpcode CMPPD CMPSD COMISD UCOMISD
  265. syn keyword masmOpcode SHUFPD UNPCKHPD UNPCKLPD
  266. syn keyword masmOpcode CVTPD2PI CVTTPD2PI CVTPI2PD CVTPD2DQ
  267. syn keyword masmOpcode CVTTPD2DQ CVTDQ2PD CVTPS2PD CVTPD2PS
  268. syn keyword masmOpcode CVTSS2SD CVTSD2SS CVTSD2SI CVTTSD2SI CVTSI2SD
  269. syn keyword masmOpcode CVTDQ2PS CVTPS2DQ CVTTPS2DQ
  270. syn keyword masmOpcode MOVDQA MOVDQU MOVQ2DQ MOVDQ2Q PMULUDQ
  271. syn keyword masmOpcode PADDQ PSUBQ PSHUFLW PSHUFHW PSHUFD
  272. syn keyword masmOpcode PSLLDQ PSRLDQ PUNPCKHQDQ PUNPCKLQDQ
  273. syn keyword masmOpcode CLFLUSH LFENCE MFENCE PAUSE MASKMOVDQU
  274. syn keyword masmOpcode MOVNTPD MOVNTDQ MOVNTI
  275. " SSE3 opcodes (Pentium 4 w/ Hyper-Threading and later)
  276. syn keyword masmOpcode FISTTP LDDQU ADDSUBPS ADDSUBPD
  277. syn keyword masmOpcode HADDPS HSUBPS HADDPD HSUBPD
  278. syn keyword masmOpcode MOVSHDUP MOVSLDUP MOVDDUP MONITOR MWAIT
  279. " SSSE3 opcodes (Core and later)
  280. syn keyword masmOpcode PSIGNB PSIGNW PSIGND PABSB PABSW PABSD
  281. syn keyword masmOpcode PALIGNR PSHUFB PMULHRSW PMADDUBSW
  282. syn keyword masmOpcode PHSUBW PHSUBD PHSUBSW PHADDW PHADDD PHADDSW
  283. " SSE 4.1 opcodes (Penryn and later)
  284. syn keyword masmOpcode MPSADBW PHMINPOSUW PMULDQ PMULLD DPPS DPPD
  285. syn keyword masmOpcode BLENDPS BLENDPD BLENDVPS BLENDVPD
  286. syn keyword masmOpcode PBLENDVB PBLENDW
  287. syn keyword masmOpcode PMINSB PMAXSB PMINSD PMAXSD
  288. syn keyword masmOpcode PMINUW PMAXUW PMINUD PMAXUD
  289. syn keyword masmOpcode ROUNDPS ROUNDSS ROUNDPD ROUNDSD
  290. syn keyword masmOpcode INSERTPS PINSRB PINSRD PINSRQ
  291. syn keyword masmOpcode EXTRACTPS PEXTRB PEXTRD PEXTRQ
  292. syn keyword masmOpcode PMOVSXBW PMOVZXBW PMOVSXBD PMOVZXBD
  293. syn keyword masmOpcode PMOVSXBQ PMOVZXBQ PMOVSXWD PMOVZXWD
  294. syn keyword masmOpcode PMOVSXWQ PMOVZXWQ PMOVSXDQ PMOVZXDQ
  295. syn keyword masmOpcode PTEST PCMPEQQ PACKUSDW MOVNTDQA
  296. " SSE 4.2 opcodes (Nehalem and later)
  297. syn keyword masmOpcode PCMPESTRI PCMPESTRM PCMPISTRI PCMPISTRM PCMPGTQ
  298. syn keyword masmOpcode CRC32 POPCNT LZCNT
  299. " AES-NI (Westmere (2010) and later)
  300. syn keyword masmOpcode AESENC AESENCLAST AESDEC AESDECLAST
  301. syn keyword masmOpcode AESKEYGENASSIST AESIMC PCLMULQDQ
  302. " AVX (Sandy Bridge (2011) and later)
  303. syn keyword masmOpcode VBROADCASTSS VBROADCASTSD VBROADCASTF128
  304. syn keyword masmOpcode VINSERTF128 VEXTRACTF128 VMASKMOVPS VMASKMOVPD
  305. syn keyword masmOpcode VPERMILPS VPERMILPD VPERM2F128
  306. syn keyword masmOpcode VZEROALL VZEROUPPER
  307. " Other opcodes in Pentium and later processors
  308. syn keyword masmOpcode CMPXCHG8B CPUID UD2
  309. syn keyword masmOpcode RSM RDMSR WRMSR RDPMC RDTSC SYSENTER SYSEXIT
  310. syn match masmOpcode "CMOV\(P[EO]\|\(N\?\([ABGL]E\?\|[CEOPSZ]\)\)\)\>"
  311. " The default highlighting
  312. hi def link masmLabel PreProc
  313. hi def link masmComment Comment
  314. hi def link masmDirective Statement
  315. hi def link masmType Type
  316. hi def link masmOperator Type
  317. hi def link masmOption Special
  318. hi def link masmRegister Special
  319. hi def link masmString String
  320. hi def link masmText String
  321. hi def link masmTitle Title
  322. hi def link masmOpcode Statement
  323. hi def link masmOpFloat Statement
  324. hi def link masmHexadecimal Number
  325. hi def link masmDecimal Number
  326. hi def link masmOctal Number
  327. hi def link masmBinary Number
  328. hi def link masmFloatRaw Number
  329. hi def link masmFloat Number
  330. hi def link masmIdentifier Identifier
  331. syntax sync minlines=50
  332. let b:current_syntax = "masm"
  333. let &cpo = s:cpo_save
  334. unlet s:cpo_save
  335. " vim: ts=8