mirror of
https://github.com/MatthewCallis/language-65asm.git
synced 2024-11-22 04:33:45 +00:00
Add WDCTools support
This commit is contained in:
parent
bca192fbc7
commit
90366d7d06
@ -23,13 +23,3 @@ repository:
|
||||
name: 'keyword.mnemonic.6502.6502-opcodes'
|
||||
}
|
||||
]
|
||||
# 'M65816':
|
||||
# 'match': '\\b(?i:BRL|COP|JML|JSL|MVN|MVP|PEA|PEI|PER|PHB|PHD|PHK|PLB|PLD|REP|RTL|SEP|TCD|TCS|TDC|TSC|TXY|TYX|WDM|XBA|XCE)\\b'
|
||||
# 'name': 'keyword.mnemonic.65816'
|
||||
# 'M65816_alias':
|
||||
# 'match': '\\b(?i:BGE|BLT|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\\b'
|
||||
# 'name': 'keyword.mnemonic.65816_alias'
|
||||
# 'M65C02':
|
||||
# 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b'
|
||||
# 'name': 'keyword.mnemonic.65c02'
|
||||
# 'scopeName': 'source.assembly.6502'
|
||||
|
@ -25,4 +25,9 @@ repository:
|
||||
match: '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b'
|
||||
name: 'keyword.mnemonic.65c02.65c02-opcodes'
|
||||
}
|
||||
# additional opcodes for WDC chips
|
||||
{
|
||||
match: '\\b(?i:(BBR|BBS|RMB|SMB)[0-7])\\b'
|
||||
name: 'keyword.mnemonic.65c02.65c02-opcodes'
|
||||
}
|
||||
]
|
||||
|
@ -3,15 +3,6 @@
|
||||
scopeName: 'source.cc65-directives'
|
||||
|
||||
patterns: [
|
||||
# # The 65c02 instruction set
|
||||
# {
|
||||
# include: 'source.65c02-opcodes'
|
||||
# }
|
||||
# # Include the 6502ex op codes
|
||||
# {
|
||||
# include: 'source.6502x-opcodes'
|
||||
# }
|
||||
# The cc65 toolchain considers everything after a semicolon(;) as comment
|
||||
{
|
||||
include: '#comments'
|
||||
}
|
||||
|
122
grammars/wdc-directives.cson
Normal file
122
grammars/wdc-directives.cson
Normal file
@ -0,0 +1,122 @@
|
||||
# Syntax Highlighting for the Western Design Center toolchain directives
|
||||
|
||||
scopeName: 'source.wdc-directives'
|
||||
|
||||
patterns: [
|
||||
{
|
||||
include: '#comments'
|
||||
}
|
||||
# symbols, constants, numbers
|
||||
{
|
||||
include: '#symbols'
|
||||
}
|
||||
# directives
|
||||
{
|
||||
include: '#directives'
|
||||
}
|
||||
]
|
||||
|
||||
# Repository starts here ------------------------------------------------------
|
||||
repository:
|
||||
|
||||
# comments
|
||||
comments:
|
||||
patterns: [
|
||||
# semicolon comments
|
||||
{
|
||||
match: ';.*$'
|
||||
name: 'comment.line.semicolon.wdc-toolchain'
|
||||
}
|
||||
]
|
||||
|
||||
# symbols
|
||||
symbols:
|
||||
patterns: [
|
||||
# strings
|
||||
{
|
||||
begin: '"'
|
||||
beginCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.begin.wdc-toolchain'
|
||||
end: '"'
|
||||
endCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.end.wdc-toolchain'
|
||||
name: 'string.quoted.double.assembly.wdc-toolchain'
|
||||
}
|
||||
# absolut addressing/numbering
|
||||
{
|
||||
match: '\\#(\'.\'|[^\\s\']+)'
|
||||
name: 'constant.numeric.hex.wdc-toolchain'
|
||||
}
|
||||
# hex, prefixed with ampersand($)
|
||||
{
|
||||
match: '-?\\$[A-Fa-f0-9]+'
|
||||
name: 'constant.numeric.hex.wdc-toolchain'
|
||||
}
|
||||
# hex, suffixed with h(h)
|
||||
{
|
||||
match: '-?([0-9]+)h'
|
||||
name: 'constant.numeric.hex.wdc-toolchain'
|
||||
}
|
||||
# binary prefixed with %
|
||||
{
|
||||
match: '%[01]+'
|
||||
name: 'constant.numeric.binary.wdc-toolchain'
|
||||
}
|
||||
# binary suffixed with B
|
||||
{
|
||||
match: '[01]+(?i:b)'
|
||||
name: 'constant.numeric.binary.wdc-toolchain'
|
||||
}
|
||||
# octal and decimal
|
||||
{
|
||||
match: '\\b([0-9]+(d|o|q)?)\\b'
|
||||
name: 'constant.numeric.decimal.wdc-toolchain'
|
||||
}
|
||||
]
|
||||
|
||||
# assembler directives
|
||||
directives:
|
||||
patterns: [
|
||||
# File and Symbol control
|
||||
{
|
||||
match: '\\b(?i:append|include|insert|end(s|mod)?|exit|module|section|org|origin|equ(al)?|gequ|defl|set|var|extern(al|s)?|xref|globals?|public|xdef|message|messg|efunc|incdebug)\\b'
|
||||
name: 'support.function.pseudo.wdc-toolchain'
|
||||
}
|
||||
# Parsing control
|
||||
{
|
||||
match: '\\b(?i:case|chip|chkimmed|comment|dbreg|dpage|long[ai]|radix|spaces|llchar|bit7|mask|squote|twochar|asc(ii)?|fcc|date|da|d?byte|d(ef)?b|fcb|string|dc|d(ef)?w|fdb|l?word|dl|longw?|blk[blw]|defs|ds(a|b|l|w)?|rmb|apwdc|float|double)\\b'
|
||||
name: 'support.function.pseudo.wdc-toolchain'
|
||||
}
|
||||
# Macro control
|
||||
{
|
||||
match: '\\b(?i:macro|endm|macend|argchk|macfirst|macdelim|macexit|ifma|ifnma|rept|endr)\\b'
|
||||
name: 'support.function.pseudo.wdc-toolchain'
|
||||
}
|
||||
# Conditional control
|
||||
{
|
||||
match: '\\b(?i:end(c|if)?|cond|ifn?(false|true|z|abs|rel|def|diff|same|ext|page0)?|if(long|short)[ai]|ifmatch|else)\\b'
|
||||
name: 'keyword.control.conditional.wdc-toolchain'
|
||||
}
|
||||
# Listing control
|
||||
{
|
||||
match: '\\b(?i:pl|pw|top|heading|nam|title|s?ttl|subtitle|subttl|eject|page?|(no?)?list|(inc|asc|cond|m(ac)?|mn)list|pass1)\\b'
|
||||
name: 'support.function.pseudo.wdc-toolchain'
|
||||
}
|
||||
# Pre-defined sections
|
||||
{
|
||||
match: '\\b(?i:page0|code|(k|u)?data)\\b'
|
||||
name: 'constant.other.wdc-toolchain'
|
||||
}
|
||||
# Operators
|
||||
{
|
||||
match: '!|\\+|\\-|\\/|\\*|<<|>>|&|\\||\\^|=|<|>|\\:|\\|\\|'
|
||||
name: 'keyword.operator.wdc-toolchain'
|
||||
}
|
||||
# Operators II
|
||||
{
|
||||
match: '\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b'
|
||||
name: 'keyword.operator.wdc-toolchain'
|
||||
}
|
||||
]
|
14
grammars/wdc-toolchain.cson
Normal file
14
grammars/wdc-toolchain.cson
Normal file
@ -0,0 +1,14 @@
|
||||
# Syntax Highlighting for the Western Design Center toolchain and 6502 support
|
||||
# TODO: extra addressing modes, chip point prefix, * comments
|
||||
|
||||
scopeName: 'source.wdc-toolchain'
|
||||
name: '6502 Assembly (WDCTools)' # Name shown in Atom Editor grammar selection
|
||||
# File extensions associated with this grammar
|
||||
fileTypes: [
|
||||
's'
|
||||
]
|
||||
# include all opcodes and directives the toolchain supports
|
||||
patterns: [
|
||||
{ include: 'source.65c02-opcodes' } # the 65c02 opcodes, includes the basic 6502 instruction set
|
||||
{ include: 'source.wdc-directives' } # include the directives of the WDCxAS assemblers
|
||||
]
|
14
grammars/wdc816-toolchain.cson
Normal file
14
grammars/wdc816-toolchain.cson
Normal file
@ -0,0 +1,14 @@
|
||||
# Syntax Highlighting for the Western Design Center toolchain and 65816 support
|
||||
|
||||
scopeName: 'source.wdc816-toolchain'
|
||||
name: '65816 Assembly (WDCTools)' # Name shown in Atom Editor grammar selection
|
||||
# File extensions associated with this grammar
|
||||
fileTypes: [
|
||||
's'
|
||||
]
|
||||
# include all opcodes and directives the toolchain supports
|
||||
patterns: [
|
||||
{ include: 'source.65816-opcodes' } # the 65c02 opcodes, includes the basic 65c02 instruction set
|
||||
{ include: 'source.65816-aliases' } # Opcode aliases for the 65816
|
||||
{ include: 'source.wdc-directives' } # include the directives of the WDCxAS assemblers
|
||||
]
|
@ -1,18 +1,18 @@
|
||||
# '.source.assembly':
|
||||
# 'editor':
|
||||
# 'commentStart': ';'
|
||||
# '.source.assembly.6502.edasm':
|
||||
# 'editor':
|
||||
# 'foldEndPattern': '\\b(?i:DEND|FIN)\\b'
|
||||
# '.source.assembly.65816.mpw':
|
||||
# 'editor':
|
||||
# 'foldEndPattern': '\\b(?i:ENDF|ENDFUNC|ENDI|ENDP|ENDPROC|ENDR|ENDSTACK|ENDWITH|ENDM|ENDMACRO|MEND)\\b'
|
||||
# '.source.assembly.65816.merlin':
|
||||
# 'editor':
|
||||
# 'foldEndPattern': '\\b(?i:DEND|FIN)\\b|<<<|--\\^'
|
||||
# '.source.assembly.65816.ninjaforce':
|
||||
# 'editor':
|
||||
# 'foldEndPattern': '(\\^\\^\\^|\\<\\<\\<)'
|
||||
# '.source.assembly.65816.orcam':
|
||||
# 'editor':
|
||||
# 'foldEndPattern': '\\b(?i:END)\\b'
|
||||
'.source.assembly':
|
||||
'editor':
|
||||
'commentStart': ';'
|
||||
'.source.assembly.6502.edasm':
|
||||
'editor':
|
||||
'foldEndPattern': '\\b(?i:DEND|FIN)\\b'
|
||||
'.source.assembly.65816.mpw':
|
||||
'editor':
|
||||
'foldEndPattern': '\\b(?i:ENDF|ENDFUNC|ENDI|ENDP|ENDPROC|ENDR|ENDSTACK|ENDWITH|ENDM|ENDMACRO|MEND)\\b'
|
||||
'.source.assembly.65816.merlin':
|
||||
'editor':
|
||||
'foldEndPattern': '\\b(?i:DEND|FIN)\\b|<<<|--\\^'
|
||||
'.source.assembly.65816.ninjaforce':
|
||||
'editor':
|
||||
'foldEndPattern': '(\\^\\^\\^|\\<\\<\\<)'
|
||||
'.source.assembly.65816.orcam':
|
||||
'editor':
|
||||
'foldEndPattern': '\\b(?i:END)\\b'
|
||||
|
Loading…
Reference in New Issue
Block a user