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