7
|
1 " Vim syntax file
|
|
2 " Language: TASM: turbo assembler by Borland
|
|
3 " Maintaner: FooLman of United Force <foolman@bigfoot.com>
|
3312
|
4 " Last Change: 2012 Feb 03 by Thilo Six
|
7
|
5
|
|
6 " For version 5.x: Clear all syntax items
|
|
7 " For version 6.x: Quit when a syntax file was already loaded
|
|
8 if version < 600
|
|
9 syntax clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
3312
|
14 let s:cpo_save = &cpo
|
|
15 set cpo&vim
|
|
16
|
7
|
17 syn case ignore
|
|
18 syn match tasmLabel "^[\ \t]*[@a-z_$][a-z0-9_$@]*\ *:"
|
|
19 syn keyword tasmDirective ALIAS ALIGN ARG ASSUME %BIN CATSRT CODESEG
|
|
20 syn match tasmDirective "\<\(byte\|word\|dword\|qword\)\ ptr\>"
|
|
21 " CALL extended syntax
|
|
22 syn keyword tasmDirective COMM %CONDS CONST %CREF %CREFALL %CREFREF
|
|
23 syn keyword tasmDirective %CREFUREF %CTLS DATASEG DB DD %DEPTH DF DISPLAY
|
|
24 syn keyword tasmDirective DOSSEG DP DQ DT DW ELSE EMUL END ENDIF
|
|
25 " IF XXXX
|
|
26 syn keyword tasmDirective ENDM ENDP ENDS ENUM EQU ERR EVEN EVENDATA EXITCODE
|
|
27 syn keyword tasmDirective EXITM EXTRN FARDATA FASTIMUL FLIPFLAG GETFIELD GLOBAL
|
|
28 syn keyword tasmDirective GOTO GROUP IDEAL %INCL INCLUDE INCLUDELIB INSTR IRP
|
|
29 "JMP
|
|
30 syn keyword tasmDirective IRPC JUMPS LABEL LARGESTACK %LINUM %LIST LOCAL
|
|
31 syn keyword tasmDirective LOCALS MACRO %MACS MASKFLAG MASM MASM51 MODEL
|
|
32 syn keyword tasmDirective MULTERRS NAME %NEWPAGE %NOCONDS %NOCREF %NOCTLS
|
|
33 syn keyword tasmDirective NOEMUL %NOINCL NOJUMPS %NOLIST NOLOCALS %NOMACS
|
|
34 syn keyword tasmDirective NOMASM51 NOMULTERRS NOSMART %NOSYMS %NOTRUNC NOWARN
|
|
35 syn keyword tasmDirective %PAGESIZE %PCNT PNO87 %POPLCTL POPSTATE PROC PROCDESC
|
|
36 syn keyword tasmDirective PROCTYPE PUBLIC PUBLICDLL PURGE %PUSHCTL PUSHSTATE
|
|
37 "rept, ret
|
|
38 syn keyword tasmDirective QUIRKS RADIX RECORD RETCODE SEGMENT SETFIELD
|
|
39 syn keyword tasmDirective SETFLAG SIZESTR SMALLSTACK SMART STACK STARTUPCODE
|
|
40 syn keyword tasmDirective STRUC SUBSTR %SUBTTL %SYMS TABLE %TABSIZE TBLINIT
|
|
41 syn keyword tasmDirective TBLINST TBLPTR TESTFLAG %TEXT %TITLE %TRUNC TYPEDEF
|
|
42 syn keyword tasmDirective UDATASEG UFARDATA UNION USES VERSION WAR WHILE ?DEBUG
|
|
43
|
|
44 syn keyword tasmInstruction AAA AAD AAM AAS ADC ADD AND ARPL BOUND BSF BSR
|
|
45 syn keyword tasmInstruction BSWAP BT BTC BTR BTS CALL CBW CLC CLD CLI CLTS
|
|
46 syn keyword tasmInstruction CMC CMP CMPXCHG CMPXCHG8B CPUID CWD CDQ CWDE
|
|
47 syn keyword tasmInstruction DAA DAS DEC DIV ENTER RETN RETF F2XM1
|
|
48 syn keyword tasmCoprocInstr FABS FADD FADDP FBLD FBSTP FCHG FCOM FCOM2 FCOMI
|
|
49 syn keyword tasmCoprocInstr FCOMIP FCOMP FCOMP3 FCOMP5 FCOMPP FCOS FDECSTP
|
|
50 syn keyword tasmCoprocInstr FDISI FDIV FDIVP FDIVR FENI FFREE FFREEP FIADD
|
|
51 syn keyword tasmCoprocInstr FICOM FICOMP FIDIV FIDIVR FILD FIMUL FINIT FINCSTP
|
|
52 syn keyword tasmCoprocInstr FIST FISTP FISUB FISUBR FLD FLD1 FLDCW FLDENV
|
|
53 syn keyword tasmCoprocInstr FLDL2E FLDL2T FLDLG2 FLDLN2 FLDPI FLDZ FMUL FMULP
|
|
54 syn keyword tasmCoprocInstr FNCLEX FNINIT FNOP FNSAVE FNSTCW FNSTENV FNSTSW
|
|
55 syn keyword tasmCoprocInstr FPATAN FPREM FPREM1 FPTAN FRNDINT FRSTOR FSCALE
|
|
56 syn keyword tasmCoprocInstr FSETPM FSIN FSINCOM FSQRT FST FSTP FSTP1 FSTP8
|
|
57 syn keyword tasmCoprocInstr FSTP9 FSUB FSUBP FSUBR FSUBRP FTST FUCOM FUCOMI
|
|
58 syn keyword tasmCoprocInstr FUCOMPP FWAIT FXAM FXCH FXCH4 FXCH7 FXTRACT FYL2X
|
|
59 syn keyword tasmCoprocInstr FYL2XP1 FSTCW FCHS FSINCOS
|
|
60 syn keyword tasmInstruction IDIV IMUL IN INC INT INTO INVD INVLPG IRET JMP
|
|
61 syn keyword tasmInstruction LAHF LAR LDS LEA LEAVE LES LFS LGDT LGS LIDT LLDT
|
|
62 syn keyword tasmInstruction LMSW LOCK LODSB LSL LSS LTR MOV MOVSX MOVZX MUL
|
|
63 syn keyword tasmInstruction NEG NOP NOT OR OUT POP POPA POPAD POPF POPFD PUSH
|
|
64 syn keyword tasmInstruction PUSHA PUSHAD PUSHF PUSHFD RCL RCR RDMSR RDPMC RDTSC
|
|
65 syn keyword tasmInstruction REP RET ROL ROR RSM SAHF SAR SBB SGDT SHL SAL SHLD
|
|
66 syn keyword tasmInstruction SHR SHRD SIDT SMSW STC STD STI STR SUB TEST VERR
|
|
67 syn keyword tasmInstruction VERW WBINVD WRMSR XADD XCHG XLAT XOR
|
|
68 syn keyword tasmMMXinst EMMS MOVD MOVQ PACKSSDW PACKSSWB PACKUSWB PADDB
|
|
69 syn keyword tasmMMXinst PADDD PADDSB PADDSB PADDSW PADDUSB PADDUSW PADDW
|
|
70 syn keyword tasmMMXinst PAND PANDN PCMPEQB PCMPEQD PCMPEQW PCMPGTB PCMPGTD
|
|
71 syn keyword tasmMMXinst PCMPGTW PMADDWD PMULHW PMULLW POR PSLLD PSLLQ
|
|
72 syn keyword tasmMMXinst PSLLW PSRAD PSRAW PSRLD PSRLQ PSRLW PSUBB PSUBD
|
|
73 syn keyword tasmMMXinst PSUBSB PSUBSW PSUBUSB PSUBUSW PSUBW PUNPCKHBW
|
|
74 syn keyword tasmMMXinst PUNPCKHBQ PUNPCKHWD PUNPCKLBW PUNPCKLDQ PUNPCKLWD
|
|
75 syn keyword tasmMMXinst PXOR
|
|
76 "FCMOV
|
|
77 syn match tasmInstruction "\<\(CMPS\|MOVS\|OUTS\|SCAS\|STOS\|LODS\|INS\)[BWD]"
|
|
78 syn match tasmInstruction "\<\(CMOV\|SET\|J\)N\=[ABCGLESXZ]\>"
|
|
79 syn match tasmInstruction "\<\(CMOV\|SET\|J\)N\=[ABGL]E\>"
|
|
80 syn match tasmInstruction "\<\(LOOP\|REP\)N\=[EZ]\=\>"
|
|
81 syn match tasmRegister "\<[A-D][LH]\>"
|
|
82 syn match tasmRegister "\<E\=\([A-D]X\|[SD]I\|[BS]P\)\>"
|
|
83 syn match tasmRegister "\<[C-GS]S\>"
|
|
84 syn region tasmComment start=";" end="$"
|
|
85 "HACK! comment ? ... selection
|
|
86 syn region tasmComment start="comment \+\$" end="\$"
|
|
87 syn region tasmComment start="comment \+\~" end="\~"
|
|
88 syn region tasmComment start="comment \+#" end="#"
|
|
89 syn region tasmString start="'" end="'"
|
|
90 syn region tasmString start='"' end='"'
|
|
91
|
|
92 syn match tasmDec "\<-\=[0-9]\+\.\=[0-9]*\>"
|
|
93 syn match tasmHex "\<[0-9][0-9A-F]*H\>"
|
|
94 syn match tasmOct "\<[0-7]\+O\>"
|
|
95 syn match tasmBin "\<[01]\+B\>"
|
|
96
|
|
97 " Define the default highlighting.
|
|
98 " For version 5.7 and earlier: only when not done already
|
|
99 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
100 if version >= 508 || !exists("did_tasm_syntax_inits")
|
|
101 if version < 508
|
|
102 let did_tasm_syntax_inits = 1
|
|
103 command -nargs=+ HiLink hi link <args>
|
|
104 else
|
|
105 command -nargs=+ HiLink hi def link <args>
|
|
106 endif
|
|
107
|
|
108 HiLink tasmString String
|
|
109 HiLink tasmDec Number
|
|
110 HiLink tasmHex Number
|
|
111 HiLink tasmOct Number
|
|
112 HiLink tasmBin Number
|
|
113 HiLink tasmInstruction Keyword
|
|
114 HiLink tasmCoprocInstr Keyword
|
|
115 HiLink tasmMMXInst Keyword
|
|
116 HiLink tasmDirective PreProc
|
|
117 HiLink tasmRegister Identifier
|
|
118 HiLink tasmProctype PreProc
|
|
119 HiLink tasmComment Comment
|
|
120 HiLink tasmLabel Label
|
|
121
|
|
122 delcommand HiLink
|
|
123 endif
|
|
124
|
|
125 let b:curret_syntax = "tasm"
|
3312
|
126
|
|
127 let &cpo = s:cpo_save
|
|
128 unlet s:cpo_save
|