annotate runtime/syntax/nasm.vim @ 27181:f9f1e76957a6 v8.2.4119

patch 8.2.4119: build failure when disabling the channel feature Commit: https://github.com/vim/vim/commit/e8741a73e20cd6043dd1610fb4c22ae9d132eb56 Author: Dominique Pelle <dominique.pelle@gmail.com> Date: Mon Jan 17 11:23:45 2022 +0000 patch 8.2.4119: build failure when disabling the channel feature Problem: Build failure when disabling the channel feature. Solution: Adjust #ifdef. (Dominique Pell?, closes https://github.com/vim/vim/issues/9545)
author Bram Moolenaar <Bram@vim.org>
date Mon, 17 Jan 2022 12:30:05 +0100
parents 5c98ea5f5d6e
children 2a17771529af
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: NASM - The Netwide Assembler (v0.98)
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
3 " Maintainer: Andrii Sokolov <andriy145@gmail.com>
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " Original Author: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
5 " Former Maintainer: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
24387
5c98ea5f5d6e Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10734
diff changeset
6 " Contributors: Leonard König <leonard.r.koenig@gmail.com> (C string highlighting), Peter Stanhope <dev.rptr@gmail.com> (Add missing 64-bit mode registers)
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
7 " Last Change: 2017 Jan 23
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
8 " NASM Home: http://www.nasm.us/
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " Setup Syntax:
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
13 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
14 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Assembler syntax is case insensetive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " Vim search and movement commands on identifers
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
23 " Comments at start of a line inside which to skip search for indentifiers
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
24 setlocal comments=:;
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
25 " Identifier Keyword characters (defines \k)
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
26 setlocal iskeyword=@,48-57,#,$,.,?,@-@,_,~
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Comments:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn region nasmComment start=";" keepend end="$" contains=@nasmGrpInComments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn region nasmSpecialComment start=";\*\*\*" keepend end="$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword nasmInCommentTodo contained TODO FIXME XXX[XXXXX]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn cluster nasmGrpInComments contains=nasmInCommentTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn cluster nasmGrpComments contains=@nasmGrpInComments,nasmComment,nasmSpecialComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Label Identifiers:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " in NASM: 'Everything is a Label'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " Definition Label = label defined by %[i]define or %[i]assign
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " Identifier Label = label defined as first non-keyword on a line or %[i]macro
3356
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
42 syn match nasmLabelError "$\=\(\d\+\K\|[#.@]\|\$\$\k\)\k*\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match nasmLabel "\<\(\h\|[?@]\)\k*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match nasmLabel "[\$\~]\(\h\|[?@]\)\k*\>"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " Labels starting with one or two '.' are special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match nasmLocalLabel "\<\.\(\w\|[#$?@~]\)\k*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match nasmLocalLabel "\<\$\.\(\w\|[#$?@~]\)\k*\>"ms=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 if !exists("nasm_no_warn")
3356
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
49 syn match nasmLabelWarn "\<\~\=\$\=[_.][_.\~]*\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 if exists("nasm_loose_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match nasmSpecialLabel "\<\.\.@\k\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match nasmSpecialLabel "\<\$\.\.@\k\+\>"ms=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 if !exists("nasm_no_warn")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match nasmLabelWarn "\<\$\=\.\.@\(\d\|[#$\.~]\)\k*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " disallow use of nasm internal label format
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn match nasmLabelError "\<\$\=\.\.@\d\+\.\k*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn match nasmSpecialLabel "\<\.\.@\(\h\|[?@]\)\k*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match nasmSpecialLabel "\<\$\.\.@\(\h\|[?@]\)\k*\>"ms=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 " Labels can be dereferenced with '$' to destinguish them from reserved words
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match nasmLabelError "\<\$\K\k*\s*:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn match nasmLabelError "^\s*\$\K\k*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn match nasmLabelError "\<\~\s*\(\k*\s*:\|\$\=\.\k*\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 " Constants:
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
71 syn match nasmStringError +["'`]+
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
72 " NASM is case sensitive here: eg. u-prefix allows for 4-digit, U-prefix for
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
73 " 8-digit Unicode characters
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
74 syn case match
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
75 " one-char escape-sequences
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
76 syn match nasmCStringEscape display contained "\\[’"‘\\\?abtnvfre]"
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
77 " hex and octal numbers
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
78 syn match nasmCStringEscape display contained "\\\(x\x\{2}\|\o\{1,3}\)"
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
79 " Unicode characters
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
80 syn match nasmCStringEscape display contained "\\\(u\x\{4}\|U\x\{8}\)"
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
81 " ISO C99 format strings (copied from cFormat in runtime/syntax/c.vim)
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
82 syn match nasmCStringFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
83 syn match nasmCStringFormat display "%%" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn match nasmString +\("[^"]\{-}"\|'[^']\{-}'\)+
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
85 " Highlight C escape- and format-sequences within ``-strings
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
86 syn match nasmCString +\(`[^`]\{-}`\)+ contains=nasmCStringEscape,nasmCStringFormat extend
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
87 syn case ignore
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match nasmBinNumber "\<[0-1]\+b\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn match nasmBinNumber "\<\~[0-1]\+b\>"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn match nasmOctNumber "\<\o\+q\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn match nasmOctNumber "\<\~\o\+q\>"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match nasmDecNumber "\<\d\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn match nasmDecNumber "\<\~\d\+\>"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn match nasmHexNumber "\<\(\d\x*h\|0x\x\+\|\$\d\x*\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn match nasmHexNumber "\<\~\(\d\x*h\|0x\x\+\|\$\d\x*\)\>"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match nasmFltNumber "\<\d\+\.\d*\(e[+-]\=\d\+\)\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn keyword nasmFltNumber Inf Infinity Indefinite NaN SNaN QNaN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 syn match nasmNumberError "\<\~\s*\d\+\.\d*\(e[+-]\=\d\+\)\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 " Netwide Assembler Storage Directives:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 " Storage types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 syn keyword nasmTypeError DF EXTRN FWORD RESF TBYTE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn keyword nasmType FAR NEAR SHORT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn keyword nasmType BYTE WORD DWORD QWORD DQWORD HWORD DHWORD TWORD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn keyword nasmType CDECL FASTCALL NONE PASCAL STDCALL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn keyword nasmStorage DB DW DD DQ DDQ DT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 syn keyword nasmStorage RESB RESW RESD RESQ RESDQ REST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn keyword nasmStorage EXTERN GLOBAL COMMON
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 " Structured storage types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 syn match nasmTypeError "\<\(AT\|I\=\(END\)\=\(STRUCT\=\|UNION\)\|I\=END\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 syn match nasmStructureLabel contained "\<\(AT\|I\=\(END\)\=\(STRUCT\=\|UNION\)\|I\=END\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 " structures cannot be nested (yet) -> use: 'keepend' and 're='
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 syn cluster nasmGrpCntnStruc contains=ALLBUT,@nasmGrpInComments,nasmMacroDef,@nasmGrpInMacros,@nasmGrpInPreCondits,nasmStructureDef,@nasmGrpInStrucs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="^\s*STRUCT\>"hs=e-5 end="^\s*ENDSTRUCT\>"re=e-9 contains=@nasmGrpCntnStruc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="^\s*STRUC\>"hs=e-4 end="^\s*ENDSTRUC\>"re=e-8 contains=@nasmGrpCntnStruc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="\<ISTRUCT\=\>" end="\<IEND\(STRUCT\=\)\=\>" contains=@nasmGrpCntnStruc,nasmInStructure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 " union types are not part of nasm (yet)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 "syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="^\s*UNION\>"hs=e-4 end="^\s*ENDUNION\>"re=e-8 contains=@nasmGrpCntnStruc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 "syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="\<IUNION\>" end="\<IEND\(UNION\)\=\>" contains=@nasmGrpCntnStruc,nasmInStructure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 syn match nasmInStructure contained "^\s*AT\>"hs=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 syn cluster nasmGrpInStrucs contains=nasmStructure,nasmInStructure,nasmStructureLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 " PreProcessor Instructions:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 " NAsm PreProcs start with %, but % is not a character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 syn match nasmPreProcError "%{\=\(%\=\k\+\|%%\+\k*\|[+-]\=\d\+\)}\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 if exists("nasm_loose_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 syn cluster nasmGrpNxtCtx contains=nasmStructureLabel,nasmLabel,nasmLocalLabel,nasmSpecialLabel,nasmLabelError,nasmPreProcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 syn cluster nasmGrpNxtCtx contains=nasmStructureLabel,nasmLabel,nasmLabelError,nasmPreProcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 " Multi-line macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 syn cluster nasmGrpCntnMacro contains=ALLBUT,@nasmGrpInComments,nasmStructureDef,@nasmGrpInStrucs,nasmMacroDef,@nasmGrpPreCondits,nasmMemReference,nasmInMacPreCondit,nasmInMacStrucDef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 syn region nasmMacroDef matchgroup=nasmMacro keepend start="^\s*%macro\>"hs=e-5 start="^\s*%imacro\>"hs=e-6 end="^\s*%endmacro\>"re=e-9 contains=@nasmGrpCntnMacro,nasmInMacStrucDef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 if exists("nasm_loose_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 syn match nasmInMacLabel contained "%\(%\k\+\>\|{%\k\+}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 syn match nasmInMacLabel contained "%\($\+\(\w\|[#\.?@~]\)\k*\>\|{$\+\(\w\|[#\.?@~]\)\k*}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 syn match nasmInMacPreProc contained "^\s*%\(push\|repl\)\>"hs=e-4 skipwhite nextgroup=nasmStructureLabel,nasmLabel,nasmInMacParam,nasmLocalLabel,nasmSpecialLabel,nasmLabelError,nasmPreProcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 if !exists("nasm_no_warn")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 syn match nasmInMacLblWarn contained "%\(%[$\.]\k*\>\|{%[$\.]\k*}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 syn match nasmInMacLblWarn contained "%\($\+\(\d\|[#\.@~]\)\k*\|{\$\+\(\d\|[#\.@~]\)\k*}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 hi link nasmInMacCatLabel nasmInMacLblWarn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 hi link nasmInMacCatLabel nasmInMacLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 syn match nasmInMacLabel contained "%\(%\(\w\|[#?@~]\)\k*\>\|{%\(\w\|[#?@~]\)\k*}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 syn match nasmInMacLabel contained "%\($\+\(\h\|[?@]\)\k*\>\|{$\+\(\h\|[?@]\)\k*}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 hi link nasmInMacCatLabel nasmLabelError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 syn match nasmInMacCatLabel contained "\d\K\k*"lc=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 syn match nasmInMacLabel contained "\d}\k\+"lc=2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 if !exists("nasm_no_warn")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 syn match nasmInMacLblWarn contained "%\(\($\+\|%\)[_~][._~]*\>\|{\($\+\|%\)[_~][._~]*}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 syn match nasmInMacPreProc contained "^\s*%pop\>"hs=e-3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 syn match nasmInMacPreProc contained "^\s*%\(push\|repl\)\>"hs=e-4 skipwhite nextgroup=@nasmGrpNxtCtx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 " structures cannot be nested (yet) -> use: 'keepend' and 're='
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="^\s*STRUCT\>"hs=e-5 end="^\s*ENDSTRUCT\>"re=e-9 contains=@nasmGrpCntnMacro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="^\s*STRUC\>"hs=e-4 end="^\s*ENDSTRUC\>"re=e-8 contains=@nasmGrpCntnMacro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="\<ISTRUCT\=\>" end="\<IEND\(STRUCT\=\)\=\>" contains=@nasmGrpCntnMacro,nasmInStructure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 " union types are not part of nasm (yet)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 "syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="^\s*UNION\>"hs=e-4 end="^\s*ENDUNION\>"re=e-8 contains=@nasmGrpCntnMacro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 "syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="\<IUNION\>" end="\<IEND\(UNION\)\=\>" contains=@nasmGrpCntnMacro,nasmInStructure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 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
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
169 " Todo: allow STRUC/ISTRUC to be used inside preprocessor conditional block
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 syn match nasmInMacPreCondit contained transparent "ctx\s"lc=3 skipwhite nextgroup=@nasmGrpNxtCtx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 syn match nasmInMacPreCondit contained "^\s*%elifctx\>"hs=e-7 skipwhite nextgroup=@nasmGrpNxtCtx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 syn match nasmInMacPreCondit contained "^\s*%elifnctx\>"hs=e-8 skipwhite nextgroup=@nasmGrpNxtCtx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 syn match nasmInMacParamNum contained "\<\d\+\.list\>"me=e-5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 syn match nasmInMacParamNum contained "\<\d\+\.nolist\>"me=e-7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 syn match nasmInMacDirective contained "\.\(no\)\=list\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 syn match nasmInMacMacro contained transparent "macro\s"lc=5 skipwhite nextgroup=nasmStructureLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 syn match nasmInMacMacro contained "^\s*%rotate\>"hs=e-6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 syn match nasmInMacParam contained "%\([+-]\=\d\+\|{[+-]\=\d\+}\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 " nasm conditional macro operands/arguments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 " Todo: check feasebility; add too nasmGrpInMacros, etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 "syn match nasmInMacCond contained "\<\(N\=\([ABGL]E\=\|[CEOSZ]\)\|P[EO]\=\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 syn cluster nasmGrpInMacros contains=nasmMacro,nasmInMacMacro,nasmInMacParam,nasmInMacParamNum,nasmInMacDirective,nasmInMacLabel,nasmInMacLblWarn,nasmInMacMemRef,nasmInMacPreConDef,nasmInMacPreCondit,nasmInMacPreProc,nasmInMacStrucDef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 " Context pre-procs that are better used inside a macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 if exists("nasm_ctx_outside_macro")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 syn region nasmPreConditDef transparent matchgroup=nasmCtxPreCondit start="^\s*%ifnctx\>"hs=e-6 start="^\s*%ifctx\>"hs=e-5 end="%endif\>" contains=@nasmGrpCntnPreCon
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 syn match nasmCtxPreProc "^\s*%pop\>"hs=e-3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 if exists("nasm_loose_syntax")
3356
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
189 syn match nasmCtxLocLabel "%$\+\(\w\|[#.?@~]\)\k*\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 syn match nasmCtxLocLabel "%$\+\(\h\|[?@]\)\k*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 syn match nasmCtxPreProc "^\s*%\(push\|repl\)\>"hs=e-4 skipwhite nextgroup=@nasmGrpNxtCtx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 syn match nasmCtxPreCondit contained transparent "ctx\s"lc=3 skipwhite nextgroup=@nasmGrpNxtCtx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 syn match nasmCtxPreCondit contained "^\s*%elifctx\>"hs=e-7 skipwhite nextgroup=@nasmGrpNxtCtx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 syn match nasmCtxPreCondit contained "^\s*%elifnctx\>"hs=e-8 skipwhite nextgroup=@nasmGrpNxtCtx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 if exists("nasm_no_warn")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 hi link nasmCtxPreCondit nasmPreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 hi link nasmCtxPreProc nasmPreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 hi link nasmCtxLocLabel nasmLocalLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 hi link nasmCtxPreCondit nasmPreProcWarn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 hi link nasmCtxPreProc nasmPreProcWarn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 hi link nasmCtxLocLabel nasmLabelWarn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 " Conditional assembly
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 syn cluster nasmGrpCntnPreCon contains=ALLBUT,@nasmGrpInComments,@nasmGrpInMacros,@nasmGrpInStrucs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 syn region nasmPreConditDef transparent matchgroup=nasmPreCondit start="^\s*%ifnidni\>"hs=e-7 start="^\s*%if\(idni\|n\(def\|idn\|num\|str\)\)\>"hs=e-6 start="^\s*%if\(def\|idn\|nid\|num\|str\)\>"hs=e-5 start="^\s*%ifid\>"hs=e-4 start="^\s*%if\>"hs=e-2 end="%endif\>" contains=@nasmGrpCntnPreCon
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 syn match nasmInPreCondit contained "^\s*%el\(if\|se\)\>"hs=e-4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 syn match nasmInPreCondit contained "^\s*%elifid\>"hs=e-6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 syn match nasmInPreCondit contained "^\s*%elif\(def\|idn\|nid\|num\|str\)\>"hs=e-7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 syn match nasmInPreCondit contained "^\s*%elif\(n\(def\|idn\|num\|str\)\|idni\)\>"hs=e-8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 syn match nasmInPreCondit contained "^\s*%elifnidni\>"hs=e-9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 syn cluster nasmGrpInPreCondits contains=nasmPreCondit,nasmInPreCondit,nasmCtxPreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 syn cluster nasmGrpPreCondits contains=nasmPreConditDef,@nasmGrpInPreCondits,nasmCtxPreProc,nasmCtxLocLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 " Other pre-processor statements
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
220 syn match nasmPreProc "^\s*%\(rep\|use\)\>"hs=e-3
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 syn match nasmPreProc "^\s*%line\>"hs=e-4
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
222 syn match nasmPreProc "^\s*%\(clear\|error\|fatal\)\>"hs=e-5
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
223 syn match nasmPreProc "^\s*%\(endrep\|strlen\|substr\)\>"hs=e-6
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
224 syn match nasmPreProc "^\s*%\(exitrep\|warning\)\>"hs=e-7
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 syn match nasmDefine "^\s*%undef\>"hs=e-5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 syn match nasmDefine "^\s*%\(assign\|define\)\>"hs=e-6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 syn match nasmDefine "^\s*%i\(assign\|define\)\>"hs=e-7
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
228 syn match nasmDefine "^\s*%unmacro\>"hs=e-7
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 syn match nasmInclude "^\s*%include\>"hs=e-7
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
230 " Todo: Treat the line tail after %fatal, %error, %warning as text
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 " Multiple pre-processor instructions on single line detection (obsolete)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 "syn match nasmPreProcError +^\s*\([^\t "%';][^"%';]*\|[^\t "';][^"%';]\+\)%\a\+\>+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 syn cluster nasmGrpPreProcs contains=nasmMacroDef,@nasmGrpInMacros,@nasmGrpPreCondits,nasmPreProc,nasmDefine,nasmInclude,nasmPreProcWarn,nasmPreProcError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 " Register Identifiers:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 " Register operands:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 syn match nasmGen08Register "\<[A-D][HL]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 syn match nasmGen16Register "\<\([A-D]X\|[DS]I\|[BS]P\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 syn match nasmGen32Register "\<E\([A-D]X\|[DS]I\|[BS]P\)\>"
24387
5c98ea5f5d6e Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10734
diff changeset
243 syn match nasmGen64Register "\<R\([A-D]X\|[DS]I\|[BS]P\|[89]\|1[0-5]\|[89][WDB]\|1[0-5][WDB]\)\>"
5c98ea5f5d6e Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10734
diff changeset
244 syn match nasmExtRegister "\<\([SB]PL\|[SD]IL\)\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 syn match nasmSegRegister "\<[C-GS]S\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 syn match nasmSpcRegister "\<E\=IP\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 syn match nasmFpuRegister "\<ST\o\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 syn match nasmMmxRegister "\<MM\o\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 syn match nasmSseRegister "\<XMM\o\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 syn match nasmCtrlRegister "\<CR\o\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 syn match nasmDebugRegister "\<DR\o\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 syn match nasmTestRegister "\<TR\o\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 syn match nasmRegisterError "\<\(CR[15-9]\|DR[4-58-9]\|TR[0-28-9]\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 syn match nasmRegisterError "\<X\=MM[8-9]\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 syn match nasmRegisterError "\<ST\((\d)\|[8-9]\>\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 syn match nasmRegisterError "\<E\([A-D][HL]\|[C-GS]S\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 " Memory reference operand (address):
3356
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
258 syn match nasmMemRefError "[[\]]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 syn cluster nasmGrpCntnMemRef contains=ALLBUT,@nasmGrpComments,@nasmGrpPreProcs,@nasmGrpInStrucs,nasmMemReference,nasmMemRefError
3356
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
260 syn match nasmInMacMemRef contained "\[[^;[\]]\{-}\]" contains=@nasmGrpCntnMemRef,nasmPreProcError,nasmInMacLabel,nasmInMacLblWarn,nasmInMacParam
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
261 syn match nasmMemReference "\[[^;[\]]\{-}\]" contains=@nasmGrpCntnMemRef,nasmPreProcError,nasmCtxLocLabel
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 " Netwide Assembler Directives:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 " Compilation constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 syn keyword nasmConstant __BITS__ __DATE__ __FILE__ __FORMAT__ __LINE__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 syn keyword nasmConstant __NASM_MAJOR__ __NASM_MINOR__ __NASM_VERSION__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 syn keyword nasmConstant __TIME__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 " Instruction modifiers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 syn match nasmInstructnError "\<TO\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 syn match nasmInstrModifier "\(^\|:\)\s*[C-GS]S\>"ms=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 syn keyword nasmInstrModifier A16 A32 O16 O32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 syn match nasmInstrModifier "\<F\(ADD\|MUL\|\(DIV\|SUB\)R\=\)\s\+TO\>"lc=5,ms=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 " the 'to' keyword is not allowed for fpu-pop instructions (yet)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 "syn match nasmInstrModifier "\<F\(ADD\|MUL\|\(DIV\|SUB\)R\=\)P\s\+TO\>"lc=6,ms=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 " NAsm directives
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 syn keyword nasmRepeat TIMES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 syn keyword nasmDirective ALIGN[B] INCBIN EQU NOSPLIT SPLIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 syn keyword nasmDirective ABSOLUTE BITS SECTION SEGMENT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 syn keyword nasmDirective ENDSECTION ENDSEGMENT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 syn keyword nasmDirective __SECT__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 " Macro created standard directives: (requires %include)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 syn keyword nasmStdDirective ENDPROC EPILOGUE LOCALS PROC PROLOGUE USES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 syn keyword nasmStdDirective ENDIF ELSE ELIF ELSIF IF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 "syn keyword nasmStdDirective BREAK CASE DEFAULT ENDSWITCH SWITCH
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 "syn keyword nasmStdDirective CASE OF ENDCASE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 syn keyword nasmStdDirective DO ENDFOR ENDWHILE FOR REPEAT UNTIL WHILE EXIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 " Format specific directives: (all formats)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 " (excluded: extension directives to section, global, common and extern)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 syn keyword nasmFmtDirective ORG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 syn keyword nasmFmtDirective EXPORT IMPORT GROUP UPPERCASE SEG WRT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 syn keyword nasmFmtDirective LIBRARY
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 syn keyword nasmFmtDirective _GLOBAL_OFFSET_TABLE_ __GLOBAL_OFFSET_TABLE_
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 syn keyword nasmFmtDirective ..start ..got ..gotoff ..gotpc ..plt ..sym
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 " Standard Instructions:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 syn match nasmInstructnError "\<\(F\=CMOV\|SET\)N\=\a\{0,2}\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 syn keyword nasmInstructnError CMPS MOVS LCS LODS STOS XLAT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 syn match nasmStdInstruction "\<MOV\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 syn match nasmInstructnError "\<MOV\s[^,;[]*\<CS\>\s*[^:]"he=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 syn match nasmStdInstruction "\<\(CMOV\|J\|SET\)\(N\=\([ABGL]E\=\|[CEOSZ]\)\|P[EO]\=\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 syn match nasmStdInstruction "\<POP\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 syn keyword nasmStdInstruction AAA AAD AAM AAS ADC ADD AND
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 syn keyword nasmStdInstruction BOUND BSF BSR BSWAP BT[C] BTR BTS
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
312 syn keyword nasmStdInstruction CALL CBW CDQ CLC CLD CMC CMP CMPSB CMPSD CMPSW CMPSQ
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
313 syn keyword nasmStdInstruction CMPXCHG CMPXCHG8B CPUID CWD[E] CQO
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 syn keyword nasmStdInstruction DAA DAS DEC DIV ENTER
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
315 syn keyword nasmStdInstruction IDIV IMUL INC INT[O] IRET[D] IRETW IRETQ
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 syn keyword nasmStdInstruction JCXZ JECXZ JMP
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
317 syn keyword nasmStdInstruction LAHF LDS LEA LEAVE LES LFS LGS LODSB LODSD LODSQ
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 syn keyword nasmStdInstruction LODSW LOOP[E] LOOPNE LOOPNZ LOOPZ LSS
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
319 syn keyword nasmStdInstruction MOVSB MOVSD MOVSW MOVSX MOVSQ MOVZX MUL NEG NOP NOT
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
320 syn keyword nasmStdInstruction OR POPA[D] POPAW POPF[D] POPFW POPFQ
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
321 syn keyword nasmStdInstruction PUSH[AD] PUSHAW PUSHF[D] PUSHFW PUSHFQ
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 syn keyword nasmStdInstruction RCL RCR RETF RET[N] ROL ROR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 syn keyword nasmStdInstruction SAHF SAL SAR SBB SCASB SCASD SCASW
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
324 syn keyword nasmStdInstruction SHL[D] SHR[D] STC STD STOSB STOSD STOSW STOSQ SUB
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 syn keyword nasmStdInstruction TEST XADD XCHG XLATB XOR
2596
fae782ef63dd Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
326 syn keyword nasmStdInstruction LFENCE MFENCE SFENCE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 " System Instructions: (usually privileged)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 " Verification of pointer parameters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 syn keyword nasmSysInstruction ARPL LAR LSL VERR VERW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 " Addressing descriptor tables
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 syn keyword nasmSysInstruction LLDT SLDT LGDT SGDT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 " Multitasking
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 syn keyword nasmSysInstruction LTR STR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 " Coprocessing and Multiprocessing (requires fpu and multiple cpu's resp.)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 syn keyword nasmSysInstruction CLTS LOCK WAIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 " Input and Output
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 syn keyword nasmInstructnError INS OUTS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 syn keyword nasmSysInstruction IN INSB INSW INSD OUT OUTSB OUTSB OUTSW OUTSD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 " Interrupt control
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 syn keyword nasmSysInstruction CLI STI LIDT SIDT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 " System control
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 syn match nasmSysInstruction "\<MOV\s[^;]\{-}\<CR\o\>"me=s+3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 syn keyword nasmSysInstruction HLT INVD LMSW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 syn keyword nasmSseInstruction PREFETCHT0 PREFETCHT1 PREFETCHT2 PREFETCHNTA
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 syn keyword nasmSseInstruction RSM SFENCE SMSW SYSENTER SYSEXIT UD2 WBINVD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 " TLB (Translation Lookahead Buffer) testing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 syn match nasmSysInstruction "\<MOV\s[^;]\{-}\<TR\o\>"me=s+3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 syn keyword nasmSysInstruction INVLPG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 " Debugging Instructions: (privileged)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 syn match nasmDbgInstruction "\<MOV\s[^;]\{-}\<DR\o\>"me=s+3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 syn keyword nasmDbgInstruction INT1 INT3 RDMSR RDTSC RDPMC WRMSR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 " Floating Point Instructions: (requires FPU)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 syn match nasmFpuInstruction "\<FCMOVN\=\([AB]E\=\|[CEPUZ]\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 syn keyword nasmFpuInstruction F2XM1 FABS FADD[P] FBLD FBSTP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 syn keyword nasmFpuInstruction FCHS FCLEX FCOM[IP] FCOMP[P] FCOS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 syn keyword nasmFpuInstruction FDECSTP FDISI FDIV[P] FDIVR[P] FENI FFREE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 syn keyword nasmFpuInstruction FIADD FICOM[P] FIDIV[R] FILD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 syn keyword nasmFpuInstruction FIMUL FINCSTP FINIT FIST[P] FISUB[R]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 syn keyword nasmFpuInstruction FLD[1] FLDCW FLDENV FLDL2E FLDL2T FLDLG2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 syn keyword nasmFpuInstruction FLDLN2 FLDPI FLDZ FMUL[P]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 syn keyword nasmFpuInstruction FNCLEX FNDISI FNENI FNINIT FNOP FNSAVE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 syn keyword nasmFpuInstruction FNSTCW FNSTENV FNSTSW FNSTSW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 syn keyword nasmFpuInstruction FPATAN FPREM[1] FPTAN FRNDINT FRSTOR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 syn keyword nasmFpuInstruction FSAVE FSCALE FSETPM FSIN FSINCOS FSQRT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 syn keyword nasmFpuInstruction FSTCW FSTENV FST[P] FSTSW FSUB[P] FSUBR[P]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 syn keyword nasmFpuInstruction FTST FUCOM[IP] FUCOMP[P]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 syn keyword nasmFpuInstruction FXAM FXCH FXTRACT FYL2X FYL2XP1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 " Multi Media Xtension Packed Instructions: (requires MMX unit)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 " Standard MMX instructions: (requires MMX1 unit)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 syn match nasmInstructnError "\<P\(ADD\|SUB\)U\=S\=[DQ]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 syn match nasmInstructnError "\<PCMP\a\{0,2}[BDWQ]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 syn keyword nasmMmxInstruction EMMS MOVD MOVQ
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 syn keyword nasmMmxInstruction PACKSSDW PACKSSWB PACKUSWB PADDB PADDD PADDW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 syn keyword nasmMmxInstruction PADDSB PADDSW PADDUSB PADDUSW PAND[N]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 syn keyword nasmMmxInstruction PCMPEQB PCMPEQD PCMPEQW PCMPGTB PCMPGTD PCMPGTW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 syn keyword nasmMmxInstruction PMACHRIW PMADDWD PMULHW PMULLW POR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 syn keyword nasmMmxInstruction PSLLD PSLLQ PSLLW PSRAD PSRAW PSRLD PSRLQ PSRLW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 syn keyword nasmMmxInstruction PSUBB PSUBD PSUBW PSUBSB PSUBSW PSUBUSB PSUBUSW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 syn keyword nasmMmxInstruction PUNPCKHBW PUNPCKHDQ PUNPCKHWD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 syn keyword nasmMmxInstruction PUNPCKLBW PUNPCKLDQ PUNPCKLWD PXOR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 " Extended MMX instructions: (requires MMX2/SSE unit)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 syn keyword nasmMmxInstruction MASKMOVQ MOVNTQ
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 syn keyword nasmMmxInstruction PAVGB PAVGW PEXTRW PINSRW PMAXSW PMAXUB
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 syn keyword nasmMmxInstruction PMINSW PMINUB PMOVMSKB PMULHUW PSADBW PSHUFW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 " Streaming SIMD Extension Packed Instructions: (requires SSE unit)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 syn match nasmInstructnError "\<CMP\a\{1,5}[PS]S\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 syn match nasmSseInstruction "\<CMP\(N\=\(EQ\|L[ET]\)\|\(UN\)\=ORD\)\=[PS]S\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 syn keyword nasmSseInstruction ADDPS ADDSS ANDNPS ANDPS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 syn keyword nasmSseInstruction COMISS CVTPI2PS CVTPS2PI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 syn keyword nasmSseInstruction CVTSI2SS CVTSS2SI CVTTPS2PI CVTTSS2SI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 syn keyword nasmSseInstruction DIVPS DIVSS FXRSTOR FXSAVE LDMXCSR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 syn keyword nasmSseInstruction MAXPS MAXSS MINPS MINSS MOVAPS MOVHLPS MOVHPS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 syn keyword nasmSseInstruction MOVLHPS MOVLPS MOVMSKPS MOVNTPS MOVSS MOVUPS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 syn keyword nasmSseInstruction MULPS MULSS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 syn keyword nasmSseInstruction ORPS RCPPS RCPSS RSQRTPS RSQRTSS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 syn keyword nasmSseInstruction SHUFPS SQRTPS SQRTSS STMXCSR SUBPS SUBSS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 syn keyword nasmSseInstruction UCOMISS UNPCKHPS UNPCKLPS XORPS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 " Three Dimensional Now Packed Instructions: (requires 3DNow! unit)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 syn keyword nasmNowInstruction FEMMS PAVGUSB PF2ID PFACC PFADD PFCMPEQ PFCMPGE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 syn keyword nasmNowInstruction PFCMPGT PFMAX PFMIN PFMUL PFRCP PFRCPIT1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 syn keyword nasmNowInstruction PFRCPIT2 PFRSQIT1 PFRSQRT PFSUB[R] PI2FD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 syn keyword nasmNowInstruction PMULHRWA PREFETCH[W]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 " Vendor Specific Instructions:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 " Cyrix instructions (requires Cyrix processor)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 syn keyword nasmCrxInstruction PADDSIW PAVEB PDISTIB PMAGW PMULHRW[C] PMULHRIW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 syn keyword nasmCrxInstruction PMVGEZB PMVLZB PMVNZB PMVZB PSUBSIW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 syn keyword nasmCrxInstruction RDSHR RSDC RSLDT SMINT SMINTOLD SVDC SVLDT SVTS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 syn keyword nasmCrxInstruction WRSHR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 " AMD instructions (requires AMD processor)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 syn keyword nasmAmdInstruction SYSCALL SYSRET
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 " Undocumented Instructions:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 syn match nasmUndInstruction "\<POP\s[^;]*\<CS\>"me=s+3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 syn keyword nasmUndInstruction CMPXCHG486 IBTS ICEBP INT01 INT03 LOADALL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 syn keyword nasmUndInstruction LOADALL286 LOADALL386 SALC SMI UD1 UMOV XBTS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 " Synchronize Syntax:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 syn sync clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 syn sync minlines=50 "for multiple region nesting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 syn sync match nasmSync grouphere nasmMacroDef "^\s*%i\=macro\>"me=s-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 syn sync match nasmSync grouphere NONE "^\s*%endmacro\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
441 " Only when an item doesn't have highlighting yet
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
442
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
443 " Sub Links:
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
444 hi def link nasmInMacDirective nasmDirective
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
445 hi def link nasmInMacLabel nasmLocalLabel
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
446 hi def link nasmInMacLblWarn nasmLabelWarn
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
447 hi def link nasmInMacMacro nasmMacro
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
448 hi def link nasmInMacParam nasmMacro
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
449 hi def link nasmInMacParamNum nasmDecNumber
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
450 hi def link nasmInMacPreCondit nasmPreCondit
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
451 hi def link nasmInMacPreProc nasmPreProc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
452 hi def link nasmInPreCondit nasmPreCondit
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
453 hi def link nasmInStructure nasmStructure
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
454 hi def link nasmStructureLabel nasmStructure
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
456 " Comment Group:
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
457 hi def link nasmComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
458 hi def link nasmSpecialComment SpecialComment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
459 hi def link nasmInCommentTodo Todo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
461 " Constant Group:
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
462 hi def link nasmString String
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
463 hi def link nasmCString String
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
464 hi def link nasmStringError Error
10734
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
465 hi def link nasmCStringEscape SpecialChar
523cd59d6db0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
466 hi def link nasmCStringFormat SpecialChar
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
467 hi def link nasmBinNumber Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
468 hi def link nasmOctNumber Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
469 hi def link nasmDecNumber Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
470 hi def link nasmHexNumber Number
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
471 hi def link nasmFltNumber Float
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
472 hi def link nasmNumberError Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
474 " Identifier Group:
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
475 hi def link nasmLabel Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
476 hi def link nasmLocalLabel Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
477 hi def link nasmSpecialLabel Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
478 hi def link nasmLabelError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
479 hi def link nasmLabelWarn Todo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
481 " PreProc Group:
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
482 hi def link nasmPreProc PreProc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
483 hi def link nasmDefine Define
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
484 hi def link nasmInclude Include
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
485 hi def link nasmMacro Macro
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
486 hi def link nasmPreCondit PreCondit
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
487 hi def link nasmPreProcError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
488 hi def link nasmPreProcWarn Todo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
490 " Type Group:
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
491 hi def link nasmType Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
492 hi def link nasmStorage StorageClass
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
493 hi def link nasmStructure Structure
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
494 hi def link nasmTypeError Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
496 " Directive Group:
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
497 hi def link nasmConstant Constant
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
498 hi def link nasmInstrModifier Operator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
499 hi def link nasmRepeat Repeat
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
500 hi def link nasmDirective Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
501 hi def link nasmStdDirective Operator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
502 hi def link nasmFmtDirective Keyword
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
503
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
504 " Register Group:
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
505 hi def link nasmCtrlRegister Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
506 hi def link nasmDebugRegister Debug
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
507 hi def link nasmTestRegister Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
508 hi def link nasmRegisterError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
509 hi def link nasmMemRefError Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3356
diff changeset
511 " Instruction Group:
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
512 hi def link nasmStdInstruction Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
513 hi def link nasmSysInstruction Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
514 hi def link nasmDbgInstruction Debug
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
515 hi def link nasmFpuInstruction Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
516 hi def link nasmMmxInstruction Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
517 hi def link nasmSseInstruction Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
518 hi def link nasmNowInstruction Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
519 hi def link nasmAmdInstruction Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
520 hi def link nasmCrxInstruction Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
521 hi def link nasmUndInstruction Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
522 hi def link nasmInstructnError Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 let b:current_syntax = "nasm"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 " vim:ts=8 sw=4