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