mirror of
https://github.com/MatthewCallis/language-65asm.git
synced 2025-07-03 22:23:55 +00:00
Compare commits
40 Commits
Author | SHA1 | Date | |
---|---|---|---|
cc5dcdf07f | |||
8f33699598 | |||
6c2e99a2df | |||
ebf3af2037 | |||
f2a593e26d | |||
8f9dc0f832 | |||
f647fd3549 | |||
c585064459 | |||
356800f90e | |||
bbc826f2cd | |||
cf574c0d54 | |||
f89a766cbc | |||
21e2bae3e4 | |||
0779d70727 | |||
05941820ac | |||
1d8e0eb31b | |||
9de1d270a6 | |||
ffc9bef8f8 | |||
90366d7d06 | |||
4182828612 | |||
bca192fbc7 | |||
6de1c1dfed | |||
376a1e0f55 | |||
475c022a2e | |||
35207500a3 | |||
716661cf9c | |||
4dec149088 | |||
944fefa6b3 | |||
69e572ec9c | |||
db04e4f13b | |||
80c13409ea | |||
13f4c11d05 | |||
d98637d01c | |||
f1bce28b1d | |||
77ae562e5e | |||
bba978ab41 | |||
c02de139a1 | |||
5a713ff273 | |||
0e34ad549b | |||
01dccbb45c |
39
README.md
39
README.md
@ -2,14 +2,16 @@
|
||||
|
||||
Adds syntax highlighting to 65816/65C816/65802/6502/65C02 files in Atom, with extra support for various compilers:
|
||||
|
||||
- [cc65](http://oliverschmidt.github.io/cc65/)
|
||||
- [ACME Crossassembler](https://sourceforge.net/projects/acme-crossass/)
|
||||
- [cc65 (SNES Syntax: 65816, SPC700, SuperFX)](http://oliverschmidt.github.io/cc65/)
|
||||
- [DASM](http://dasm-dillon.sourceforge.net/) (6502)
|
||||
- EDASM
|
||||
- [EDASM](https://archive.org/details/EDASM-ProDOS_Assembler_Tools_Manual)
|
||||
- [Merlin](http://en.wikipedia.org/wiki/Merlin_(assembler))
|
||||
- [MPW IIgs Assembler](http://store.16sector.com/index.php?main_page=product_info&products_id=24)
|
||||
- [NinjaForce Assembler](http://www.ninjaforce.com/html/products_nf_assembler.html)
|
||||
- [ORCA/M](http://www.byteworks.us/Byte_Works/Products.html)
|
||||
- [WLA-DX](http://www.villehelin.com/wla.html)
|
||||
- [WTCTools by Western Design Center](http://westerndesigncenter.com/wdc/tools.cfm)
|
||||
|
||||
Originally [converted](http://atom.io/docs/latest/converting-a-text-mate-bundle)
|
||||
from the various other TextMate bundles:
|
||||
@ -19,3 +21,36 @@ from the various other TextMate bundles:
|
||||
|
||||
Contributions are greatly appreciated! Please fork this repository and open a
|
||||
pull request to add snippets, make grammar tweaks, etc.
|
||||
|
||||
# Installation
|
||||
|
||||
In atom, press `ctrl+shift+p` and enter `install package`, then type `language-65asm` into the search bar and hit install.
|
||||
|
||||
#### OR
|
||||
|
||||
Run `apm install language-65asm` in a terminal.
|
||||
|
||||
To add automatic syntax highlighting to a set of file extensions, add this to your
|
||||
config.cson (`ctrl+shift+p` -> config):
|
||||
|
||||
```
|
||||
"*":
|
||||
core:
|
||||
customFileTypes: {
|
||||
"source.assembly.6502.cc65": [
|
||||
"asm"
|
||||
"inc"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
See last line in grammar files for names.
|
||||
|
||||
# Contributors
|
||||
|
||||
- [Matthew Callis](https://github.com/MatthewCallis)
|
||||
- [Matt Tuttle](https://github.com/MattTuttle)
|
||||
- [Tommy Savaria](https://github.com/NewLunarFire)
|
||||
- [ARM9](https://github.com/ARM9)
|
||||
- [georgjz](https://github.com/georgjz)
|
||||
- [GoDot](http://www.godot64.de/)
|
||||
|
25
grammars/6502-opcodes.cson
Normal file
25
grammars/6502-opcodes.cson
Normal file
@ -0,0 +1,25 @@
|
||||
# Syntax Highlighting for the basic instruction set of the 6502 microprocessor.
|
||||
# This file only contains rules for 6502 mnemonics. The rules here are used by
|
||||
# other grammars only that add rules for comments, symbols, etc.
|
||||
|
||||
scopeName: 'source.6502-opcodes'
|
||||
|
||||
patterns: [
|
||||
# The basic 6502 instruction set
|
||||
{
|
||||
include: '#mnemonics-6502'
|
||||
}
|
||||
]
|
||||
|
||||
# Respository starts here -----------------------------------------------------
|
||||
repository:
|
||||
|
||||
# basic 6502 instruction set
|
||||
'mnemonics-6502':
|
||||
patterns: [
|
||||
# mnemonics
|
||||
{
|
||||
match: '\\b(?i:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\\b'
|
||||
name: 'keyword.mnemonic.6502.6502-opcodes'
|
||||
}
|
||||
]
|
@ -1,248 +0,0 @@
|
||||
'fileTypes': [
|
||||
'clj'
|
||||
'cljs'
|
||||
'clojure'
|
||||
'edn'
|
||||
]
|
||||
'foldingStartMarker': '\\(\\s*$'
|
||||
'foldingStopMarker': '^\\s*\\)'
|
||||
'name': 'Clojure'
|
||||
'patterns': [
|
||||
{
|
||||
'include': '#comment'
|
||||
}
|
||||
{
|
||||
'include': '#shebang-comment'
|
||||
}
|
||||
{
|
||||
'include': '#quoted-sexp'
|
||||
}
|
||||
{
|
||||
'include': '#sexp'
|
||||
}
|
||||
{
|
||||
'include': '#keyfn'
|
||||
}
|
||||
{
|
||||
'include': '#string'
|
||||
}
|
||||
{
|
||||
'include': '#vector'
|
||||
}
|
||||
{
|
||||
'include': '#set'
|
||||
}
|
||||
{
|
||||
'include': '#map'
|
||||
}
|
||||
{
|
||||
'include': '#regexp'
|
||||
}
|
||||
{
|
||||
'include': '#var'
|
||||
}
|
||||
{
|
||||
'include': '#constants'
|
||||
}
|
||||
{
|
||||
'include': '#symbol'
|
||||
}
|
||||
{
|
||||
'include': '#whitespace'
|
||||
}
|
||||
]
|
||||
'repository':
|
||||
'comment':
|
||||
'captures':
|
||||
'1':
|
||||
'name': 'punctuation.definition.comment.clojure'
|
||||
'match': '(;).*$\\n?'
|
||||
'name': 'comment.line.semicolon.clojure'
|
||||
'constants':
|
||||
'patterns': [
|
||||
{
|
||||
'match': '(nil)(?=(\\s|\\)|\\]|\\}))'
|
||||
'name': 'constant.language.nil.clojure'
|
||||
}
|
||||
{
|
||||
'match': '(true|false)'
|
||||
'name': 'constant.language.boolean.clojure'
|
||||
}
|
||||
{
|
||||
'match': '(\\d+/\\d+)'
|
||||
'name': 'constant.numeric.ratio.clojure'
|
||||
}
|
||||
{
|
||||
'match': '(\\d+r\\d+)'
|
||||
'name': 'constant.numeric.arbitrary-radix.clojure'
|
||||
}
|
||||
{
|
||||
'match': '(0x\\d+)'
|
||||
'name': 'constant.numeric.hexidecimal.clojure'
|
||||
}
|
||||
{
|
||||
'match': '(0\\d+)'
|
||||
'name': 'constant.numeric.octal.clojure'
|
||||
}
|
||||
{
|
||||
'match': '(\\d+)'
|
||||
'name': 'constant.numeric.decimal.clojure'
|
||||
}
|
||||
{
|
||||
'match': '(?<=(\\s|\\(|\\[|\\{)):[a-zA-Z0-9\\#\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))'
|
||||
'name': 'constant.keyword.clojure'
|
||||
}
|
||||
]
|
||||
'keyfn':
|
||||
'patterns': [
|
||||
{
|
||||
'match': '(?<=(\\s|\\(|\\[|\\{))(if(-[-a-z\\?]*)?|when(-[-a-z]*)?|for(-[-a-z]*)?|cond|do|let(-[-a-z\\?]*)?|binding|loop|recur|fn|throw[a-z\\-]*|try|catch|finally|([a-z]*case))(?=(\\s|\\)|\\]|\\}))'
|
||||
'name': 'storage.control.clojure'
|
||||
}
|
||||
{
|
||||
'match': '(?<=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[a-z\\-]*))(?=(\\s|\\)|\\]|\\}))'
|
||||
'name': 'keyword.control.clojure'
|
||||
}
|
||||
]
|
||||
'map':
|
||||
'begin': '(\\{)'
|
||||
'end': '(\\})'
|
||||
'name': 'meta.map.clojure'
|
||||
'patterns': [
|
||||
{
|
||||
'include': '$self'
|
||||
}
|
||||
]
|
||||
'quoted-sexp':
|
||||
'begin': '([\'``]\\()'
|
||||
'beginCaptures':
|
||||
'1':
|
||||
'name': 'punctuation.section.expression.begin.clojure'
|
||||
'end': '(\\))(\\n)?'
|
||||
'endCaptures':
|
||||
'1':
|
||||
'name': 'punctuation.section.expression.end.clojure'
|
||||
'2':
|
||||
'name': 'meta.after-expression.clojure'
|
||||
'name': 'meta.quoted-expression.clojure'
|
||||
'patterns': [
|
||||
{
|
||||
'include': '$self'
|
||||
}
|
||||
]
|
||||
'regexp':
|
||||
'begin': '#\\"'
|
||||
'end': '\\"'
|
||||
'name': 'string.regexp.clojure'
|
||||
'patterns': [
|
||||
{
|
||||
'include': '#regexp_escaped_char'
|
||||
}
|
||||
]
|
||||
'regexp_escaped_char':
|
||||
'match': '\\\\(\\")'
|
||||
'name': 'string.regexp.clojure'
|
||||
'set':
|
||||
'begin': '(\\#\\{)'
|
||||
'end': '(\\})'
|
||||
'name': 'meta.set.clojure'
|
||||
'patterns': [
|
||||
{
|
||||
'include': '$self'
|
||||
}
|
||||
]
|
||||
'sexp':
|
||||
'begin': '(\\()'
|
||||
'beginCaptures':
|
||||
'1':
|
||||
'name': 'punctuation.section.expression.begin.clojure'
|
||||
'end': '(\\))(\\n)?'
|
||||
'endCaptures':
|
||||
'1':
|
||||
'name': 'punctuation.section.expression.end.clojure'
|
||||
'2':
|
||||
'name': 'meta.after-expression.clojure'
|
||||
'name': 'meta.expression.clojure'
|
||||
'patterns': [
|
||||
{
|
||||
'begin': '(?<=\\()(ns|def|def-|defn|defn-|defvar|defvar-|defmacro|defmacro-|deftest)\\s+(.+?)(?=\\s)'
|
||||
'beginCaptures':
|
||||
'1':
|
||||
'name': 'keyword.control.clojure'
|
||||
'2':
|
||||
'name': 'entity.global.clojure'
|
||||
'end': '(?=\\))'
|
||||
'name': 'meta.definition.global.clojure'
|
||||
'patterns': [
|
||||
{
|
||||
'include': '$self'
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
'include': '$self'
|
||||
}
|
||||
]
|
||||
'shebang-comment':
|
||||
'captures':
|
||||
'1':
|
||||
'name': 'punctuation.definition.comment.shebang.clojure'
|
||||
'match': '^(\\#!).*$\\n?'
|
||||
'name': 'comment.line.semicolon.clojure'
|
||||
'string':
|
||||
'begin': '(")'
|
||||
'beginCaptures':
|
||||
'1':
|
||||
'name': 'punctuation.definition.string.begin.clojure'
|
||||
'end': '(")'
|
||||
'endCaptures':
|
||||
'1':
|
||||
'name': 'punctuation.definition.string.end.clojure'
|
||||
'name': 'string.quoted.double.clojure'
|
||||
'patterns': [
|
||||
{
|
||||
'match': '\\\\.'
|
||||
'name': 'constant.character.escape.clojure'
|
||||
}
|
||||
]
|
||||
'symbol':
|
||||
'patterns': [
|
||||
{
|
||||
'match': '(\\w[\\w\\d]+)'
|
||||
'name': 'meta.symbol.clojure'
|
||||
}
|
||||
]
|
||||
'var':
|
||||
'match': '(?<=(\\s|\\(|\\[|\\{)\\#)\'[a-zA-Z0-9\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))'
|
||||
'name': 'meta.var.clojure'
|
||||
'vector':
|
||||
'begin': '(\\[)'
|
||||
'end': '(\\])'
|
||||
'name': 'meta.vector.clojure'
|
||||
'patterns': [
|
||||
{
|
||||
'include': '$self'
|
||||
}
|
||||
]
|
||||
'whitespace':
|
||||
'match': '\\s+$'
|
||||
'name': 'invalid.trailing-whitespace'
|
||||
'scopeName': 'source.clojure'
|
||||
'smartTypingPairs': [
|
||||
[
|
||||
'"'
|
||||
'"'
|
||||
]
|
||||
[
|
||||
'('
|
||||
')'
|
||||
]
|
||||
[
|
||||
'{'
|
||||
'}'
|
||||
]
|
||||
[
|
||||
'['
|
||||
']'
|
||||
]
|
||||
]
|
24
grammars/6502x-opcodes.cson
Normal file
24
grammars/6502x-opcodes.cson
Normal file
@ -0,0 +1,24 @@
|
||||
# Adds the pseudo codes known as 6502X to the basic 6502 instruction set
|
||||
# NOTE: look for extra opcodes: jam
|
||||
|
||||
scopeName: 'source.6502x-opcodes'
|
||||
|
||||
patterns: [
|
||||
# The 6502 pseudo opcodes known as 6502X
|
||||
{
|
||||
include: '#mnemonics-6502x'
|
||||
}
|
||||
]
|
||||
|
||||
# Respository starts here -----------------------------------------------------
|
||||
repository:
|
||||
|
||||
# 6502x pseudo opcodes
|
||||
'mnemonics-6502x':
|
||||
patterns: [
|
||||
# mnemonics
|
||||
{
|
||||
match: '\\b(?i:ALR|ANC|ARR|AXS|DCP|ISC|LAS|LAX|RLA|RRA|SAX|SLO|SRE)\\b'
|
||||
name: 'keyword.mnemonic.6502x.6502x-opcodes'
|
||||
}
|
||||
]
|
@ -1,42 +0,0 @@
|
||||
'fileTypes': []
|
||||
'name': '65816 Assembly'
|
||||
'patterns': [
|
||||
{
|
||||
'include': '#M6502'
|
||||
}
|
||||
{
|
||||
'include': '#M65C02'
|
||||
}
|
||||
{
|
||||
'include': '#M65816L'
|
||||
}
|
||||
{
|
||||
'include': '#M65816'
|
||||
}
|
||||
]
|
||||
'repository':
|
||||
'M6502':
|
||||
'match': '\\b(?i:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\\b'
|
||||
'name': 'keyword.mnemonic.6502'
|
||||
'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'
|
||||
'M65816L':
|
||||
'match': '\\b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\\b'
|
||||
'name': 'keyword.mnemonic.65816.long'
|
||||
'M65C02':
|
||||
'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b'
|
||||
'name': 'keyword.mnemonic.65c02'
|
||||
'binary_number':
|
||||
'match': '%[01]+'
|
||||
'name': 'constant.numeric.binary'
|
||||
'decimal_number':
|
||||
'match': '\\b([0-9]+)\\b'
|
||||
'name': 'constant.numeric.decimal'
|
||||
'hex_number':
|
||||
'match': '\\$[A-Fa-f0-9]+'
|
||||
'name': 'constant.numeric.hex'
|
||||
'octal_number':
|
||||
'match': '@([0-7]+)\\b'
|
||||
'name': 'constant.numeric.octal'
|
||||
'scopeName': 'source.assembly.65816'
|
23
grammars/65816-aliases.cson
Normal file
23
grammars/65816-aliases.cson
Normal file
@ -0,0 +1,23 @@
|
||||
# Aliases for certain opcodes used by many assemblers
|
||||
|
||||
scopeName: 'source.65816-aliases'
|
||||
|
||||
patterns: [
|
||||
# The 65816 instruction set aliases
|
||||
{
|
||||
include: '#mnemonics-65816-aliases'
|
||||
}
|
||||
]
|
||||
|
||||
# Respository starts here -----------------------------------------------------
|
||||
repository:
|
||||
|
||||
# 65816 instruction set aliases
|
||||
'mnemonics-65816-aliases':
|
||||
patterns: [
|
||||
# mnemonics
|
||||
{
|
||||
match: '\\b(?i:BGE|BLT|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\\b'
|
||||
name: 'keyword.mnemonic.65816.65816-aliases'
|
||||
}
|
||||
]
|
65
grammars/65816-generic.cson
Normal file
65
grammars/65816-generic.cson
Normal file
@ -0,0 +1,65 @@
|
||||
# Generic 65816 grammar with semicolon comments
|
||||
|
||||
scopeName: 'source.assembly.65816.65816-generic'
|
||||
fileTypes: []
|
||||
name: '65816 Assembly'
|
||||
patterns: [
|
||||
{ include: 'source.65816-opcodes' } # add basic 65816 instruction set, includes 6502 and 65c02 opcodes
|
||||
{ include: 'source.65816l-opcodes' } # extend with 6502X opcodes
|
||||
{ include: '#comments' }
|
||||
{ include: '#symbols' }
|
||||
]
|
||||
|
||||
# Repository starts here ------------------------------------------------------
|
||||
repository:
|
||||
|
||||
# comments
|
||||
comments:
|
||||
patterns: [
|
||||
# semicolon comments
|
||||
{
|
||||
match: ';.*$'
|
||||
name: 'comment.line.semicolon.65816-generic'
|
||||
}
|
||||
]
|
||||
|
||||
# symbols
|
||||
symbols:
|
||||
patterns: [
|
||||
{
|
||||
begin: '"'
|
||||
beginCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.begin.65816-generic'
|
||||
end: '"'
|
||||
endCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.end.65816-generic'
|
||||
name: 'string.quoted.double.assembly.65816-generic'
|
||||
}
|
||||
# absolut address/number
|
||||
{
|
||||
match: '\\#(\'.\'|[^\\s\']+)'
|
||||
name: 'constant.numeric.hex.65816-generic'
|
||||
}
|
||||
# hex, prefixed with ampersand($)
|
||||
{
|
||||
match: '-?\\$[A-Fa-f0-9]+'
|
||||
name: 'constant.numeric.hex.65816-generic'
|
||||
}
|
||||
# hex, suffixed with h(h)
|
||||
{
|
||||
match: '-?([0-9]+)h'
|
||||
name: 'constant.numeric.hex.65816-generic'
|
||||
}
|
||||
# binary
|
||||
{
|
||||
match: '%[01]+'
|
||||
name: 'constant.numeric.binary.65816-generic'
|
||||
}
|
||||
# decimal
|
||||
{
|
||||
match: '\\b([0-9]+)\\b'
|
||||
name: 'constant.numeric.decimal.65816-generic'
|
||||
}
|
||||
]
|
27
grammars/65816-opcodes.cson
Normal file
27
grammars/65816-opcodes.cson
Normal file
@ -0,0 +1,27 @@
|
||||
# Extends the basic 6502 instruction set with the basic 65816 instruction set
|
||||
|
||||
scopeName: 'source.65816-opcodes'
|
||||
|
||||
patterns: [
|
||||
# The 65c02 instruction set
|
||||
{
|
||||
include: 'source.65c02-opcodes'
|
||||
}
|
||||
# The 65816 instruction set
|
||||
{
|
||||
include: '#mnemonics-65816'
|
||||
}
|
||||
]
|
||||
|
||||
# Respository starts here -----------------------------------------------------
|
||||
repository:
|
||||
|
||||
# 65816 instruction set
|
||||
'mnemonics-65816':
|
||||
patterns: [
|
||||
# mnemonics
|
||||
{
|
||||
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.65816-opcodes'
|
||||
}
|
||||
]
|
23
grammars/65816l-opcodes.cson
Normal file
23
grammars/65816l-opcodes.cson
Normal file
@ -0,0 +1,23 @@
|
||||
# Pseudo opcodes for the 65816 used by some assemblers
|
||||
|
||||
scopeName: 'source.65816l-opcodes'
|
||||
|
||||
patterns: [
|
||||
# The 65816 instruction set
|
||||
{
|
||||
include: '#mnemonics-65816l'
|
||||
}
|
||||
]
|
||||
|
||||
# Respository starts here -----------------------------------------------------
|
||||
repository:
|
||||
|
||||
# 65816 instruction set
|
||||
'mnemonics-65816l':
|
||||
patterns: [
|
||||
# mnemonics
|
||||
{
|
||||
match: '\\b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\\b'
|
||||
name: 'keyword.mnemonic.65816.65816l-opcodes'
|
||||
}
|
||||
]
|
65
grammars/65c02-generic.cson
Normal file
65
grammars/65c02-generic.cson
Normal file
@ -0,0 +1,65 @@
|
||||
# Generic 65C02 grammar with semicolon comments
|
||||
|
||||
scopeName: 'source.assembly.6502.65c02-generic'
|
||||
fileTypes: []
|
||||
name: '6502 Assembly'
|
||||
patterns: [
|
||||
{ include: 'source.65c02-opcodes' } # add basic 65816 instruction set, includes 6502 and 65c02 opcodes
|
||||
{ include: 'source.6502x-opcodes' }
|
||||
{ include: '#comments' }
|
||||
{ include: '#symbols' }
|
||||
]
|
||||
|
||||
# Repository starts here ------------------------------------------------------
|
||||
repository:
|
||||
|
||||
# comments
|
||||
comments:
|
||||
patterns: [
|
||||
# semicolon comments
|
||||
{
|
||||
match: ';.*$'
|
||||
name: 'comment.line.semicolon.65c02-generic'
|
||||
}
|
||||
]
|
||||
|
||||
# symbols
|
||||
symbols:
|
||||
patterns: [
|
||||
{
|
||||
begin: '"'
|
||||
beginCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.begin.65c02-generic'
|
||||
end: '"'
|
||||
endCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.end.65c02-generic'
|
||||
name: 'string.quoted.double.assembly.65c02-generic'
|
||||
}
|
||||
# absolut address/number
|
||||
{
|
||||
match: '\\#(\'.\'|[^\\s\']+)'
|
||||
name: 'constant.numeric.hex.65c02-generic'
|
||||
}
|
||||
# hex, prefixed with ampersand($)
|
||||
{
|
||||
match: '-?\\$[A-Fa-f0-9]+'
|
||||
name: 'constant.numeric.hex.65c02-generic'
|
||||
}
|
||||
# hex, suffixed with h(h)
|
||||
{
|
||||
match: '-?([0-9]+)h'
|
||||
name: 'constant.numeric.hex.65c02-generic'
|
||||
}
|
||||
# binary
|
||||
{
|
||||
match: '%[01]+'
|
||||
name: 'constant.numeric.binary.65c02-generic'
|
||||
}
|
||||
# decimal
|
||||
{
|
||||
match: '\\b([0-9]+)\\b'
|
||||
name: 'constant.numeric.decimal.65c02-generic'
|
||||
}
|
||||
]
|
33
grammars/65c02-opcodes.cson
Normal file
33
grammars/65c02-opcodes.cson
Normal file
@ -0,0 +1,33 @@
|
||||
# Extends the basic 6502 instruction set with the 65c02 opcodes
|
||||
# NOTE: rmb, bbr, smb, bbs not supported
|
||||
|
||||
scopeName: 'source.65c02-opcodes'
|
||||
|
||||
patterns: [
|
||||
# The basic 6502 instruction set
|
||||
{
|
||||
include: 'source.6502-opcodes'
|
||||
}
|
||||
# The added 65c02 opcodes
|
||||
{
|
||||
include: '#mnemonics-65c02'
|
||||
}
|
||||
]
|
||||
|
||||
# Respository starts here -----------------------------------------------------
|
||||
repository:
|
||||
|
||||
# 65c02 instruction set extension
|
||||
'mnemonics-65c02':
|
||||
patterns: [
|
||||
# mnemonics
|
||||
{
|
||||
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'
|
||||
}
|
||||
]
|
@ -1,14 +1,9 @@
|
||||
'fileTypes': []
|
||||
'foldingStartMarker': '/\\*\\*|\\{\\s*$'
|
||||
'foldingStopMarker': '\\*\\*/|^\\s*\\}'
|
||||
'name': '6502 Assembly (cc65)'
|
||||
'name': 'SNES Assembly (cc65)'
|
||||
'patterns': [
|
||||
{
|
||||
'include': '#M6502'
|
||||
}
|
||||
{
|
||||
'include': '#M6502X'
|
||||
}
|
||||
{
|
||||
'include': '#M65C02'
|
||||
}
|
||||
@ -19,21 +14,27 @@
|
||||
'include': '#M65816_alias'
|
||||
}
|
||||
{
|
||||
'begin': '(;)'
|
||||
'beginCaptures':
|
||||
'1':
|
||||
'name': 'punctuation.definition.comment'
|
||||
'end': '\\n'
|
||||
'include': '#MSuperFX'
|
||||
}
|
||||
{
|
||||
'include': '#MSPC700'
|
||||
}
|
||||
{
|
||||
'match': ';.*$'
|
||||
'name': 'comment.line.semicolon'
|
||||
}
|
||||
{
|
||||
'match': '\\b(?i:R0|R1|R2|R3|R4|R5|R6|R7|R8|R9|R10|R11|R12|R13|R14|R15|SP|LR|PC)\\b'
|
||||
'name': 'support.function.pseudo'
|
||||
}
|
||||
{
|
||||
'begin': '"'
|
||||
'beginCaptures':
|
||||
'0':
|
||||
'1':
|
||||
'name': 'punctuation.definition.string.begin'
|
||||
'end': '"'
|
||||
'endCaptures':
|
||||
'0':
|
||||
'1':
|
||||
'name': 'punctuation.definition.string.end'
|
||||
'name': 'string.quoted.double.assembly'
|
||||
}
|
||||
@ -42,7 +43,7 @@
|
||||
'name': 'constant.numeric.hex'
|
||||
}
|
||||
{
|
||||
'match': '\\b([0-9]+)h\\b'
|
||||
'match': '\\b[0-9][0-9a-fA-f]*h\\b'
|
||||
'name': 'constant.numeric.hex'
|
||||
}
|
||||
{
|
||||
@ -50,15 +51,15 @@
|
||||
'name': 'constant.numeric.binary'
|
||||
}
|
||||
{
|
||||
'match': '\\b([0-9]+)\\b'
|
||||
'match': '\\b[0-9]+\\b'
|
||||
'name': 'constant.numeric.decimal'
|
||||
}
|
||||
{
|
||||
'match': '^[A-Za-z_][A-Za-z0-9_]:*'
|
||||
'match': '\\b[A-Za-z_][A-Za-z0-9_]*\\b'
|
||||
'name': 'variable.other.readwrite.assembly' # 'entity.name.label'
|
||||
}
|
||||
{
|
||||
'match': '^@[A-Za-z_][A-Za-z0-9_]*'
|
||||
'match': '@[A-Za-z_][A-Za-z0-9_]*\\b'
|
||||
'name': 'variable.other.readwrite.instance.assembly' # 'entity.name.label.local'
|
||||
}
|
||||
{
|
||||
@ -78,7 +79,7 @@
|
||||
'name': 'keyword.operator.assembly.cc65' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc5.5
|
||||
}
|
||||
{
|
||||
'match': '(\\.)\\b(?i:and|bankbyte|bitand|bitnot|bitor|bitxor|hibyte|lobyte|mod|not|or|shl|shr|xor)\\b'
|
||||
'match': '(\\.)\\b(?i:and|bankbyte|bitand|bitnot|bitor|bitxor|mod|not|or|shl|shr|xor)\\b'
|
||||
'name': 'keyword.operator.assembly.cc65' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc5.5
|
||||
}
|
||||
]
|
||||
@ -86,9 +87,6 @@
|
||||
'M6502':
|
||||
'match': '\\b(?i:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\\b'
|
||||
'name': 'keyword.mnemonic.6502'
|
||||
'M6502X':
|
||||
'match': '\\b(?i:ALR|ANC|ARR|AXS|DCP|ISC|LAS|LAX|RLA|RRA|SAX|SLO|SRE)\\b'
|
||||
'name': 'keyword.mnemonic.6502x'
|
||||
'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'
|
||||
@ -98,4 +96,10 @@
|
||||
'M65C02':
|
||||
'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b'
|
||||
'name': 'keyword.mnemonic.65c02'
|
||||
'scopeName': 'source.assembly.6502.cc65'
|
||||
'MSuperFX':
|
||||
'match': '\\b(?i:ADD|ADC|ALT1|ALT2|ALT3|AND|ASR|BCC|BCS|BEQ|BGE|BIC|BLT|BMI|BNE|BPL|BRA|BVC|BVS|CACHE|CMODE|CMP|COLOR|DEC|DIV2|FMULT|FROM|GETB|GETBH|GETBL|GETBS|GETC|HIB|IBT|INC|IWT|JAL|JMP|LDB|LDW|LEA|LINK|LJMP|LM|LMS|LMULT|LOB|LOOP|LSR|MERGE|MOVE|MOVEB|MOVES|MOVEW|MULT|NOP|NOT|OR|PLOT|POP|PUSH|RAMB|RET|ROL|ROMB|ROR|RPIX|SBC|SBK|SEX|SM|SMS|STB|STOP|STW|SUB|SWAP|TO|UMULT|WITH|XOR)\\b'
|
||||
'name': 'keyword.mnemonic.superfx'
|
||||
'MSPC700':
|
||||
'match': '\\b(?i:ADC|ADDW|AND|AND1|ASL|BBC|BBS|BCC|BCS|BEQ|BMI|BNE|BPL|BVC|BVS|BRA|BRK|CALL|CBNE|CLR1|CLRC|CLRP|CLRV|CMP|CMPW|DAA|DAS|DBNZ|DEC|DECW|DI|DIV|EI|EOR|EOR1|INC|INCW|JMP|LSR|MOV|MOV1|MOVW|MUL|NOP|NOT1|NOTC|OR|OR1|PCALL|POP|PUSH|RET|RETI|ROL|ROR|SBC|SET1|SETC|SETP|SLEEP|STOP|SUBW|TCALL|TCLR1|TSET1|XCN)\\b'
|
||||
'name': 'keyword.mnemonic.spc700'
|
||||
'scopeName': 'source.assembly.snes.cc65'
|
@ -75,7 +75,7 @@
|
||||
]
|
||||
'repository':
|
||||
'M6502':
|
||||
'match': '\\b(?i:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\\b'
|
||||
'match': '\\b(?i:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INA|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\\b'
|
||||
'name': 'keyword.mnemonic.6502'
|
||||
'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'
|
||||
|
108
grammars/acme.cson
Normal file
108
grammars/acme.cson
Normal file
@ -0,0 +1,108 @@
|
||||
# Syntax Highlighting for the acme directives
|
||||
|
||||
scopeName: 'source.assembly.6502.acme'
|
||||
name: 'ACME Crossassembler'
|
||||
filetypes: [
|
||||
'a'
|
||||
'asm'
|
||||
]
|
||||
|
||||
patterns: [
|
||||
{ include: 'source.6502-opcodes' }
|
||||
{ include: 'source.6502x-opcodes' }
|
||||
{ include: '#comments' }
|
||||
# symbols, constants, numbers
|
||||
{ include: '#symbols' }
|
||||
# directives
|
||||
{ include: '#directives' }
|
||||
]
|
||||
|
||||
# Repository starts here ------------------------------------------------------
|
||||
|
||||
repository:
|
||||
# comments
|
||||
comments:
|
||||
patterns: [
|
||||
# semicolon comments
|
||||
{
|
||||
match: ';.*$'
|
||||
name: 'comment.line.semicolon.acme'
|
||||
}
|
||||
]
|
||||
|
||||
# symbols
|
||||
symbols:
|
||||
patterns: [
|
||||
# strings
|
||||
{
|
||||
begin: '"'
|
||||
beginCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.begin.acme'
|
||||
end: '"'
|
||||
endCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.end.acme'
|
||||
name: 'string.quoted.double.assembly.acme'
|
||||
}
|
||||
# absolut addressing/numbering
|
||||
{
|
||||
match: '\\#(\'.\'|[^\\s\']+)'
|
||||
name: 'constant.numeric.hex.acme'
|
||||
}
|
||||
# hex, prefixed with dollar ($)
|
||||
{
|
||||
match: '-?\\$[A-Fa-f0-9]+'
|
||||
name: 'constant.numeric.hex.acme'
|
||||
}
|
||||
# binary prefixed with %
|
||||
{
|
||||
match: '%[01]+'
|
||||
name: 'constant.numeric.binary.acme'
|
||||
}
|
||||
# decimal
|
||||
{
|
||||
match: '\\b([0-9]+)\\b'
|
||||
name: 'constant.numeric.decimal.acme'
|
||||
}
|
||||
]
|
||||
|
||||
# assembler directives
|
||||
directives:
|
||||
patterns: [
|
||||
# File and Symbol control
|
||||
{
|
||||
match: '!\\b(?i:source|src|eof|endoffile|realpc|pseudopc|zn|(sub)?zone|set|to|bin(ary)?|sl|symbollist|warn|error|serious|initmem|cbm|addr(ess)?)\\b'
|
||||
name: 'support.function.pseudo.acme'
|
||||
}
|
||||
# Parsing control
|
||||
{
|
||||
match: '!\\b(?i:cpu|al|as|rl|rs|08|by|byte|([bl]e)?(16|24|32)|wo|word|h|hex|fi|fill|align|skip|ct|convtab|tx|text|pet|scr|scrxor|raw)\\b'
|
||||
name: 'support.function.pseudo.acme'
|
||||
}
|
||||
# Macro control
|
||||
{
|
||||
match: '(?i:!\\bmacro|\\+[a-zA-Z0-9])\\b'
|
||||
name: 'support.function.pseudo.acme'
|
||||
}
|
||||
# Conditional control
|
||||
{
|
||||
match: '!\\b(?i:if|if(n)?def|for|do|while|until)\\b'
|
||||
name: 'keyword.control.conditional.acme'
|
||||
}
|
||||
# Conditional control II
|
||||
{
|
||||
match: '\\b(?i:else|while|until)\\b'
|
||||
name: 'keyword.control.conditional.acme'
|
||||
}
|
||||
# Operators
|
||||
{
|
||||
match: '!|\\+|\\-|\\/|\\*|<<|>>|&|\\||\\^|=|<|>|\\:|\\|\\|'
|
||||
name: 'keyword.operator.acme'
|
||||
}
|
||||
# Operators II
|
||||
{
|
||||
match: '\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b'
|
||||
name: 'keyword.operator.acme'
|
||||
}
|
||||
]
|
14
grammars/cc65-816-toolchain.cson
Normal file
14
grammars/cc65-816-toolchain.cson
Normal file
@ -0,0 +1,14 @@
|
||||
# Syntax Highlighting for the cc65 toolchain and 65816 support
|
||||
|
||||
scopeName: 'source.assembly.65816.cc65-816-toolchain'
|
||||
name: '65816 Assembly (cc65)' # 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' } # add basic 65816 instruction set, includes 6502 and 65c02 opcodes
|
||||
{ include: 'source.6502x-opcodes' } # extend with 6502X opcodes
|
||||
{ include: 'source.cc65-directives' } # include the directives for the cc65 toolchain
|
||||
]
|
118
grammars/cc65-directives.cson
Normal file
118
grammars/cc65-directives.cson
Normal file
@ -0,0 +1,118 @@
|
||||
# Syntax Highlighting for the cc65 toolchain directives
|
||||
|
||||
scopeName: 'source.cc65-directives'
|
||||
|
||||
patterns: [
|
||||
{ include: '#comments' } # comments
|
||||
{ include: '#symbols' } # symbols, constants, numbers
|
||||
{ include: '#directives' } # cc65 assembler directives
|
||||
]
|
||||
|
||||
# Repository starts here ------------------------------------------------------
|
||||
repository:
|
||||
|
||||
# comments
|
||||
comments:
|
||||
patterns: [
|
||||
# semicolon comments
|
||||
{
|
||||
match: ';.*$'
|
||||
name: 'comment.line.semicolon.cc65-directives'
|
||||
}
|
||||
]
|
||||
|
||||
# symbols
|
||||
symbols:
|
||||
patterns: [
|
||||
{
|
||||
begin: '"'
|
||||
beginCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.begin.cc65-directives'
|
||||
end: '"'
|
||||
endCaptures:
|
||||
0:
|
||||
name: 'punctuation.definition.string.end.cc65-directives'
|
||||
name: 'string.quoted.double.assembly.cc65-directives'
|
||||
}
|
||||
# absolut address/number
|
||||
{
|
||||
match: '\\#(\'.\'|[^\\s\']+)'
|
||||
name: 'constant.numeric.hex.cc65-directives'
|
||||
}
|
||||
# hex, prefixed with ampersand($)
|
||||
{
|
||||
match: '-?\\$[A-Fa-f0-9]+'
|
||||
name: 'constant.numeric.hex.cc65-directives'
|
||||
}
|
||||
# hex, suffixed with h(h)
|
||||
{
|
||||
match: '-?([0-9]+)h'
|
||||
name: 'constant.numeric.hex.cc65-directives'
|
||||
}
|
||||
# binary
|
||||
{
|
||||
match: '%[01]+'
|
||||
name: 'constant.numeric.binary.cc65-directives'
|
||||
}
|
||||
# decimal
|
||||
{
|
||||
match: '\\b([0-9]+)\\b'
|
||||
name: 'constant.numeric.decimal.cc65-directives'
|
||||
}
|
||||
]
|
||||
|
||||
# assembler directives
|
||||
directives:
|
||||
patterns: [
|
||||
# ca65 pseudo variables
|
||||
{
|
||||
match: '(\\.)?\\b(?i:\\*|asize|cpu|isize|paramcount|time|version)\\b'
|
||||
name: 'support.function.pseudo.cc65-directives'
|
||||
}
|
||||
# ca65 pseudo functions
|
||||
{
|
||||
match: '(\\.)?\\b(?i:addrsize|bank(byte)?|blank|con(cat|st)|(hi|lo)(byte|word)|ident|left|x?match|max|mi[dn]|ref(erenced)?|right|sizeof|strat|sprintf|str(ing|len)|tcount)\\b'
|
||||
name: 'support.function.pseudo.cc65-directives'
|
||||
}
|
||||
# ca65 control commands, A through C
|
||||
{
|
||||
match: '(\\.)?\\b(?i:a(8|16)|addr|align|asciiz|assert|autoimport|(bank|hi)bytes|bss|byte?|case|charmap|code|condes|(con|de)structor)\\b'
|
||||
name: 'storage.modifier.cc65-directives'
|
||||
}
|
||||
# ca65 control commands, D and E
|
||||
{
|
||||
match: '(\\.)?\\b(?i:data|dbyt|debuginfo|define|delmac(ro)?|def(ined(macro)?)?|dword|else(if)?|end(enum)?|end(enum|if|proc|rep(eat)?|scope|struct|union)?|endmac(ro)?|enum|error|exitmac(ro)?|export(zp)?)\\b'
|
||||
name: 'storage.modifier.cc65-directives'
|
||||
}
|
||||
# ca65 control commands, F through I
|
||||
{
|
||||
match: '(\\.)?\\b(?i:faraddr|fatal|feature|f(ile)?opt|forceimport|global(zp)?|i(8|16)|if((n)?blank|const|(n)?def|(n)?ref|p02|p4510|p816|p(s)?c02)?|import(zp)?|inc(bin|lude)|interruptor|ismnem(onic)?)\\b'
|
||||
name: 'storage.modifier.cc65-directives'
|
||||
}
|
||||
# ca65 control commands, L through R
|
||||
{
|
||||
match: '(\\.)?\\b(?i:linecont|list(bytes)?|lobytes|local(char)?|macpack|mac(ro)?|org|out|p02|p4510|p816|pagelen(gth)?|pc02|pop(cpu|seg)|proc|psc02|push(cpu|seg)|reloc|repeat|res|rodata)\\b'
|
||||
name: 'storage.modifier.cc65-directives'
|
||||
}
|
||||
# ca65 control commands, S through Z
|
||||
{
|
||||
match: '(\\.)?\\b(?i:scope|segment|set(cpu)?|smart|struct|tag|undef(ine)?|union|warning|word|zeropage)\\b'
|
||||
name: 'storage.modifier.cc65-directives'
|
||||
}
|
||||
# CPU constants
|
||||
{
|
||||
match: '\\b(CPU_6502|CPU_65SC02|CPU_65C02|CPU_65816|CPU_SWEET16|CPU_HUC6280|CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02|CPU_ISET_65816|CPU_ISET_SWEET16|CPU_ISET_HUC6280|__APPLE2__|__APPLE2ENH__|__ATARI__|__ATARIXL__|__ATMOS__|__BBC__|__C128__|__C16__|__C64__|__CBM__|__CBM510__|__CBM610__|__GEOS__|__GEOS_APPLE__|__GEOS_CBM__|__LUNIX__|__LYNX__|__NES__|__PET__|__PLUS4__|__SIM6502__|__SIM65C02__|__SUPERVISION__|__VIC20__)\\b'
|
||||
name: 'constant.other.cc65-directives'
|
||||
}
|
||||
# Operators
|
||||
{
|
||||
match: '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|'
|
||||
name: 'keyword.operator.cc65-directives'
|
||||
}
|
||||
# Operators II
|
||||
{
|
||||
match: '(\\.)\\b(?i:and|(bit)?(and|not|or|xor)|mod|shl|shr)\\b'
|
||||
name: 'keyword.operator.cc65-directives'
|
||||
}
|
||||
]
|
14
grammars/cc65-toolchain.cson
Normal file
14
grammars/cc65-toolchain.cson
Normal file
@ -0,0 +1,14 @@
|
||||
# Syntax Highlighting for the cc65 toolchain ans 6502 support
|
||||
|
||||
scopeName: 'source.assembly.6502.cc65-toolchain'
|
||||
name: '6502 Assembly (cc65)' # 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.6502x-opcodes' } # extend with 6502X opcodes
|
||||
{ include: 'source.cc65-directives' } # include the directives for the cc65 toolchain
|
||||
]
|
14
grammars/wdc-816-toolchain.cson
Normal file
14
grammars/wdc-816-toolchain.cson
Normal file
@ -0,0 +1,14 @@
|
||||
# Syntax Highlighting for the Western Design Center toolchain and 65816 support
|
||||
|
||||
scopeName: 'source.assembly.65816.wdc-816-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
|
||||
]
|
114
grammars/wdc-directives.cson
Normal file
114
grammars/wdc-directives.cson
Normal file
@ -0,0 +1,114 @@
|
||||
# Syntax Highlighting for the Western Design Center toolchain directives
|
||||
|
||||
scopeName: 'source.wdc-directives'
|
||||
|
||||
patterns: [
|
||||
{ include: '#comments' }
|
||||
{ include: '#symbols' } # symbols, constants, numbers
|
||||
{ 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.assembly.6502.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
|
||||
]
|
4
package.json
Executable file → Normal file
4
package.json
Executable file → Normal file
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "language-65asm",
|
||||
"version": "0.1.0",
|
||||
"version": "8.0.0",
|
||||
"description": "Adds syntax highlighting to 65816/65C816/65802/6502/65C02 files in Atom, with extra support for various compilers.",
|
||||
"repository": "https://github.com/MatthewCallis/language-65asm",
|
||||
"repository": "git@github.com:MatthewCallis/language-65asm.git",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"atom": ">0.50.0"
|
||||
|
Reference in New Issue
Block a user