127 lines
4.2 KiB
JSON
127 lines
4.2 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
"name": "x86/x64 Assembly",
|
|
"patterns": [
|
|
{ "include": "#comments" },
|
|
{ "include": "#strings" },
|
|
{ "include": "#constants" },
|
|
{ "include": "#registers" },
|
|
{ "include": "#instructions" },
|
|
{ "include": "#directives" },
|
|
{ "include": "#labels" },
|
|
{ "include": "#sections" },
|
|
{ "include": "#symbols" },
|
|
{ "include": "#functions" },
|
|
{ "include": "#memory_operands" }
|
|
],
|
|
"repository": {
|
|
"comments": {
|
|
"patterns": [
|
|
{
|
|
"name": "comment.line.semicolon.x86asm",
|
|
"match": ";.*$"
|
|
}
|
|
]
|
|
},
|
|
"strings": {
|
|
"name": "string.quoted.double.x86asm",
|
|
"begin": "\"",
|
|
"end": "\"",
|
|
"patterns": [
|
|
{
|
|
"name": "constant.character.escape.x86asm",
|
|
"match": "\\\\."
|
|
}
|
|
]
|
|
},
|
|
"constants": {
|
|
"patterns": [
|
|
{
|
|
"name": "constant.numeric.hex.x86asm",
|
|
"match": "\\b(0x[0-9A-Fa-f]+)\\b"
|
|
},
|
|
{
|
|
"name": "constant.numeric.decimal.x86asm",
|
|
"match": "\\b([0-9]+)\\b"
|
|
}
|
|
]
|
|
},
|
|
"registers": {
|
|
"patterns": [
|
|
{
|
|
"name": "variable.language.register.x86asm",
|
|
"match": "\\b(rax|rbx|rcx|rdx|rsi|rdi|rbp|rsp|r8|r9|r10|r11|r12|r13|r14|r15|eax|ebx|ecx|edx|esi|edi|ebp|esp|ax|bx|cx|dx|si|di|bp|sp|al|bl|cl|dl)\\b"
|
|
}
|
|
]
|
|
},
|
|
"instructions": {
|
|
"patterns": [
|
|
{
|
|
"name": "keyword.control.instruction.x86asm",
|
|
"match": "\\b(mov|push|pop|call|ret|leave|jmp|je|jne|jz|jnz|add|sub|mul|div|and|or|xor|lea|cmp|test|inc|dec|shl|shr|nop|enter)\\b"
|
|
}
|
|
]
|
|
},
|
|
"directives": {
|
|
"patterns": [
|
|
{
|
|
"name": "keyword.control.directive.x86asm",
|
|
"match": "\\.(file|intel_syntax|section|text|data|bss|rdata|rodata|globl|local|comm|lcomm|def|scl|type|size|align|ascii|asciz|byte|word|long|quad|space|equ|set|cfi_startproc|cfi_endproc|cfi_def_cfa|cfi_def_cfa_register|cfi_adjust_cfa_offset|cfi_offset|cfi_escape|cfi_restore|ident)\\b"
|
|
},
|
|
{
|
|
"name": "keyword.control.directive.option.x86asm",
|
|
"match": "\\bnoprefix\\b"
|
|
}
|
|
]
|
|
},
|
|
"labels": {
|
|
"patterns": [
|
|
{
|
|
"name": "entity.name.function.label.x86asm",
|
|
"match": "^[a-zA-Z_][a-zA-Z0-9_]*:"
|
|
},
|
|
{
|
|
"name": "entity.name.tag.label.x86asm",
|
|
"match": "^L[a-zA-Z0-9_]+:"
|
|
}
|
|
]
|
|
},
|
|
"sections": {
|
|
"patterns": [
|
|
{
|
|
"name": "entity.name.section.x86asm",
|
|
"match": "\\.(text|data|bss|rdata|rodata|comment)\\b"
|
|
}
|
|
]
|
|
},
|
|
"symbols": {
|
|
"patterns": [
|
|
{
|
|
"name": "variable.other.symbol.x86asm",
|
|
"match": "\\b__[A-Za-z0-9_]+\\b"
|
|
}
|
|
]
|
|
},
|
|
"functions": {
|
|
"patterns": [
|
|
{
|
|
"name": "support.function.x86asm",
|
|
"match": "\\b(_*[a-zA-Z_][a-zA-Z0-9_]*)\\b"
|
|
}
|
|
]
|
|
},
|
|
"memory_operands": {
|
|
"patterns": [
|
|
{
|
|
"name": "storage.type.memory.x86asm",
|
|
"match": "\\b(BYTE|WORD|DWORD|QWORD|XMMWORD|YMMWORD|ZMMWORD)\\s+PTR\\b"
|
|
},
|
|
{
|
|
"name": "storage.type.memory.x86asm",
|
|
"match": "\\b(TBYTE|TWORD|DQWORD|OWORD|FWORD)\\b"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"scopeName": "source.x86asm"
|
|
} |