comparison runtime/syntax/nasm.vim @ 2596:fae782ef63dd

Runtime file updates.
author Bram Moolenaar <bram@vim.org>
date Thu, 30 Sep 2010 21:47:56 +0200
parents 3fc0f57ecb91
children b37888de599c
comparison
equal deleted inserted replaced
2595:bf9579ab26e5 2596:fae782ef63dd
1 " Vim syntax file 1 " Vim syntax file
2 " Language: NASM - The Netwide Assembler (v0.98) 2 " Language: NASM - The Netwide Assembler (v0.98)
3 " Maintainer: Manuel M.H. Stol <mmh.stol@gmx.net> 3 " Maintainer: Andriy Sokolov <andriy145@gmail.com>
4 " Last Change: 2003 May 11 4 " Original Author: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
5 " Vim URL: http://www.vim.org/lang.html 5 " Former Maintainer: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
6 " NASM Home: http://www.cryogen.com/Nasm/ 6 " Last Change: 2010 Sep 24
7 " NASM Home: http://www.nasm.us/
7 8
8 9
9 10
10 " Setup Syntax: 11 " Setup Syntax:
11 " Clear old syntax settings 12 " Clear old syntax settings
158 syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="\<ISTRUCT\=\>" end="\<IEND\(STRUCT\=\)\=\>" contains=@nasmGrpCntnMacro,nasmInStructure 159 syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="\<ISTRUCT\=\>" end="\<IEND\(STRUCT\=\)\=\>" contains=@nasmGrpCntnMacro,nasmInStructure
159 " union types are not part of nasm (yet) 160 " union types are not part of nasm (yet)
160 "syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="^\s*UNION\>"hs=e-4 end="^\s*ENDUNION\>"re=e-8 contains=@nasmGrpCntnMacro 161 "syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="^\s*UNION\>"hs=e-4 end="^\s*ENDUNION\>"re=e-8 contains=@nasmGrpCntnMacro
161 "syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="\<IUNION\>" end="\<IEND\(UNION\)\=\>" contains=@nasmGrpCntnMacro,nasmInStructure 162 "syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="\<IUNION\>" end="\<IEND\(UNION\)\=\>" contains=@nasmGrpCntnMacro,nasmInStructure
162 syn region nasmInMacPreConDef contained transparent matchgroup=nasmInMacPreCondit start="^\s*%ifnidni\>"hs=e-7 start="^\s*%if\(idni\|n\(ctx\|def\|idn\|num\|str\)\)\>"hs=e-6 start="^\s*%if\(ctx\|def\|idn\|nid\|num\|str\)\>"hs=e-5 start="^\s*%ifid\>"hs=e-4 start="^\s*%if\>"hs=e-2 end="%endif\>" contains=@nasmGrpCntnMacro,nasmInMacPreCondit,nasmInPreCondit 163 syn region nasmInMacPreConDef contained transparent matchgroup=nasmInMacPreCondit start="^\s*%ifnidni\>"hs=e-7 start="^\s*%if\(idni\|n\(ctx\|def\|idn\|num\|str\)\)\>"hs=e-6 start="^\s*%if\(ctx\|def\|idn\|nid\|num\|str\)\>"hs=e-5 start="^\s*%ifid\>"hs=e-4 start="^\s*%if\>"hs=e-2 end="%endif\>" contains=@nasmGrpCntnMacro,nasmInMacPreCondit,nasmInPreCondit
164 " Todo: allow STRUC/ISTRUC to be used inside preprocessor conditional block
163 syn match nasmInMacPreCondit contained transparent "ctx\s"lc=3 skipwhite nextgroup=@nasmGrpNxtCtx 165 syn match nasmInMacPreCondit contained transparent "ctx\s"lc=3 skipwhite nextgroup=@nasmGrpNxtCtx
164 syn match nasmInMacPreCondit contained "^\s*%elifctx\>"hs=e-7 skipwhite nextgroup=@nasmGrpNxtCtx 166 syn match nasmInMacPreCondit contained "^\s*%elifctx\>"hs=e-7 skipwhite nextgroup=@nasmGrpNxtCtx
165 syn match nasmInMacPreCondit contained "^\s*%elifnctx\>"hs=e-8 skipwhite nextgroup=@nasmGrpNxtCtx 167 syn match nasmInMacPreCondit contained "^\s*%elifnctx\>"hs=e-8 skipwhite nextgroup=@nasmGrpNxtCtx
166 syn match nasmInMacParamNum contained "\<\d\+\.list\>"me=e-5 168 syn match nasmInMacParamNum contained "\<\d\+\.list\>"me=e-5
167 syn match nasmInMacParamNum contained "\<\d\+\.nolist\>"me=e-7 169 syn match nasmInMacParamNum contained "\<\d\+\.nolist\>"me=e-7
208 syn match nasmInPreCondit contained "^\s*%elifnidni\>"hs=e-9 210 syn match nasmInPreCondit contained "^\s*%elifnidni\>"hs=e-9
209 syn cluster nasmGrpInPreCondits contains=nasmPreCondit,nasmInPreCondit,nasmCtxPreCondit 211 syn cluster nasmGrpInPreCondits contains=nasmPreCondit,nasmInPreCondit,nasmCtxPreCondit
210 syn cluster nasmGrpPreCondits contains=nasmPreConditDef,@nasmGrpInPreCondits,nasmCtxPreProc,nasmCtxLocLabel 212 syn cluster nasmGrpPreCondits contains=nasmPreConditDef,@nasmGrpInPreCondits,nasmCtxPreProc,nasmCtxLocLabel
211 213
212 " Other pre-processor statements 214 " Other pre-processor statements
213 syn match nasmPreProc "^\s*%rep\>"hs=e-3 215 syn match nasmPreProc "^\s*%\(rep\|use\)\>"hs=e-3
214 syn match nasmPreProc "^\s*%line\>"hs=e-4 216 syn match nasmPreProc "^\s*%line\>"hs=e-4
215 syn match nasmPreProc "^\s*%\(clear\|error\)\>"hs=e-5 217 syn match nasmPreProc "^\s*%\(clear\|error\|fatal\)\>"hs=e-5
216 syn match nasmPreProc "^\s*%endrep\>"hs=e-6 218 syn match nasmPreProc "^\s*%\(endrep\|strlen\|substr\)\>"hs=e-6
217 syn match nasmPreProc "^\s*%exitrep\>"hs=e-7 219 syn match nasmPreProc "^\s*%\(exitrep\|warning\)\>"hs=e-7
218 syn match nasmDefine "^\s*%undef\>"hs=e-5 220 syn match nasmDefine "^\s*%undef\>"hs=e-5
219 syn match nasmDefine "^\s*%\(assign\|define\)\>"hs=e-6 221 syn match nasmDefine "^\s*%\(assign\|define\)\>"hs=e-6
220 syn match nasmDefine "^\s*%i\(assign\|define\)\>"hs=e-7 222 syn match nasmDefine "^\s*%i\(assign\|define\)\>"hs=e-7
223 syn match nasmDefine "^\s*%unmacro\>"hs=e-7
221 syn match nasmInclude "^\s*%include\>"hs=e-7 224 syn match nasmInclude "^\s*%include\>"hs=e-7
225 " Todo: Treat the line tail after %fatal, %error, %warning as text
222 226
223 " Multiple pre-processor instructions on single line detection (obsolete) 227 " Multiple pre-processor instructions on single line detection (obsolete)
224 "syn match nasmPreProcError +^\s*\([^\t "%';][^"%';]*\|[^\t "';][^"%';]\+\)%\a\+\>+ 228 "syn match nasmPreProcError +^\s*\([^\t "%';][^"%';]*\|[^\t "';][^"%';]\+\)%\a\+\>+
225 syn cluster nasmGrpPreProcs contains=nasmMacroDef,@nasmGrpInMacros,@nasmGrpPreCondits,nasmPreProc,nasmDefine,nasmInclude,nasmPreProcWarn,nasmPreProcError 229 syn cluster nasmGrpPreProcs contains=nasmMacroDef,@nasmGrpInMacros,@nasmGrpPreCondits,nasmPreProc,nasmDefine,nasmInclude,nasmPreProcWarn,nasmPreProcError
226 230
229 " Register Identifiers: 233 " Register Identifiers:
230 " Register operands: 234 " Register operands:
231 syn match nasmGen08Register "\<[A-D][HL]\>" 235 syn match nasmGen08Register "\<[A-D][HL]\>"
232 syn match nasmGen16Register "\<\([A-D]X\|[DS]I\|[BS]P\)\>" 236 syn match nasmGen16Register "\<\([A-D]X\|[DS]I\|[BS]P\)\>"
233 syn match nasmGen32Register "\<E\([A-D]X\|[DS]I\|[BS]P\)\>" 237 syn match nasmGen32Register "\<E\([A-D]X\|[DS]I\|[BS]P\)\>"
238 syn match nasmGen64Register "\<R\([A-D]X\|[DS]I\|[BS]P\|[89]\|1[0-5]\|[89][WD]\|1[0-5][WD]\)\>"
234 syn match nasmSegRegister "\<[C-GS]S\>" 239 syn match nasmSegRegister "\<[C-GS]S\>"
235 syn match nasmSpcRegister "\<E\=IP\>" 240 syn match nasmSpcRegister "\<E\=IP\>"
236 syn match nasmFpuRegister "\<ST\o\>" 241 syn match nasmFpuRegister "\<ST\o\>"
237 syn match nasmMmxRegister "\<MM\o\>" 242 syn match nasmMmxRegister "\<MM\o\>"
238 syn match nasmSseRegister "\<XMM\o\>" 243 syn match nasmSseRegister "\<XMM\o\>"
296 syn match nasmInstructnError "\<MOV\s[^,;[]*\<CS\>\s*[^:]"he=e-1 301 syn match nasmInstructnError "\<MOV\s[^,;[]*\<CS\>\s*[^:]"he=e-1
297 syn match nasmStdInstruction "\<\(CMOV\|J\|SET\)\(N\=\([ABGL]E\=\|[CEOSZ]\)\|P[EO]\=\)\>" 302 syn match nasmStdInstruction "\<\(CMOV\|J\|SET\)\(N\=\([ABGL]E\=\|[CEOSZ]\)\|P[EO]\=\)\>"
298 syn match nasmStdInstruction "\<POP\>" 303 syn match nasmStdInstruction "\<POP\>"
299 syn keyword nasmStdInstruction AAA AAD AAM AAS ADC ADD AND 304 syn keyword nasmStdInstruction AAA AAD AAM AAS ADC ADD AND
300 syn keyword nasmStdInstruction BOUND BSF BSR BSWAP BT[C] BTR BTS 305 syn keyword nasmStdInstruction BOUND BSF BSR BSWAP BT[C] BTR BTS
301 syn keyword nasmStdInstruction CALL CBW CDQ CLC CLD CMC CMP CMPSB CMPSD CMPSW 306 syn keyword nasmStdInstruction CALL CBW CDQ CLC CLD CMC CMP CMPSB CMPSD CMPSW CMPSQ
302 syn keyword nasmStdInstruction CMPXCHG CMPXCHG8B CPUID CWD[E] 307 syn keyword nasmStdInstruction CMPXCHG CMPXCHG8B CPUID CWD[E] CQO
303 syn keyword nasmStdInstruction DAA DAS DEC DIV ENTER 308 syn keyword nasmStdInstruction DAA DAS DEC DIV ENTER
304 syn keyword nasmStdInstruction IDIV IMUL INC INT[O] IRET[D] IRETW 309 syn keyword nasmStdInstruction IDIV IMUL INC INT[O] IRET[D] IRETW IRETQ
305 syn keyword nasmStdInstruction JCXZ JECXZ JMP 310 syn keyword nasmStdInstruction JCXZ JECXZ JMP
306 syn keyword nasmStdInstruction LAHF LDS LEA LEAVE LES LFS LGS LODSB LODSD 311 syn keyword nasmStdInstruction LAHF LDS LEA LEAVE LES LFS LGS LODSB LODSD LODSQ
307 syn keyword nasmStdInstruction LODSW LOOP[E] LOOPNE LOOPNZ LOOPZ LSS 312 syn keyword nasmStdInstruction LODSW LOOP[E] LOOPNE LOOPNZ LOOPZ LSS
308 syn keyword nasmStdInstruction MOVSB MOVSD MOVSW MOVSX MOVZX MUL NEG NOP NOT 313 syn keyword nasmStdInstruction MOVSB MOVSD MOVSW MOVSX MOVSQ MOVZX MUL NEG NOP NOT
309 syn keyword nasmStdInstruction OR POPA[D] POPAW POPF[D] POPFW 314 syn keyword nasmStdInstruction OR POPA[D] POPAW POPF[D] POPFW POPFQ
310 syn keyword nasmStdInstruction PUSH[AD] PUSHAW PUSHF[D] PUSHFW 315 syn keyword nasmStdInstruction PUSH[AD] PUSHAW PUSHF[D] PUSHFW PUSHFQ
311 syn keyword nasmStdInstruction RCL RCR RETF RET[N] ROL ROR 316 syn keyword nasmStdInstruction RCL RCR RETF RET[N] ROL ROR
312 syn keyword nasmStdInstruction SAHF SAL SAR SBB SCASB SCASD SCASW 317 syn keyword nasmStdInstruction SAHF SAL SAR SBB SCASB SCASD SCASW
313 syn keyword nasmStdInstruction SHL[D] SHR[D] STC STD STOSB STOSD STOSW SUB 318 syn keyword nasmStdInstruction SHL[D] SHR[D] STC STD STOSB STOSD STOSW STOSQ SUB
314 syn keyword nasmStdInstruction TEST XADD XCHG XLATB XOR 319 syn keyword nasmStdInstruction TEST XADD XCHG XLATB XOR
320 syn keyword nasmStdInstruction LFENCE MFENCE SFENCE
315 321
316 322
317 " System Instructions: (usually privileged) 323 " System Instructions: (usually privileged)
318 " Verification of pointer parameters 324 " Verification of pointer parameters
319 syn keyword nasmSysInstruction ARPL LAR LSL VERR VERW 325 syn keyword nasmSysInstruction ARPL LAR LSL VERR VERW