DASM: Add opcodes and comments
This commit is contained in:
parent
28079336e1
commit
42530f66bc
|
@ -0,0 +1,65 @@
|
||||||
|
'fileTypes': []
|
||||||
|
'foldingStartMarker': '/\\*\\*|\\{\\s*$'
|
||||||
|
'foldingStopMarker': '\\*\\*/|^\\s*\\}'
|
||||||
|
'name': '6502 Assembly (DASM) OLD'
|
||||||
|
'patterns': [
|
||||||
|
{
|
||||||
|
'match': '\\b(adc|and|asl|bit|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|sbc|sec|sed|sei|sta|stx|sty|tax|txa|tay|tya|tsx|txs)\\b'
|
||||||
|
'name': 'keyword'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'match': '\\b(bcc|bcs|beq|bmi|bne|bpl|brk|bvc|bvs|jmp|jsr|rti|rts)\\b'
|
||||||
|
'name': 'keyword.control'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'captures':
|
||||||
|
'1':
|
||||||
|
'name': 'punctuation.definition.comment'
|
||||||
|
'match': '(;).*$\\n?'
|
||||||
|
'name': 'comment.line.semicolon'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'match': '\\b(SET|WORD|BYTE|HEX)\\b'
|
||||||
|
'name': 'storage.type'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'match': '\\b(ALIGN)\\b'
|
||||||
|
'name': 'storage.modifier'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'match': '\\b(REPEAT|REPEND|MAC|ENDM|SUBROUTINE)\\b'
|
||||||
|
'name': 'support.function'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'match': '\\b(processor|org)\\b'
|
||||||
|
'name': 'constant.language'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'begin': '"'
|
||||||
|
'end': '"'
|
||||||
|
'name': 'string.quoted.double.untitled'
|
||||||
|
'patterns': [
|
||||||
|
{
|
||||||
|
'match': '\\\\.'
|
||||||
|
'name': 'constant.character.escape.untitled'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'match': '^[A-Za-z_][A-Za-z0-9_]*'
|
||||||
|
'name': 'entity.name.label'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'match': '^\\.[A-Za-z_][A-Za-z0-9_]*'
|
||||||
|
'name': 'entity.name.label.local'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'match': '#?\\$[0-9a-fA-F]+'
|
||||||
|
'name': 'constant.numeric.hex'
|
||||||
|
}
|
||||||
|
{
|
||||||
|
'match': '{[0-9]+}'
|
||||||
|
'name': 'variable.parameter.macro'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
'scopeName': 'source.assembly.6502.dasm'
|
|
@ -1,65 +1,91 @@
|
||||||
'fileTypes': []
|
# Syntax highlighting for the DASM macro assembler
|
||||||
'foldingStartMarker': '/\\*\\*|\\{\\s*$'
|
|
||||||
'foldingStopMarker': '\\*\\*/|^\\s*\\}'
|
scopeName: 'source.assembly.6502.dasm'
|
||||||
'name': '6502 Assembly (DASM)'
|
fileTypes: []
|
||||||
'patterns': [
|
name: '6502 Assembly (DASM)'
|
||||||
{
|
patterns: [
|
||||||
'match': '\\b(adc|and|asl|bit|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|sbc|sec|sed|sei|sta|stx|sty|tax|txa|tay|tya|tsx|txs)\\b'
|
{ include: 'source.6502-opcodes' }
|
||||||
'name': 'keyword'
|
{ include: '#comments' }
|
||||||
}
|
{ include: '#symbols' }
|
||||||
{
|
# { include: '#directives' }
|
||||||
'match': '\\b(bcc|bcs|beq|bmi|bne|bpl|brk|bvc|bvs|jmp|jsr|rti|rts)\\b'
|
]
|
||||||
'name': 'keyword.control'
|
|
||||||
}
|
# Repository starts here ------------------------------------------------------
|
||||||
{
|
repository:
|
||||||
'captures':
|
|
||||||
'1':
|
# comments
|
||||||
'name': 'punctuation.definition.comment'
|
comments:
|
||||||
'match': '(;).*$\\n?'
|
patterns: [
|
||||||
'name': 'comment.line.semicolon'
|
# semicolon comments
|
||||||
}
|
|
||||||
{
|
|
||||||
'match': '\\b(SET|WORD|BYTE|HEX)\\b'
|
|
||||||
'name': 'storage.type'
|
|
||||||
}
|
|
||||||
{
|
|
||||||
'match': '\\b(ALIGN)\\b'
|
|
||||||
'name': 'storage.modifier'
|
|
||||||
}
|
|
||||||
{
|
|
||||||
'match': '\\b(REPEAT|REPEND|MAC|ENDM|SUBROUTINE)\\b'
|
|
||||||
'name': 'support.function'
|
|
||||||
}
|
|
||||||
{
|
|
||||||
'match': '\\b(processor|org)\\b'
|
|
||||||
'name': 'constant.language'
|
|
||||||
}
|
|
||||||
{
|
|
||||||
'begin': '"'
|
|
||||||
'end': '"'
|
|
||||||
'name': 'string.quoted.double.untitled'
|
|
||||||
'patterns': [
|
|
||||||
{
|
{
|
||||||
'match': '\\\\.'
|
match: ';.*$'
|
||||||
'name': 'constant.character.escape.untitled'
|
name: 'comment.line.semicolon.dasm'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
{
|
# symbols
|
||||||
'match': '^[A-Za-z_][A-Za-z0-9_]*'
|
symbols:
|
||||||
'name': 'entity.name.label'
|
patterns: [
|
||||||
}
|
# strings
|
||||||
{
|
{
|
||||||
'match': '^\\.[A-Za-z_][A-Za-z0-9_]*'
|
begin: '"'
|
||||||
'name': 'entity.name.label.local'
|
beginCaptures:
|
||||||
}
|
0:
|
||||||
{
|
name: 'punctuation.definition.string.begin.dasm'
|
||||||
'match': '#?\\$[0-9a-fA-F]+'
|
end: '"'
|
||||||
'name': 'constant.numeric.hex'
|
endCaptures:
|
||||||
}
|
0:
|
||||||
{
|
name: 'punctuation.definition.string.end.dasm'
|
||||||
'match': '{[0-9]+}'
|
name: 'string.quoted.double.dasm'
|
||||||
'name': 'variable.parameter.macro'
|
}
|
||||||
}
|
# absolut addressing/numbers
|
||||||
]
|
# {
|
||||||
'scopeName': 'source.assembly.6502.dasm'
|
# match: '\\#(\'.\'|[^\\s\']+)'
|
||||||
|
# name: 'constant.numeric.hex.dasm'
|
||||||
|
# }
|
||||||
|
# hex, prefixed with dollar sign($)
|
||||||
|
{
|
||||||
|
match: '-?#?\\$\\b[a-fA-F0-9]+\\b'
|
||||||
|
name: 'constant.numeric.hex.dasm'
|
||||||
|
}
|
||||||
|
# octal, prefixed with zero(0)
|
||||||
|
{
|
||||||
|
match: '-?#?\\b0[1-7]+\\b'
|
||||||
|
name: 'constant.numeric.octal.dasm'
|
||||||
|
}
|
||||||
|
# binary
|
||||||
|
{
|
||||||
|
match: '#?%[01]+'
|
||||||
|
name: 'constant.numeric.binary.65816-generic'
|
||||||
|
}
|
||||||
|
# decimal
|
||||||
|
{
|
||||||
|
match: '#?\\b([0-9]+)\\b'
|
||||||
|
name: 'constant.numeric.decimal.65816-generic'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
# directives
|
||||||
|
directives:
|
||||||
|
patterns: [
|
||||||
|
# file and symbol control
|
||||||
|
{
|
||||||
|
match: '\\b(?i:seg(\\.u)?|include|incbin|incdir|hex|err|r?org|processor|echo|rend|align|subroutine|)\\b'
|
||||||
|
name: 'support.function.pseudo.dasm'
|
||||||
|
}
|
||||||
|
# data control
|
||||||
|
# {
|
||||||
|
# match: '\\b(?i:d[csv](.bwl)?|hex|eq[um]|set|list\\s(on|off))\\b'
|
||||||
|
# name: 'support.function.pseudo.dasm'
|
||||||
|
# }
|
||||||
|
# Macro control
|
||||||
|
# {
|
||||||
|
# match: '\\b(?i:mac|endm|mexit)\\b'
|
||||||
|
# name: 'support.function.pseudo.acme'
|
||||||
|
# }
|
||||||
|
# Conditional control
|
||||||
|
# {
|
||||||
|
# match: '\\b(?i:ifn?const|if|else|e(nd)?if|repeat|repend)\\b'
|
||||||
|
# name: 'keyword.control.conditional.acme'
|
||||||
|
# }
|
||||||
|
]
|
||||||
|
|
|
@ -35,16 +35,16 @@ repository:
|
||||||
endCaptures:
|
endCaptures:
|
||||||
0:
|
0:
|
||||||
name: 'punctuation.definition.string.end.65816-generic'
|
name: 'punctuation.definition.string.end.65816-generic'
|
||||||
name: 'string.quoted.double.assembly.65816-generic'
|
name: 'string.quoted.double.65816-generic'
|
||||||
}
|
}
|
||||||
# absolut address/number
|
# absolut address/number
|
||||||
{
|
{
|
||||||
match: '\\#(\'.\'|[^\\s\']+)'
|
match: '\\#(\'.\'|[^\\s\']+)'
|
||||||
name: 'constant.numeric.hex.65816-generic'
|
name: 'constant.numeric.hex.65816-generic'
|
||||||
}
|
}
|
||||||
# hex, prefixed with ampersand($)
|
# hex, prefixed with dollar sign($)
|
||||||
{
|
{
|
||||||
match: '-?\\$[A-Fa-f0-9]+'
|
match: '-?\\$\\b[a-fA-F0-9]+\\b'
|
||||||
name: 'constant.numeric.hex.65816-generic'
|
name: 'constant.numeric.hex.65816-generic'
|
||||||
}
|
}
|
||||||
# hex, suffixed with h(h)
|
# hex, suffixed with h(h)
|
||||||
|
|
|
@ -35,7 +35,7 @@ repository:
|
||||||
endCaptures:
|
endCaptures:
|
||||||
0:
|
0:
|
||||||
name: 'punctuation.definition.string.end.65c02-generic'
|
name: 'punctuation.definition.string.end.65c02-generic'
|
||||||
name: 'string.quoted.double.assembly.65c02-generic'
|
name: 'string.quoted.double.65c02-generic'
|
||||||
}
|
}
|
||||||
# absolut address/number
|
# absolut address/number
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ repository:
|
||||||
}
|
}
|
||||||
# hex, prefixed with ampersand($)
|
# hex, prefixed with ampersand($)
|
||||||
{
|
{
|
||||||
match: '-?\\$[A-Fa-f0-9]+'
|
match: '-?\\$\\b[A-Fa-f0-9]+\\b'
|
||||||
name: 'constant.numeric.hex.65c02-generic'
|
name: 'constant.numeric.hex.65c02-generic'
|
||||||
}
|
}
|
||||||
# hex, suffixed with h(h)
|
# hex, suffixed with h(h)
|
||||||
|
|
|
@ -43,7 +43,7 @@ repository:
|
||||||
endCaptures:
|
endCaptures:
|
||||||
0:
|
0:
|
||||||
name: 'punctuation.definition.string.end.acme'
|
name: 'punctuation.definition.string.end.acme'
|
||||||
name: 'string.quoted.double.assembly.acme'
|
name: 'string.quoted.double.acme'
|
||||||
}
|
}
|
||||||
# absolut addressing/numbering
|
# absolut addressing/numbering
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@ repository:
|
||||||
endCaptures:
|
endCaptures:
|
||||||
0:
|
0:
|
||||||
name: 'punctuation.definition.string.end.cc65-directives'
|
name: 'punctuation.definition.string.end.cc65-directives'
|
||||||
name: 'string.quoted.double.assembly.cc65-directives'
|
name: 'string.quoted.double.cc65-directives'
|
||||||
}
|
}
|
||||||
# absolut addressing/numbers
|
# absolut addressing/numbers
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ repository:
|
||||||
}
|
}
|
||||||
# hex, prefixed with dollar sign($)
|
# hex, prefixed with dollar sign($)
|
||||||
{
|
{
|
||||||
match: '-?\\$[a-fA-F0-9]+'
|
match: '-?\\$\\b[a-fA-F0-9]+\\b'
|
||||||
name: 'constant.numeric.hex.cc65-directives'
|
name: 'constant.numeric.hex.cc65-directives'
|
||||||
}
|
}
|
||||||
# hex, suffixed with h(h)
|
# hex, suffixed with h(h)
|
||||||
|
|
|
@ -34,7 +34,7 @@ repository:
|
||||||
endCaptures:
|
endCaptures:
|
||||||
0:
|
0:
|
||||||
name: 'punctuation.definition.string.end.wdc-toolchain'
|
name: 'punctuation.definition.string.end.wdc-toolchain'
|
||||||
name: 'string.quoted.double.assembly.wdc-toolchain'
|
name: 'string.quoted.double.wdc-toolchain'
|
||||||
}
|
}
|
||||||
# absolut addressing/numbers
|
# absolut addressing/numbers
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ repository:
|
||||||
}
|
}
|
||||||
# hex, prefixed with dollar sign($)
|
# hex, prefixed with dollar sign($)
|
||||||
{
|
{
|
||||||
match: '-?\\$\\b[a-fA-F0-9]+'
|
match: '-?\\$\\b[a-fA-F0-9]+\\b'
|
||||||
name: 'constant.numeric.hex.wdc-toolchain'
|
name: 'constant.numeric.hex.wdc-toolchain'
|
||||||
}
|
}
|
||||||
# hex, suffixed with h(h)
|
# hex, suffixed with h(h)
|
||||||
|
|
Loading…
Reference in New Issue