annotate runtime/syntax/tasm.vim @ 5322:9801d06e7b4c v7.4.014

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