First commit.

This commit is contained in:
Matthew Callis 2014-03-01 19:05:28 -08:00
commit 3f4af69e67
16 changed files with 1508 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.DS_Store
npm-debug.log
node_modules

20
LICENSE.md Normal file
View File

@ -0,0 +1,20 @@
Copyright (c) 2014 <Your name here>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

21
README.md Executable file
View File

@ -0,0 +1,21 @@
# 65816/65C816/65802/6502/65C02 Assembly Language Support in Atom
Adds syntax highlighting to 65816/65C816/65802/6502/65C02 files in Atom, with extra support for various compilers:
- [cc65](http://oliverschmidt.github.io/cc65/)
- [DASM](http://dasm-dillon.sourceforge.net/) (6502)
- EDASM
- [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)
Originally [converted](http://atom.io/docs/latest/converting-a-text-mate-bundle)
from the various other TextMate bundles:
- [6502asm-tmbundle](https://github.com/adamv/6502asm-tmbundle)
- [65816.tmbundle](https://github.com/ksherlock/65816.tmbundle)
Contributions are greatly appreciated! Please fork this repository and open a
pull request to add snippets, make grammar tweaks, etc.

View File

@ -0,0 +1,65 @@
'fileTypes': []
'foldingStartMarker': '/\\*\\*|\\{\\s*$'
'foldingStopMarker': '\\*\\*/|^\\s*\\}'
'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'
'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'

View File

@ -0,0 +1,101 @@
'fileTypes': []
'foldingStartMarker': '/\\*\\*|\\{\\s*$'
'foldingStopMarker': '\\*\\*/|^\\s*\\}'
'name': '6502 Assembly (cc65)'
'patterns': [
{
'include': '#M6502'
}
{
'include': '#M6502X'
}
{
'include': '#M65C02'
}
{
'include': '#M65816'
}
{
'include': '#M65816_alias'
}
{
'begin': '(;)'
'beginCaptures':
'1':
'name': 'punctuation.definition.comment'
'end': '\\n'
'name': 'comment.line.semicolon'
}
{
'begin': '"'
'beginCaptures':
'0':
'name': 'punctuation.definition.string.begin'
'end': '"'
'endCaptures':
'0':
'name': 'punctuation.definition.string.end'
'name': 'string.quoted.double.assembly'
}
{
'match': '\\$[A-Fa-f0-9]+'
'name': 'constant.numeric.hex'
}
{
'match': '\\b([0-9]+)h\\b'
'name': 'constant.numeric.hex'
}
{
'match': '%[01]+'
'name': 'constant.numeric.binary'
}
{
'match': '\\b([0-9]+)\\b'
'name': 'constant.numeric.decimal'
}
{
'match': '^[A-Za-z_][A-Za-z0-9_]:*'
'name': 'variable.other.readwrite.assembly' # 'entity.name.label'
}
{
'match': '^@[A-Za-z_][A-Za-z0-9_]*'
'name': 'variable.other.readwrite.instance.assembly' # 'entity.name.label.local'
}
{
'match': '(\\.)?\\b(?i:bank|bankbyte|blank|concat|const|hibyte|hiword|ident|left|lobyte|loword|match|max|mid|min|ref|referenced|right|sizeof|sprintf|strat|string|strlen|tcount|xmatch)\\b'
'name': 'support.function.pseudo' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc10
}
{
'match': '(\\.)?\\b(?i:a16|a8|addr|align|asciiz|assert|autoimport|bankbytes|bss|byt|byte|case|charmap|code|condes|constructor|data|dbyt|debuginfo|def|define|defined|delmac|delmacro|destructor|dword|else|elseif|end|endenum|endif|endmac|endmacro|endproc|endrep|endrepeat|endscope|endstruct|endunion|enum|error|exitmac|exitmacro|export|exportzp|faraddr|fatal|feature|fileopt|fopt|forceimport|global|globalzp|hibytes|i16|i8|if|ifblank|ifconst|ifdef|ifnblank|ifndef|ifnref|ifp02|ifp816|ifpc02|ifpsc02|ifref|import|importzp|incbin|include|interruptor|linecont|list|listbytes|lobytes|local|localchar|mac|macpack|macro|org|out|p02|p816|pagelen|pagelength|pc02|popcpu|popseg|proc|psc02|pushcpu|pushseg|reloc|repeat|res|rodata|scope|segment|set|setcpu|smart|struct|tag|undef|undefine|union|warning|word|zeropage)\\b'
'name': 'storage.modifier' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc11
}
{
'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.language.assembly.cc65'
}
{
'match': '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|'
'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'
'name': 'keyword.operator.assembly.cc65' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc5.5
}
]
'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'
'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'
'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.cc65'

248
grammars/6502.cson Executable file
View File

@ -0,0 +1,248 @@
'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': [
[
'"'
'"'
]
[
'('
')'
]
[
'{'
'}'
]
[
'['
']'
]
]

View File

@ -0,0 +1,42 @@
'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'

98
grammars/WLA-DX.cson Normal file
View File

@ -0,0 +1,98 @@
'fileTypes': []
'name': 'WLA-DX'
'patterns': [
{
'include': '#M6502'
}
{
'include': '#M65C02'
}
{
'include': '#M65816'
}
{
'include': '#decimal_number'
}
{
'include': '#hex_number'
}
{
'include': '#hex_number_h'
}
{
'include': '#binary_number'
}
{
'match': '(\\.)?\\b(?i:24bit|accu|base|computesneschecksum|endemuvector|endnativevector|endsnes|fastrom|hirom|index|lorom|slowrom|smc|snesemuvector|snesheader|snesnativevector|16bit|8bit|asc|asciitable|asctable|asm|background|bank|block|br|breakpoint|byt|db|dbcos|dbm|dbrnd|dbsin|def|define|ds|dsb|dstruct|dsw|dw|dwcos|dwm|dwrnd|dwsin|else|emptyfill|endasm|endb|ende|endif|endm|endme|endr|endro|ends|endst|enum|equ|export|fail|fclose|fopen|fread|fsize|if|ifdef|ifdefm|ifeq|ifexists|ifgr|ifgreq|ifle|ifleeq|ifndef|ifndefm|ifneq|incbin|incdir|include|input|macro|memorymap|org|orga|outname|printt|printv|ramsection|redef|redefine|repeat|rept|rombankmap|rombanks|rombanksize|section|seed|shift|slot|struct|sym|symbol|unbackground|undef|undefine|word|cartridgetype|computegbchecksum|computegbcomplementcheck|licenseecodenew|licenseecodeold|ramsize|romdmg|romgbc|romsgb|name|computesmschecksum|sdsctag|smsta)\\b'
'name': 'keyword.directive'
}
{
'begin': '/\\*'
'beginCaptures':
'0':
'name': 'punctuation.definition.comment.begin'
'end': '\\*/'
'endCaptures':
'0':
'name': 'punctuation.definition.comment.end'
'name': 'comment.block'
}
{
'begin': '(;)'
'beginCaptures':
'1':
'name': 'punctuation.definition.comment'
'end': '\\n'
'name': 'comment.line.semicolon'
}
{
'begin': '(^\\*)'
'beginCaptures':
'1':
'name': 'punctuation.definition.comment'
'end': '\\n'
'name': 'comment.line.asterisk'
}
{
'match': '^[A-Za-z_][A-Za-z0-9_]*'
'name': 'variable.other.readwrite.assembly' # 'entity.name.label'
}
{
'match': '^\\_[A-Za-z_][A-Za-z0-9_]*'
'name': 'variable.other.readwrite.instance.assembly' # 'entity.name.label.local'
}
{
'begin': '"'
'beginCaptures':
'0':
'name': 'punctuation.definition.string.begin'
'end': '"'
'endCaptures':
'0':
'name': 'punctuation.definition.string.end'
'name': 'string.quoted.double.assembly'
}
]
'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'
'M65C02':
'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b'
'name': 'keyword.mnemonic.65c02'
'decimal_number':
'match': '\\b([0-9]+)\\b'
'name': 'constant.numeric.decimal'
'hex_number':
'match': '\\$[A-Fa-f0-9]+'
'name': 'constant.numeric.hex'
'hex_number_h':
'match': '\\b([0-9]+)h\\b'
'name': 'constant.numeric.hex'
'binary_number':
'match': '%[01]+'
'name': 'constant.numeric.binary'
'scopeName': 'source.assembly.65816.wla-dx'

90
grammars/edasm.cson Normal file
View File

@ -0,0 +1,90 @@
'fileTypes': []
'name': 'EDASM'
'patterns': [
{
'include': '#M6502'
}
{
'include': '#M65C02'
}
{
'include': '#hex_number'
}
{
'include': '#binary_number'
}
{
'include': '#decimal_number'
}
{
'include': '#octal_number'
}
{
'match': '\\b(?i:BLT|BGE|DEA|INA|LSL)\\b'
'name': 'keyword.mnemonic.6502.alt'
}
{
'match': '^[A-Za-z][A-Za-z0-9@]*\\b'
'name': 'entity.name.label'
}
{
'match': '^[*;].*'
'name': 'comment.line'
}
{
'match': ';.*'
'name': 'comment.line'
}
{
'captures':
'1':
'name': 'keyword.directive.string'
'2':
'name': 'string.delimited.begin'
'3':
'name': 'string.delimited'
'4':
'name': 'string.delimited.end'
'comment': 'delimited strings.'
'match': '\\b((?i)ASC|STR|DCI)\\s+(\\S)(.*?)(\\2|$)'
'name': 'meta.string.delimited'
}
{
'match': '\\b(?i:ASC|CHN|CHR|DATE|DCI|DDB|DEF|DFB|DS|DSECT|DW|ENTRY|EQU|EXTRN|FAIL|FIN|IBUFSIZ|IDNUM|INCLUDE|INTERP|LST|MACLIB|MSB|OBJ|ORG|PAGE|REF|REL|REP|SBTL|SBUFSIZ|SKP|STR|SYS|TIME|ZDEF|ZREF)\\b'
'name': 'keyword.directive'
}
{
'match': '\\b(?i:DO|ELSE|FIN|IFEQ|IFGE|IFGT|IFNE|IFLE|IFLT)\\b'
'name': 'keyword.control.conditional'
}
{
'match': '[-+/|^!<>*#()]'
'name': 'keyword.operator'
}
]
'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.6502.edasm'

228
grammars/merlin.cson Normal file
View File

@ -0,0 +1,228 @@
'fileTypes': []
'name': 'Merlin'
'patterns': [
{
'include': '#M6502'
}
{
'include': '#M65C02'
}
{
'include': '#M65816'
}
{
'include': '#M65816L'
}
{
'include': '#hex_number'
}
{
'include': '#decimal_number'
}
{
'match': '%[01][01_]*'
'name': 'constant.numeric.binary'
}
{
'match': '\\b(?i:TAS|TSA|SWA|TAD|TDA|BLT|BGE)\\b'
'name': 'keyword.mnemonic.65816.alt'
}
{
'match': '(?<=,)([xXyYsS])\\b'
'name': 'variable.language.register'
}
{
'begin': '"'
'end': '"'
'name': 'string.quoted.double'
}
{
'begin': '\''
'end': '\''
'name': 'string.quoted.single'
}
{
'match': '^[*].*'
'name': 'comment.line'
}
{
'match': ';.*'
'name': 'comment.line'
}
{
'match': '^][0-~]*\\b'
'name': 'entity.name.label.variable'
}
{
'match': '^:[0-~]*\\b'
'name': 'entity.name.label.local'
}
{
'match': '^[:-~][0-~]*\\b'
'name': 'entity.name.function'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'string.quoted.other.path'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)DSK|PUT|USE|SAV)\\s+(\\S*)'
'name': 'meta.path.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)CYC)\\s+((?i)ON|OFF|AVE)\\b'
'name': 'meta.cyc.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)EXP)\\s+((?i)ON|OFF|ONLY)\\b'
'name': 'meta.exp.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)LST)\\s+((?i)ON|OFF|RTN)\\b'
'name': 'meta.lst.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)LST)\\s+((?i)OFF)\\b'
'name': 'meta.lstdo.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)TR)\\s+((?i)ON|OFF|ADR)\\b'
'name': 'meta.tr.directive'
}
{
'captures':
'1':
'name': 'keyword.directive.string'
'2':
'name': 'string.delimited.begin'
'3':
'name': 'string.delimited'
'4':
'name': 'string.delimited.end'
'5':
'name': 'keyword.operator'
'6':
'name': 'constant.numeric.hexadecimal'
'comment': 'optional trailing hex data'
'match': '\\b((?i)ASC|DCI|INV|FLS|STR)\\s+(\\S)(.*?)(\\2|$)(,([0-9A-Fa-f]+))?'
'name': 'meta.string.delimited'
}
{
'captures':
'1':
'name': 'keyword.directive.string'
'2':
'name': 'string.delimited.begin'
'3':
'name': 'string.delimited'
'4':
'name': 'string.delimited.end'
'match': '\\b((?i)REV)\\s+(\\S)(.*?)(\\2|$)'
'name': 'meta.string.delimited.rev'
}
{
'begin': '\\b((?i)HEX)\\b'
'captures':
'1':
'name': 'keyword.directive.data'
'comment': 'HEX has a list of hex bytes w/o the $'
'end': '$'
'name': 'meta.hex'
'patterns': [
{
'match': '\\b[0-9A-Fa-f]{1,2}\\b'
'name': 'constant.numeric.hex'
}
{
'match': ';.*$'
'name': 'comment.line'
}
{
'match': ','
'name': 'keyword.operator'
}
{
'match': '\\S'
'name': 'invalid.illegal'
}
]
}
{
'match': '\\b(?i:DSK|EQU|EXT|ENT|ORG|REL|OBJ|PUT|USE|VAR|SAV|TYP|END|DUM|DEND|AST|CYC|DAT|EXP|LST|LSTDO|PAG|TTL|SKP|TR|CHK|ERR|KBD|LUP|--\\^|MX|PAU|SW|USR|XC)\\b'
'name': 'keyword.directive'
}
{
'match': '\\b(?i:DA|DW|DDB|DB|DFB|ADR|ADRL|HEX|DS|ASC|DCI|INV|FLS|REV|STR)\\b'
'name': 'keyword.directive.data'
}
{
'match': '\\b(?i:DO|ELSE|IF|FIN)\\b'
'name': 'keyword.control.conditional'
}
{
'match': '\\b(?i:MAC)\\b|<<<'
'name': 'keyword.directive.macro'
}
{
'match': '[-+/*^><|#\\[\\](),=.!&]'
'name': 'keyword.operator'
}
]
'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.merlin'

242
grammars/mpw.cson Normal file
View File

@ -0,0 +1,242 @@
'fileTypes': [
'aii'
]
'name': 'MPW IIgs Assembler'
'patterns': [
{
'include': '#M6502'
}
{
'include': '#M65C02'
}
{
'include': '#M65816'
}
{
'include': '#hex_number'
}
{
'include': '#binary_number'
}
{
'include': '#decimal_number'
}
{
'match': '\\b(?i:BLT|BGE|CPA|DEA|INA|SWA|TAS|TSA)\\b'
'name': 'keyword.mnemonic.65816.alt'
}
{
'comment': 'Rockwell/m740'
'match': '\\b(?:BBC|BBR|BBS|CLB|RMB|SEB|SMB)[0-9]\\b'
'name': 'keyword.mnemonic.other'
}
{
'comment': 'Rockwell/m740'
'match': '\\b(?i:CLT|COM|LDM|RRF|SETT|TST)\\b'
'name': 'keyword.mnemonic.other'
}
{
'captures':
'1':
'name': 'entity.name.function'
'2':
'name': 'keyword.directive'
'match': '^([A-Za-z@_~][A-Za-z0-9@_~%$#]*)\\s+((?i)PROC|PROCNAME|FUNC|INIT|STACKDP)\\b'
'name': 'meta.function'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'entity.name.function'
'match': '\\b((?i)ENTRY)\\s+([A-Za-z@_~][A-Za-z0-9@_~%$#]*)\\b'
'name': 'meta.entry'
}
{
'captures':
'1':
'name': 'entity.name.record'
'2':
'name': 'keyword.directive'
'match': '^([A-Za-z@_~][A-Za-z0-9@_~%$#]*)\\s+((?i)RECORD)\\b'
'name': 'meta.record'
}
{
'match': '^[A-Za-z@_~][A-Za-z0-9@_~%$#]*\\b'
'name': 'entity.name.label'
}
{
'match': '(?<=,)([xXyYsS])\\b'
'name': 'variable.language.register'
}
{
'match': '\\b(?i:NOT|DIV|MOD|AND|OR|XOR|EOR)\\b'
'name': 'keyword.operator'
}
{
'begin': '"'
'end': '"'
'name': 'string.quoted.double'
}
{
'begin': '\''
'end': '\''
'name': 'string.quoted.single'
}
{
'match': '^[*;].*'
'name': 'comment.line'
}
{
'match': ';.*'
'name': 'comment.line'
}
{
'match': '[=<>+-/|*#()^]|(<>|<=|>=)'
'name': 'keyword.operator'
}
{
'match': '\\b(?i:NOT|DIV|MOD|AND|OR|XOR|EOR)\\b'
'name': 'keyword.operator'
}
{
'begin': '\\b((?i)MACRO)\\b'
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'keyword.directive'
'comment': 'enable &# macro parameters w/in a MAC ... ^^^ definition.'
'end': '\\b((?i)ENDMACRO|ENDM|MEND)\\b'
'name': 'meta.macro'
'patterns': [
{
'include': '$self'
}
{
'match': '&[A-Za-z][A-Za-z0-9]*'
'name': 'variable.parameter'
}
]
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: LONGA ON'
'match': '\\b((?i)CODECHK|DATACHK|LONGA|LONGI|MSB)\\s+((?i)ON|OFF)\\b'
'name': 'meta.onoff.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'match': '\\b((?i)STRING)\\s+((?i)ASIS|PASCAL|C|GS/OS)\\b'
'name': 'meta.string.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'match': '\\b((?i)BLANKS)\\s+((?i)ON|OFF|YES|NO|Y|N)\\b'
'name': 'meta.blanks.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'match': '\\b((?i)BLANKS)\\s+((?i)ON|OFF|YES|NO|Y|N|OBJECT|OBJ)\\b'
'name': 'meta.case.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'match': '\\b((?i)MACHINE)\\s+((?i)M65816|M6502|M65C02|M65CX02|M740)\\b'
'name': 'meta.machine.directive'
}
{
'begin': '\\b((?i)PRINT)\\b'
'beginCaptures':
'1':
'name': 'keyword.directive'
'end': '$'
'name': 'meta.print.directive'
'patterns': [
{
'match': ';.*'
'name': 'comment.line'
}
{
'match': '\\b(?i:ON|OFF|PUSH|POP)\\b'
'name': 'constant.language'
}
{
'match': '\\b(?i:NO)?(?i:GEN|PAGE|WARN|MCALL|OBJ|DATA|MDIR|HDR|LITS|STAT|SYM)\\b'
'name': 'constant.language'
}
{
'match': '[^,\\t ]'
'name': 'invalid.illegal.operand'
}
]
}
{
'match': '\\b(?i:ALIGN|BLANKS|CASE|CODE|CODECHK|DATACHK|DIRECT|DUMP|EJECT|END|ENDF|ENDFUNC|ENDI|ENDP|ENDPROC|END_PROC|ENDR|ENDSTACK|ENDS|ENDWITH|ENTRY|EQU|EXPORT|FUNC|IMPORT|INCLUDE|INIT|LOAD|LONGA|LONGI|MACHINE|MSB|ORG|PAGESIZE|PRINT|PROC|RECORD|SEG|SEGATTR|SET|SPACE|STACKDP|STRING|TITLE|WITH)\\b'
'name': 'keyword.directive'
}
{
'captures':
'1':
'name': 'keyword.directive.data'
'3':
'name': 'storage.type'
'match': '\\b((?i)DC|DCB|DS)([.](.))?\\b'
'name': 'meta.dc.directive'
}
{
'match': '\\b(?i:ACTR|AERROR|ANOP|CYCLE|ELSE|ELSEIF|ENDIF|ENDM|ENDMACRO|ENDWHILE|EXITM|GOTO|IF|LEAVE|MACRO|MEND|MEXIT|THEN|WHILE|WRITE|WRITELN|SET|SETA|SETC)\\b'
'name': 'support.function.macro'
}
{
'match': '&(?i:ABS|CHR|CONCAT|DEFAULT|DELSYMTBL|ENTERSYM|EVAL|FINDSYM|GETENV|INTTOSTR|I2S|ISINT|LEN|LEX|LIST|LOWCASE|LC|MAX|MIN|NBR|NEWSYMTBL|ORD|POS|SCANEQ|SCANNE|STRTOINT|S2I|SETTING|SUBSTR|SYSDATE|SYSINDEX|SYSLIST|SYSLST|SYSLOCAL|SYSGLOBAL|SYSMOD|SYSSEG|SYSTIME|SYSTOKEN|SYSTOKSTR|SYSVALUE|SYSFLAGS|TRIM|TYPE|UPCASE|UC)\\b'
'name': 'support.function.macro'
}
]
'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.mpw'

View File

@ -0,0 +1,126 @@
'fileTypes': []
'name': 'NinjaForce Assembler'
'patterns': [
{
'include': '#M6502'
}
{
'include': '#M65C02'
}
{
'include': '#M65816'
}
{
'include': '#M65816L'
}
{
'include': '#binary_number'
}
{
'include': '#decimal_number'
}
{
'include': '#hex_number'
}
{
'match': '\\b(?i:BLT|BGE)\\b'
'name': 'keyword.mnemonic.65816.alt'
}
{
'match': '^[A-Za-z][A-Za-z0-9_]*'
'name': 'entity.name.function'
}
{
'match': '^\\][A-Za-z][A-Za-z0-9_]*'
'name': 'entity.name.local'
}
{
'begin': '"'
'end': '"'
'name': 'string.quoted.double'
}
{
'begin': '\''
'end': '\''
'name': 'string.quoted.single'
}
{
'begin': '\\b(?i:MAC)\\b'
'comment': 'enable &# macro parameters w/in a MAC ... ^^^ definition.'
'end': '\\^\\^\\^'
'name': 'support.macro'
'patterns': [
{
'include': '$self'
}
{
'match': '&\\d+'
'name': 'variable.parameter'
}
]
}
{
'begin': '\\b((?i)HEX)\\b'
'captures':
'1':
'name': 'keyword.directive'
'comment': 'HEX has a list of hex bytes w/o the $'
'end': '$|;'
'name': 'meta.hex'
'patterns': [
{
'match': '\\b[0-9A-Fa-f]{1,2}\\b'
'name': 'constant.numeric.hex'
}
{
'include': '$self'
}
]
}
{
'match': '(?<=,)([xXyYsS])\\b'
'name': 'variable.language.register'
}
{
'match': '\\b(?i:ORG|EQU|DLW|DW|DFB|HEX|DS|MSB|COD|ASC|STR|TYP|IMP|INS|LNK|SHT|LNG|M08|M16|X08|X16|MAC|\\^\\^\\^|LOP|<<<|LST)\\b'
'name': 'keyword.directive'
}
{
'match': '^[;*].*'
'name': 'comment.line'
}
{
'match': ';.*'
'name': 'comment.line'
}
{
'match': '[-+/*^><|#\\[\\](),=]'
'name': 'keyword.operator'
}
]
'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.ninjaforce'

190
grammars/orca-m.cson Normal file
View File

@ -0,0 +1,190 @@
'fileTypes': [
'src'
's'
]
'name': 'ORCA/M'
'patterns': [
{
'include': '#M6502'
}
{
'include': '#M65C02'
}
{
'include': '#M65816'
}
{
'include': '#hex_number'
}
{
'include': '#binary_number'
}
{
'include': '#decimal_number'
}
{
'include': '#octal_number'
}
{
'match': '\\b(?i:BLT|BGE|CPA)\\b'
'name': 'keyword.mnemonic.65816.alt'
}
{
'captures':
'1':
'name': 'entity.name.function'
'2':
'name': 'keyword.directive'
'match': '^([_~A-Za-z][_~A-Za-z0-9]*)\\s+((?i)START|PRIVATE|DATA|PRIVDATA)\\b'
'name': 'meta.function'
}
{
'match': '^[*;!.].*'
'name': 'comment.line.m65816'
}
{
'comment': 'actually this is position dependent...'
'match': ';.*'
'name': 'comment.line.m65816'
}
{
'match': '^[_~A-Za-z][_~A-Za-z0-9]*\\b'
'name': 'entity.name.label'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.language'
'comment': 'eg: LONGA ON'
'match': '\\b((?i)ABSADDR|CASE|CODECHK|DATACHECK|DYNCHK|ERR|EXPAND|IEEE|INSTIME|LIST|LONGA|LONGI|MSB|NUMSEX|OBJCASE|PRINTER|SYMBOL|65C02|65816)\\s+((?i)ON|OFF)\\b'
'name': 'meta.onoff.directive'
}
{
'captures':
'1':
'name': 'keyword.directive'
'2':
'name': 'string.quoted.other.path'
'comment': 'eg: KEEP pathname'
'match': '\\b((?i)APPEND|COPY|KEEP|MCOPY)\\s+(\\S*)'
'name': 'meta.path.directive'
}
{
'begin': '\\b((?i)DC)\\s+(\\d*)([bB])(\')'
'beginCaptures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.numeric.decimal'
'3':
'name': 'storage.type'
'comment': 'DC nB\'...\''
'end': '(\')$'
'name': 'meta.dc.b'
'patterns': [
{
'match': '[0|1]'
'name': 'constant.numeric.binary'
}
{
'match': '\\S'
'name': 'invalid.illegal.binary'
}
]
}
{
'begin': '\\b((?i)DC)\\s+(\\d*)([hH])(\')'
'beginCaptures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.numeric.decimal'
'3':
'name': 'storage.type'
'comment': 'dc nH\'...\''
'end': '\''
'name': 'meta.dc.h'
'patterns': [
{
'match': '[0-9A-Fa-f]'
'name': 'constant.numeric.hexidecimal'
}
{
'match': '\\S'
'name': 'invalid.illegal.hexidecimal'
}
]
}
{
'begin': '\\b((?i)DC)\\s+(\\d*)([A-Za-z])(\\d*)(\')'
'beginCaptures':
'1':
'name': 'keyword.directive'
'2':
'name': 'constant.numeric.decimal'
'3':
'name': 'storage.type'
'4':
'name': 'constant.numeric.decimal'
'comment': 'DC nIn\'...\', DC C\'...\''
'contentName': 'string.quited.single'
'end': '(\')|$'
'name': 'meta.dc.other'
}
{
'match': '\\b(?i:ABSADDR|ALIGN|ANOP|APPEND|CASE|CODECHK|COPY|DATA|DATACHK|DC|DIRECT|DS|DYNCHK|EJECT|END|ENTRY|EQU|ERR|EXPAND|GEQU|IEEE|INSTIME|KEEP|KIND|LIST|LONGA|LONGI|MCOPY|MEM|MERR|MSB|NUMSEX|OBJ|OBJCASE|OBJEND|ORG|PRINTER|PRIVATE|PRIVDATA|RENAME|SETCOM|START|SYMBOL|TITLE|USING|65C02|65816)\\b'
'name': 'keyword.directive'
}
{
'match': '\\b[aA]\\b'
'name': 'variable.language.register'
}
{
'match': '(?<=,)([xXyYsS])\\b'
'name': 'variable.language.register'
}
{
'match': '[=<>+-/|*#()^\\[\\]]|(<>|<=|>=)'
'name': 'keyword.operator'
}
{
'match': '(?i:\\.AND\\.|\\.EOR\\.|\\.OR\\.)'
'name': 'keyword.operator'
}
{
'match': '"[^"]*"'
'name': 'string.quoted.double'
}
{
'match': '\'[^\']*\''
'name': 'string.quoted.single'
}
]
'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.orcam'

12
package.json Executable file
View File

@ -0,0 +1,12 @@
{
"name": "language-65asm",
"version": "0.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",
"license": "MIT",
"engines": {
"atom": ">0.50.0"
},
"dependencies": {
}
}

View File

@ -0,0 +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'

View File

@ -0,0 +1,4 @@
'.source.assembly.6502':
'Subroutine':
'prefix': 'sub'
'body': '$1 SUBROUTINE\n\t$2\n\trts\n'