annotate runtime/syntax/masm.vim @ 270:a20218704019

updated for version 7.0072
author vimboss
date Wed, 18 May 2005 22:17:12 +0000
parents 3fc0f57ecb91
children e63691e7c504
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Microsoft Assembler (80x86)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Rob Brady <robb@datatone.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Last Change: $Date$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " URL: http://www.datatone.com/~robb/vim/syntax/masm.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " $Revision$
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " syn match masmType "\.word"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match masmIdentifier "[a-z_$][a-z0-9_$]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match masmLabel "^[A-Z_$][A-Z0-9_$]*:"he=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match masmDecimal "\d*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match masmBinary "[0-1]\+b" "put this before hex or 0bfh dies!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match masmHexadecimal "[0-9]\x*h"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match masmFloat "[0-9]\x*r"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match masmComment ";.*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn region masmString start=+'+ end=+'+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword masmOperator AND BYTE PTR CODEPTR DATAPTR DUP DWORD EQ FAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword masmOperator FWORD GE GT HIGH LARGE LE LOW LT MOD NE NEAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword masmOperator NOT OFFSET OR PROC PWORD QWORD SEG SHORT TBYTE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword masmOperator TYPE WORD PARA
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword masmDirective ALIGN ARG ASSUME CODESEG COMM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword masmDirective CONST DATASEG DB DD DF DISPLAY DOSSEG DP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword masmDirective DQ DT DW ELSE ELSEIF EMUL END ENDIF ENDM ENDP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword masmDirective ENDS ENUM EQU PROC PUBLIC PUBLICDLL RADIX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword masmDirective EXTRN FARDATA GLOBAL RECORD SEGMENT SMALLSTACK
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword masmDirective GROUP IF IF1 IF2 IFB IFDEF IFDIF IFDIFI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn keyword masmDirective IFE IFIDN IFIDNI IFNB IFNDEF INCLUDE INCLUDLIB
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword masmDirective LABEL LARGESTACK STACK STRUC SUBTTL TITLE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword masmDirective MODEL NAME NOEMUL UNION USES VERSION
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn keyword masmDirective ORG FLAT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match masmDirective "\.model"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match masmDirective "\.186"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match masmDirective "\.286"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match masmDirective "\.286c"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match masmDirective "\.286p"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match masmDirective "\.287"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match masmDirective "\.386"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match masmDirective "\.386c"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match masmDirective "\.386p"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match masmDirective "\.387"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match masmDirective "\.486"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn match masmDirective "\.486c"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn match masmDirective "\.486p"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn match masmDirective "\.8086"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn match masmDirective "\.8087"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match masmDirective "\.ALPHA"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match masmDirective "\.CODE"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match masmDirective "\.DATA"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn keyword masmRegister AX BX CX DX SI DI BP SP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn keyword masmRegister ES DS SS CS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword masmRegister AH BH CH DH AL BL CL DL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn keyword masmRegister EAX EBX ECX EDX ESI EDI EBP ESP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " these are current as of the 486 - don't have any pentium manuals handy
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword masmOpcode AAA AAD AAM AAS ADC ADD AND ARPL BOUND BSF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn keyword masmOpcode BSR BSWAP BT BTC BTR BTS BSWAP BT BTC BTR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn keyword masmOpcode BTS CALL CBW CDQ CLC CLD CLI CLTS CMC CMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn keyword masmOpcode CMPS CMPSB CMPSW CMPSD CMPXCHG CWD CWDE DAA
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn keyword masmOpcode DAS DEC DIV ENTER HLT IDIV IMUL IN INC INS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn keyword masmOpcode INSB INSW INSD INT INTO INVD INVLPG IRET
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn keyword masmOpcode IRETD JA JAE JB JBE JC JCXZ JECXZ JE JZ JG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn keyword masmOpcode JGE JL JLE JNA JNAE JNB JNBE JNC JNE JNG JNGE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn keyword masmOpcode JNL JNLE JNO JNP JNS JNZ JO JP JPE JPO JS JZ
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn keyword masmOpcode JMP LAHF LAR LEA LEAVE LGDT LIDT LGS LSS LFS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 syn keyword masmOpcode LODS LODSB LODSW LODSD LOOP LOOPE LOOPZ LOONE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn keyword masmOpcode LOOPNE RETF RETN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn keyword masmOpcode LDS LES LLDT LMSW LOCK LSL LTR MOV MOVS MOVSB
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn keyword masmOpcode MOVSW MOVSD MOVSX MOVZX MUL NEG NOP NOT OR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn keyword masmOpcode OUT OUTS OUTSB OUTSW OUTSD POP POPA POPD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn keyword masmOpcode POPF POPFD PUSH PUSHA PUSHAD PUSHF PUSHFD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn keyword masmOpcode RCL RCR ROL ROR REP REPE REPZ REPNE REPNZ
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn keyword masmOpcode RET SAHF SAL SAR SHL SHR SBB SCAS SCASB
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn keyword masmOpcode SCASW SCASD SETA SETAE SETB SETBE SETC SETE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn keyword masmOpcode SETG SETGE SETL SETLE SETNA SETNAE SETNB
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn keyword masmOpcode SETNBE SETNC SETNE SETNG SETNGE SETNL SETNLE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn keyword masmOpcode SETNO SETNP SETNS SETNZ SETO SETP SETPE SETPO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn keyword masmOpcode SETS SETZ SGDT SIDT SHLD SHRD SLDT SMSW STC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn keyword masmOpcode STD STI STOS STOSB STOSW STOSD STR SUB TEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn keyword masmOpcode VERR VERW WAIT WBINVD XADD XCHG XLAT XLATB XOR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 " floating point coprocessor as of 487
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 syn keyword masmOpFloat F2XM1 FABS FADD FADDP FBLD FBSTP FCHS FCLEX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 syn keyword masmOpFloat FNCLEX FCOM FCOMP FCOMPP FCOS FDECSTP FDISI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn keyword masmOpFloat FNDISI FDIV FDIVP FDIVR FDIVRP FENI FNENI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 syn keyword masmOpFloat FFREE FIADD FICOM FICOMP FIDIV FIDIVR FILD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 syn keyword masmOpFloat FIMUL FINCSTP FINIT FNINIT FIST FISTP FISUB
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn keyword masmOpFloat FISUBR FLD FLDCW FLDENV FLDLG2 FLDLN2 FLDL2E
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn keyword masmOpFloat FLDL2T FLDPI FLDZ FLD1 FMUL FMULP FNOP FPATAN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn keyword masmOpFloat FPREM FPREM1 FPTAN FRNDINT FRSTOR FSAVE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn keyword masmOpFloat FNSAVE FSCALE FSETPM FSIN FSINCOS FSQRT FST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 syn keyword masmOpFloat FSTCW FNSTCW FSTENV FNSTENV FSTP FSTSW FNSTSW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn keyword masmOpFloat FSUB FSUBP FSUBR FSUBRP FTST FUCOM FUCOMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 syn keyword masmOpFloat FUCOMPP FWAIT FXAM FXCH FXTRACT FYL2X FYL2XP1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 syn match masmOpFloat "FSTSW[ \t]\+AX"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 syn match masmOpFloat "FNSTSW[ \t]\+AX"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 if version >= 508 || !exists("did_masm_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 let did_masm_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 " The default methods for highlighting. Can be overridden later
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 HiLink masmLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 HiLink masmComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 HiLink masmDirective Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 HiLink masmOperator Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 HiLink masmString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 HiLink masmHexadecimal Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 HiLink masmDecimal Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 HiLink masmBinary Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 HiLink masmFloat Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 HiLink masmIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 let b:current_syntax = "masm"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 " vim: ts=8