-
Notifications
You must be signed in to change notification settings - Fork 0
/
asm.tmLanguage.json
287 lines (287 loc) · 11.4 KB
/
asm.tmLanguage.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
{
"information_for_contributors": [
"This file has been converted from https://github.com/maziac/asm-code-lens/blob/main/grammar/asm.json",
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/maziac/asm-code-lens/commit/803ace1181e4794702497ca53ae179626a917055",
"name": "asm",
"patterns": [
{
"include": "#comments"
},
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#mnemonics"
},
{
"include": "#numbers"
},
{
"include": "#labels"
}
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.block.asm",
"begin": "/\\*",
"end": "\\*/"
},
{
"match": "(?i:(;)(?!\\s*sldopt)(.*?)\\b(wpmem|logpoint|assertion)\\b)",
"captures": {
"1": {
"name": "keyword.control.dezog"
},
"2": {
"name": "comment.line.asm"
},
"3": {
"name": "keyword.control.dezog"
}
}
},
{
"name": "comment.line.asm",
"begin": ";",
"end": "\\n"
},
{
"name": "comment.line_slash.asm",
"begin": "//",
"end": "\\n"
},
{
"name": "comment.line_hashtag.asm",
"begin": "#\\s",
"end": "\\n"
}
]
},
"keywords": {
"patterns": [
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:equ|eval|org|end?t|align|(de|un)?phase|shift|save(bin|dev|hob|sna|tap|trd|nex)|empty(tap|trd)|inc(bin|hob|trd)|b?include|includelua|insert|labelslist|binary|end|out(put|end)|tap(out|end)|fpos|page|slot|size|outradix|(sld)?opt|comment)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:cpu|device|encoding|charset|proc|macro|local|shared|public|rept|dup|block|end[mpr]|edup|exitm|module|endmod(ule)?|(un)?define|export|disp|textarea|(memory|cspect)?map|mmu|field|defarray)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:assert|fatal|error|warning|message|display|shellexec|def[bdghlmswir]|d[bcdghmszw]|d24|abyte[cz]?|byte|word|dword|hex)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:ifn?|ifn?def|ifn?used|else|elseif|endif)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:bank|bankset|limit|protect|write\\s+direct|str|struct|endstruct|ends)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:incl48|incl49|inclz4|inczx7|incexo|lz48|lz49|lz4|lzw7|lzexo|lzclose)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:print|fail|repeat|rend|until|switch|case|default|break|endswitch|stop|while|wend)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:amsdos|breakpoint|buildcpr|buildsna|run|save|setcpc|setcrtc)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:list|nolist|let)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:setb(p|reakpoint)|bplist)\\b)"
},
{
"name": "keyword.control.asm",
"match": "(?i:(?<=\\s)(?:_(sjasmplus|version|release|errors|warnings))\\b)"
},
{
"name": "string.other.lua.asm",
"begin": "(?i:(?<=\\s)(lua)\\b)",
"beginCaptures": {
"1": {
"name": "keyword.control.asm"
}
},
"end": "(?i:(?<=\\s)(endlua)\\b)",
"endCaptures": {
"1": {
"name": "keyword.control.asm"
}
}
}
]
},
"strings": {
"patterns": [
{
"match": "(?i:(af'))",
"captures": {
"1": {
"name": "support.type.register.asm"
}
}
},
{
"name": "string.quoted.single.asm",
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.asm"
}
},
"end": "(\\')|((?:[^\\\\\\n])$)",
"endCaptures": {
"1": {
"name": "punctuation.definition.string.end.asm"
},
"2": {
"name": "invalid.illegal.newline.asm"
}
},
"patterns": [
{
"include": "#string-character-escape"
}
]
},
{
"name": "string.quoted.double.asm",
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.asm"
}
},
"end": "(\")|((?:[^\\\\\\n])$)",
"endCaptures": {
"1": {
"name": "punctuation.definition.string.end.asm"
},
"2": {
"name": "invalid.illegal.newline.asm"
}
},
"patterns": [
{
"include": "#string-character-escape"
}
]
}
]
},
"string-character-escape": {
"patterns": [
{
"name": "constant.character.escape.asm",
"match": "\\\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)"
}
]
},
"mnemonics": {
"patterns": [
{
"name": "support.type.flag.asm",
"match": "\\b(?i:(j[pr]|call|ret))(?:\\s+(?i:([cmpz]|n[cz]|p[eo])))?\\b",
"captures": {
"1": {
"name": "keyword.mnemonic.z80.asm"
},
"2": {
"name": "keyword.operator.z80.flag.asm"
}
}
},
{
"name": "keyword.mnemonic.z80.asm",
"match": "\\s(?i:adc|add|and|bit|ccf|cp|cpdr?|cpir?|cpl|daa|dec|[de]i|djnz|exx?|halt|im|in|inc|indr?|inir?|ld|lddr?|ldir?|neg|nop|or|ot[di]r|out|out[di]|pop|push|res|ret[in]|rl|rla|rlc|rlca|rld|rr|rra|rrc|rrca|rrd|rst|sbc|scf|set|sli?a|sll|swap|sra|srl|sub|xor)\\s"
},
{
"name": "keyword.mnemonic.z80n.asm",
"match": "\\s(?i:bsla|bsr[alf]|brlc|setae|pixelad|pixeldn|nextreg|mirror|ldws|ldix|ld[di]rx|outinb|mul|swapnib|test)\\s"
},
{
"name": "support.type.register.z80.asm",
"match": "\\b(?i:[abcdefhlir]|ix|iy|af'?|bc|de|hl|pc|sp|ix[luh]|iy[luh]|[lh]x|x[lh]|[lh]y|y[lh])\\b"
},
{
"name": "constant.numeric.operator.asm",
"match": "\\b(?i:high|low|not|mod|sh[lr])\\b"
},
{
"name": "constant.language.operator.asm",
"match": "(?i:\\{(?:hex[248]?|bin(?:8|16|32)?|int|eval)?\\})"
},
{
"name": "keyword.mnemonic.x86.asm",
"match": "\\s(?i:aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|altinst|and|andnpd|andpd|arpl|blendpd|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cdq|cdqe|clc|cld|clflush|clgi|cli|clts|cmc|cmova|cmovae|cmovb|cmovbe|cmovc|cmove|cmovg|cmovge|cmovl|cmovle|cmovna|cmovnae|cmovnb|cmovnbe|cmovnc|cmovne|cmovng|cmovnge|cmovnl|cmovnle|cmovno|cmovnp|cmovns|cmovnz|cmovo|cmovp|cmovpe|cmovpo|cmovs|cmovz|cmp|cmppd|cmpps|cmpsb|cmpsd|cmpsq|cmpss|cmpsw|cmpxchg|cmpxchg16b|cmpxchg8b|comisd|comiss|cpuid|cqo|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvtsi2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvttpd2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cwde|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|esc|extractps|f2xm1|fabs|fadd|faddp|fbld|fbstp|fchs|fclex|fcom|fcomp|fcompp|fcos|fdecstp|fdisi|fdiv|fdivp|fdivr|fdivrp|feni|ffree|fiadd|ficom|ficomp|fidiv|fidivr|fild|fimul|fincstp|finit|fist|fistp|fisub|fisubr|fld|fld1|fldcw|fldenv|fldenvd|fldenvw|fldl2e|fldl2t|fldlg2|fldln2|fldpi|fldz|fmul|fmulp|fnclex|fndisi|fneni|fninit|fnop|fnsave|fnsavew|fnstcw|fnstenv|fnstenvw|fnstsw|fpatan|fprem|fprem1|fptan|frndint|frstor|frstord|frstorw|fsave|fsaved|fsavew|fscale|fsetpm|fsin|fsincos|fsqrt|fst|fstcw|fstenv|fstenvd|fstenvw|fstp|fstsw|fsub|fsubp|fsubr|fsubrp|ftst|fucom|fucomp|fucompp|fwait|fxam|fxch|fxtract|fyl2x|fyl2xp1|haddpd|haddps|hlt|hsubpd|hsubps|ibts|icebp|idiv|imul|in|inc|ins|insd|insertps|int|into|invd|invlpg|invlpga|iret|iretd|iretf|iretq|ja|jae|jb|jbe|jc|jcxz|je|jecxz|jg|jge|jl|jle|jmp|jna|jnae|jnb|jnbe|jnc|jne|jng|jnge|jnl|jnle|jno|jnp|jns|jnz|jo|jpe|jpo|jrcxz|js|jz|lahf|lar|ld|lddqu|ldmxcsr|lds|lea|leave|les|lfence|lfs|lgdt|lgs|lidt|lldt|lmsw|loadall|loadalld|lock|lodsb|lodsd|lodsq|lodsw|lsl|lss|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movd|movddup|movdq2q|movdqa|movdqu|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdq|movntdqa|movnti|movntpd|movntps|movntq|movq|movq2dq|movsb|movsd|movshdup|movsldup|movss|movsw|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|nop|not|or|orpd|out|outs|outsd|pabsb|pabsd|pabsw|packssdw|packsswb|packusdw|packuswb|paddb|paddd|paddq|paddsb|paddsw|paddusb|paddusw|paddw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pcmpeqb|pcmpeqd|pcmpeqq|pcmpeqw|pcmpestri|pcmpestrm|pcmpgtb|pcmpgtd|pcmpgtq|pcmpgtw|pcmpistri|pcmpistrm|pextrb|pextrd|pextrq|pextrw|phaddd|phaddsw|phaddw|phminposuw|phsubd|phsubsw|phsubw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmaddwd|pmaxsb|pmaxsd|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsxbd|pmovsxbq|pmovsxbw|pmovsxdq|pmovsxwd|pmovsxwq|pmovzxbd|pmovzxbq|pmovzxbw|pmovzxdq|pmovzxwd|pmovzxwq|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludq|pop|popa|popad|popf|popfd|popfq|por|prefetchnta|prefetcht0|prefetcht1|prefetcht2|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignd|psignw|pslld|pslldq|psllq|psllw|psrad|psraw|psrld|psrldq|psrlq|psrlw|psubb|psubd|psubq|psubsb|psubsw|psubusb|psubusw|psubw|ptest|punpckhbw|punpckhdq|punpckhqdq|punpckhwd|punpcklbw|punpckldq|punpcklqdq|punpcklwd|push|pusha|pushad|pushf|pushfd|pushfq|pxor|rcl|rcpps|rcpss|rcr|rdmsr|rdpmc|rdtsc|rdtscp|rep|repe|repne|repnz|repz|ret|retf|retn|rol|ror|roundpd|roundps|roundsd|roundss|rsm|rsqrtps|rsqrtss|sahf|sal|salc|sar|sbb|scasb|scasd|scasq|scasw|set|seta|setae|setb|setbe|setc|sete|setg|setge|setl|setle|setna|setnae|setnb|setnbe|setnc|setne|setng|setnge|setnl|setnle|setno|setnp|setns|setnz|seto|setp|setpe|setpo|sets|sfence|sgdt|sha1msg1|sha1msg2|sha1nexte|sha1rnds4|sha256msg1|sha256msg2|sha256rnds2|shl|shld|shr|shrd|shufpd|shufps|sidt|skinit|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stgi|sti|stmxcsr|stosb|stosd|stosq|stosw|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|test|ucomisd|ucomiss|ud1|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|verr|verw|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfmsubss|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmsubps|vfnmsubsd|vfnmsubss|vmcall|vmclear|vmlaunch|vmload|vmmcall|vmptrld|vmptrst|vmread|vmresume|vmrun|vmsave|vmwrite|vmxoff|vmxon|wait|wbinvd|wrmsr|xadd|xbts|xchg|xlat|xor|xorpd)\\s"
}
]
},
"numbers": {
"patterns": [
{
"name": "invalid",
"match": "^\\{5}"
},
{
"name": "constant.numeric.integer.hexadecimal.asm",
"match": "[\\$#][0-9a-fA-F]+"
},
{
"name": "constant.numeric.integer.hexadecimal.asm",
"match": "(\\-?[0-9a-fA-F]+[hH])\\b"
},
{
"name": "constant.numeric.integer.hexadecimal.asm",
"match": "(\\-?0x[0-9a-fA-F]+)\\b"
},
{
"name": "constant.numeric.integer.binary.asm",
"match": "%[01]+\\b"
},
{
"name": "constant.numeric.integer.binary.asm",
"match": "\\b[01'_]+[bB]\\b"
},
{
"name": "constant.numeric.integer.decimal.asm",
"match": "\\-?\\d+"
}
]
},
"labels": {
"patterns": [
{
"match": "^\\@?((\\$\\$(?!\\.))?[\\w\\.]+)[:\\s]",
"captures": {
"1": {
"name": "entity.name.function.asm"
}
}
},
{
"match": "\\b([a-zA-Z][\\w\\.]+)\\b",
"name": "variable.parameter.label.asm"
}
]
}
},
"scopeName": "source.asm"
}