├── .gitignore ├── snippets └── language-65asm.cson ├── package.json ├── grammars ├── 65816alt-opcodes.cson ├── 65816l-opcodes.cson ├── 65816-aliases.cson ├── cc65-toolchain.cson ├── cc65-816-toolchain.cson ├── wdc-toolchain.cson ├── 6502x-opcodes.cson ├── wdc-816-toolchain.cson ├── 65816-opcodes.cson ├── 65c02-opcodes.cson ├── 6502-opcodes.cson ├── spc700-opcodes.cson ├── superfx-opcodes.cson ├── 65c02-generic.cson ├── 65816-generic.cson ├── edasm.cson ├── 6502 Assembly (DASM).cson ├── cc65-linker-config.cson ├── ninjaforce assembler.cson ├── WLA-DX.cson ├── asm6.cson ├── wdc-directives.cson ├── acme.cson ├── cc65-directives.cson ├── kickass.cson ├── SNES Assembly (cc65).cson ├── orca-m.cson ├── asar.cson ├── merlin.cson └── mpw.cson ├── settings └── language-65asm.cson ├── CHANGELOG.md ├── LICENSE.md ├── README.md └── coffeelint.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | npm-debug.log 3 | node_modules 4 | -------------------------------------------------------------------------------- /snippets/language-65asm.cson: -------------------------------------------------------------------------------- 1 | '.source.assembly.6502': 2 | 'Subroutine': 3 | 'prefix': 'sub' 4 | 'body': '$1 SUBROUTINE\n\t$2\n\trts\n' 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "language-65asm", 3 | "version": "10.5.0", 4 | "description": "Adds syntax highlighting to 65816/65C816/65802/6502/65C02 files in Atom, with extra support for various compilers.", 5 | "repository": "git@github.com:MatthewCallis/language-65asm.git", 6 | "license": "MIT", 7 | "engines": { 8 | "atom": ">0.50.0" 9 | }, 10 | "dependencies": {} 11 | } 12 | -------------------------------------------------------------------------------- /grammars/65816alt-opcodes.cson: -------------------------------------------------------------------------------- 1 | # Pseudo opcodes for the 65816 used by some assemblers 2 | 3 | scopeName: 'source.65816alt-opcodes' 4 | 5 | patterns: [ 6 | # The 65816 instruction set 7 | { 8 | include: '#mnemonics-65816alt' 9 | } 10 | ] 11 | 12 | # Respository starts here ----------------------------------------------------- 13 | repository: 14 | 15 | # 65816 instruction set 16 | 'mnemonics-65816alt': 17 | patterns: [ 18 | # mnemonics 19 | { 20 | match: '\\b(?i:tas|tsa|swa|tad|tda|blt|bge)\\b' 21 | name: 'keyword.mnemonic.65816.65816alt-opcodes' 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /grammars/65816l-opcodes.cson: -------------------------------------------------------------------------------- 1 | # Pseudo opcodes for the 65816 used by some assemblers 2 | 3 | scopeName: 'source.65816l-opcodes' 4 | 5 | patterns: [ 6 | # The 65816 instruction set 7 | { 8 | include: '#mnemonics-65816l' 9 | } 10 | ] 11 | 12 | # Respository starts here ----------------------------------------------------- 13 | repository: 14 | 15 | # 65816 instruction set 16 | 'mnemonics-65816l': 17 | patterns: [ 18 | # mnemonics 19 | { 20 | match: '\\b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\\b' 21 | name: 'keyword.mnemonic.65816.65816l-opcodes' 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /grammars/65816-aliases.cson: -------------------------------------------------------------------------------- 1 | # Aliases for certain opcodes used by many assemblers 2 | 3 | scopeName: 'source.65816-aliases' 4 | 5 | patterns: [ 6 | # The 65816 instruction set aliases 7 | { 8 | include: '#mnemonics-65816-aliases' 9 | } 10 | ] 11 | 12 | # Respository starts here ----------------------------------------------------- 13 | repository: 14 | 15 | # 65816 instruction set aliases 16 | 'mnemonics-65816-aliases': 17 | patterns: [ 18 | # mnemonics 19 | { 20 | match: '\\b(?i:BGE|BLT|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\\b' 21 | name: 'keyword.mnemonic.65816.65816-aliases' 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /settings/language-65asm.cson: -------------------------------------------------------------------------------- 1 | '.source.assembly': 2 | 'editor': 3 | 'commentStart': ';' 4 | '.source.assembly.6502.edasm': 5 | 'editor': 6 | 'foldEndPattern': '\\b(?i:DEND|FIN)\\b' 7 | '.source.assembly.65816.mpw': 8 | 'editor': 9 | 'foldEndPattern': '\\b(?i:ENDF|ENDFUNC|ENDI|ENDP|ENDPROC|ENDR|ENDSTACK|ENDWITH|ENDM|ENDMACRO|MEND)\\b' 10 | '.source.assembly.65816.merlin': 11 | 'editor': 12 | 'foldEndPattern': '\\b(?i:DEND|FIN)\\b|<<<|--\\^' 13 | '.source.assembly.65816.ninjaforce': 14 | 'editor': 15 | 'foldEndPattern': '(\\^\\^\\^|\\<\\<\\<)' 16 | '.source.assembly.65816.orcam': 17 | 'editor': 18 | 'foldEndPattern': '\\b(?i:END)\\b' 19 | -------------------------------------------------------------------------------- /grammars/cc65-toolchain.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for the cc65 toolchain and 6502 support 2 | 3 | scopeName: 'source.assembly.6502.cc65-toolchain' 4 | name: '6502 Assembly (cc65)' # Name shown in Atom Editor grammar selection 5 | # File extensions associated with this grammar 6 | fileTypes: [ 7 | 's' 8 | ] 9 | # include all opcodes and directives the toolchain supports 10 | patterns: [ 11 | { include: 'source.65c02-opcodes' } # the 65c02 opcodes, includes the basic 6502 instruction set 12 | { include: 'source.6502x-opcodes' } # extend with 6502X opcodes 13 | { include: 'source.cc65-directives' } # include the directives for the cc65 toolchain 14 | ] 15 | -------------------------------------------------------------------------------- /grammars/cc65-816-toolchain.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for the cc65 toolchain and 65816 support 2 | 3 | scopeName: 'source.assembly.65816.cc65-816-toolchain' 4 | name: '65816 Assembly (cc65)' # Name shown in Atom Editor grammar selection 5 | # File extensions associated with this grammar 6 | fileTypes: [ 7 | 's' 8 | ] 9 | # include all opcodes and directives the toolchain supports 10 | patterns: [ 11 | { include: 'source.65816-opcodes' } # add basic 65816 instruction set, includes 6502 and 65c02 opcodes 12 | { include: 'source.6502x-opcodes' } # extend with 6502X opcodes 13 | { include: 'source.cc65-directives' } # include the directives for the cc65 toolchain 14 | ] 15 | -------------------------------------------------------------------------------- /grammars/wdc-toolchain.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for the Western Design Center toolchain and 6502 support 2 | # TODO: extra addressing modes, chip point prefix, * comments 3 | 4 | scopeName: 'source.assembly.6502.wdc-toolchain' 5 | name: '6502 Assembly (WDCTools)' # Name shown in Atom Editor grammar selection 6 | # File extensions associated with this grammar 7 | fileTypes: [ 8 | 's' 9 | ] 10 | # include all opcodes and directives the toolchain supports 11 | patterns: [ 12 | { include: 'source.65c02-opcodes' } # the 65c02 opcodes, includes the basic 6502 instruction set 13 | { include: 'source.wdc-directives' } # include the directives of the WDCxAS assemblers 14 | ] 15 | -------------------------------------------------------------------------------- /grammars/6502x-opcodes.cson: -------------------------------------------------------------------------------- 1 | # Adds the pseudo codes known as 6502X to the basic 6502 instruction set 2 | # NOTE: look for extra opcodes: jam 3 | 4 | scopeName: 'source.6502x-opcodes' 5 | 6 | patterns: [ 7 | # The 6502 pseudo opcodes known as 6502X 8 | { 9 | include: '#mnemonics-6502x' 10 | } 11 | ] 12 | 13 | # Respository starts here ----------------------------------------------------- 14 | repository: 15 | 16 | # 6502x pseudo opcodes 17 | 'mnemonics-6502x': 18 | patterns: [ 19 | # mnemonics 20 | { 21 | match: '\\b(?i:ALR|ANC|ARR|AXS|DCP|ISC|LAS|LAX|RLA|RRA|SAX|SLO|SRE)\\b' 22 | name: 'keyword.mnemonic.6502x.6502x-opcodes' 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /grammars/wdc-816-toolchain.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for the Western Design Center toolchain and 65816 support 2 | 3 | scopeName: 'source.assembly.65816.wdc-816-toolchain' 4 | name: '65816 Assembly (WDCTools)' # Name shown in Atom Editor grammar selection 5 | # File extensions associated with this grammar 6 | fileTypes: [ 7 | 's' 8 | ] 9 | # include all opcodes and directives the toolchain supports 10 | patterns: [ 11 | { include: 'source.65816-opcodes' } # the 65c02 opcodes, includes the basic 65c02 instruction set 12 | { include: 'source.65816-aliases' } # Opcode aliases for the 65816 13 | { include: 'source.wdc-directives' } # include the directives of the WDCxAS assemblers 14 | ] 15 | -------------------------------------------------------------------------------- /grammars/65816-opcodes.cson: -------------------------------------------------------------------------------- 1 | # Extends the basic 6502 instruction set with the basic 65816 instruction set 2 | 3 | scopeName: 'source.65816-opcodes' 4 | 5 | patterns: [ 6 | # The 65c02 instruction set 7 | { 8 | include: 'source.65c02-opcodes' 9 | } 10 | # The 65816 instruction set 11 | { 12 | include: '#mnemonics-65816' 13 | } 14 | ] 15 | 16 | # Respository starts here ----------------------------------------------------- 17 | repository: 18 | 19 | # 65816 instruction set 20 | 'mnemonics-65816': 21 | patterns: [ 22 | # mnemonics 23 | { 24 | 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' 25 | name: 'keyword.mnemonic.65816.65816-opcodes' 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /grammars/65c02-opcodes.cson: -------------------------------------------------------------------------------- 1 | # Extends the basic 6502 instruction set with the 65c02 opcodes 2 | # NOTE: rmb, bbr, smb, bbs not supported 3 | 4 | scopeName: 'source.65c02-opcodes' 5 | 6 | patterns: [ 7 | # The basic 6502 instruction set 8 | { 9 | include: 'source.6502-opcodes' 10 | } 11 | # The added 65c02 opcodes 12 | { 13 | include: '#mnemonics-65c02' 14 | } 15 | ] 16 | 17 | # Respository starts here ----------------------------------------------------- 18 | repository: 19 | 20 | # 65c02 instruction set extension 21 | 'mnemonics-65c02': 22 | patterns: [ 23 | # mnemonics 24 | { 25 | match: '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' 26 | name: 'keyword.mnemonic.65c02.65c02-opcodes' 27 | } 28 | # additional opcodes for WDC chips 29 | { 30 | match: '\\b(?i:(BBR|BBS|RMB|SMB)[0-7])\\b' 31 | name: 'keyword.mnemonic.65c02.65c02-opcodes' 32 | } 33 | ] 34 | -------------------------------------------------------------------------------- /grammars/6502-opcodes.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for the basic instruction set of the 6502 microprocessor. 2 | # This file only contains rules for 6502 mnemonics. The rules here are used by 3 | # other grammars only that add rules for comments, symbols, etc. 4 | 5 | scopeName: 'source.6502-opcodes' 6 | 7 | patterns: [ 8 | # The basic 6502 instruction set 9 | { 10 | include: '#mnemonics-6502' 11 | } 12 | ] 13 | 14 | # Respository starts here ----------------------------------------------------- 15 | repository: 16 | 17 | # basic 6502 instruction set 18 | 'mnemonics-6502': 19 | patterns: [ 20 | # mnemonics 21 | { 22 | 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' 23 | name: 'keyword.mnemonic.6502.6502-opcodes' 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # v10.4.0 2 | 3 | * Fix operator regex for ACME grammar (again) [#17](https://github.com/MatthewCallis/language-65asm/pull/17) 4 | 5 | # v10.0.0 6 | 7 | * Add support for asm6 assembler 8 | 9 | # v9.0.0 10 | 11 | Added https://github.com/georgjz as a collaborator 🎉 12 | 13 | * Updated ACME Grammar (https://github.com/MatthewCallis/language-65asm/pull/11) 14 | * Fix DASM & Merlin, add ASAR, improve CC65 (https://github.com/MatthewCallis/language-65asm/pull/10): 15 | * Added a new grammar to support [Asar Assembler](https://github.com/RPGHacker/asar) 16 | * Added SPC700 and SuperFX opcodes (extracted from the SNES cc65 grammar) 17 | * DASM and Merlin should work now 18 | * cc65 19 | * Added some missing commands and constants 20 | * Changed some scopes to improve readability 21 | * Added a new grammar for the linker config files ld65 uses 22 | * Updated the link in README.md 23 | * Fixed hex numbers with a trailing h 24 | * Add missing commands to WDC tools 25 | -------------------------------------------------------------------------------- /grammars/spc700-opcodes.cson: -------------------------------------------------------------------------------- 1 | # Opcodes for the Sony SPC-700 audio processing unit used in the SNES 2 | 3 | scopeName: 'source.spc700-opcodes' 4 | 5 | patterns: [ 6 | # The SPC700 instruction set aliases 7 | { 8 | include: '#mnemonics-spc700' 9 | } 10 | ] 11 | 12 | # Respository starts here ----------------------------------------------------- 13 | repository: 14 | 15 | # SPC700 instruction set 16 | 'mnemonics-spc700': 17 | patterns: [ 18 | # mnemonics 19 | { 20 | 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' 21 | name: 'keyword.mnemonic.spc700.spc700-opcodes' 22 | } 23 | # registers 24 | { 25 | match: '\\b(?i:F[0-9A-F]|SP|PC|PSW)\\b' 26 | name: 'support.function.pseudo.spc700-opcodes' 27 | # name: 'storage.other.register.spc700-opcodes' 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /grammars/superfx-opcodes.cson: -------------------------------------------------------------------------------- 1 | # Opcodes for the SuperFX DSP used in some SNES cartridges 2 | 3 | scopeName: 'source.superfx-opcodes' 4 | 5 | patterns: [ 6 | # The SPC700 instruction set aliases 7 | { 8 | include: '#mnemonics-superfx' 9 | } 10 | ] 11 | 12 | # Respository starts here ----------------------------------------------------- 13 | repository: 14 | 15 | # SuperFX instruction set 16 | 'mnemonics-superfx': 17 | patterns: [ 18 | # mnemonics 19 | { 20 | 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' 21 | name: 'keyword.mnemonic.superfx.superfx-opcodes' 22 | } 23 | # registers 24 | { 25 | match: '\\b(?i:R0|R1|R2|R3|R4|R5|R6|R7|R8|R9|R10|R11|R12|R13|R14|R15|SP|LR|PC|SFR|BRAMR|PBR|ROMBR|CFGR|SCBR|CLSR|SCMR|VCR|RAMBR|CBR)\\b' 26 | name: 'support.function.pseudo.superfx-opcodes' 27 | # name: 'storage.other.register.superfx-opcodes' 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /grammars/65c02-generic.cson: -------------------------------------------------------------------------------- 1 | # Generic 65C02 grammar with semicolon comments 2 | 3 | scopeName: 'source.assembly.6502.65c02-generic' 4 | fileTypes: [] 5 | name: '6502 Assembly' 6 | patterns: [ 7 | { include: 'source.65c02-opcodes' } # include 6502 and 65c02 opcodes 8 | { include: 'source.6502x-opcodes' } 9 | { include: '#comments' } 10 | { include: '#symbols' } 11 | ] 12 | 13 | # Repository starts here ------------------------------------------------------ 14 | repository: 15 | 16 | # comments 17 | comments: 18 | patterns: [ 19 | # semicolon comments 20 | { 21 | match: ';.*$' 22 | name: 'comment.line.semicolon.65c02-generic' 23 | } 24 | ] 25 | 26 | # symbols 27 | symbols: 28 | patterns: [ 29 | { 30 | begin: '"' 31 | beginCaptures: 32 | 0: 33 | name: 'punctuation.definition.string.begin.65c02-generic' 34 | end: '"' 35 | endCaptures: 36 | 0: 37 | name: 'punctuation.definition.string.end.65c02-generic' 38 | name: 'string.quoted.double.65c02-generic' 39 | } 40 | # absolut address/number 41 | { 42 | match: '\\#(\'.\'|[^\\s\']+)' 43 | name: 'constant.numeric.hex.65c02-generic' 44 | } 45 | # hex, prefixed with ampersand($) 46 | { 47 | match: '-?\\$\\b[A-Fa-f0-9]+\\b' 48 | name: 'constant.numeric.hex.65c02-generic' 49 | } 50 | # hex, suffixed with h(h) 51 | { 52 | match: '-?([a-fA-F0-9]+)h' 53 | name: 'constant.numeric.hex.65c02-generic' 54 | } 55 | # binary 56 | { 57 | match: '%[01]+' 58 | name: 'constant.numeric.binary.65c02-generic' 59 | } 60 | # decimal 61 | { 62 | match: '\\b([0-9]+)\\b' 63 | name: 'constant.numeric.decimal.65c02-generic' 64 | } 65 | ] 66 | -------------------------------------------------------------------------------- /grammars/65816-generic.cson: -------------------------------------------------------------------------------- 1 | # Generic 65816 grammar with semicolon comments 2 | 3 | scopeName: 'source.assembly.65816.65816-generic' 4 | fileTypes: [] 5 | name: '65816 Assembly' 6 | patterns: [ 7 | { include: 'source.65816-opcodes' } # add basic 65816 instruction set, includes 6502 and 65c02 opcodes 8 | { include: 'source.65816l-opcodes' } # extend with 65816L opcodes 9 | { include: '#comments' } 10 | { include: '#symbols' } 11 | ] 12 | 13 | # Repository starts here ------------------------------------------------------ 14 | repository: 15 | 16 | # comments 17 | comments: 18 | patterns: [ 19 | # semicolon comments 20 | { 21 | match: ';.*$' 22 | name: 'comment.line.semicolon.65816-generic' 23 | } 24 | ] 25 | 26 | # symbols 27 | symbols: 28 | patterns: [ 29 | { 30 | begin: '"' 31 | beginCaptures: 32 | 0: 33 | name: 'punctuation.definition.string.begin.65816-generic' 34 | end: '"' 35 | endCaptures: 36 | 0: 37 | name: 'punctuation.definition.string.end.65816-generic' 38 | name: 'string.quoted.double.65816-generic' 39 | } 40 | # absolut address/number 41 | { 42 | match: '\\#(\'.\'|[^\\s\']+)' 43 | name: 'constant.numeric.hex.65816-generic' 44 | } 45 | # hex, prefixed with dollar sign($) 46 | { 47 | match: '-?\\$\\b[a-fA-F0-9]+\\b' 48 | name: 'constant.numeric.hex.65816-generic' 49 | } 50 | # hex, suffixed with h(h) 51 | { 52 | match: '-?([a-fA-F0-9]+)h' 53 | name: 'constant.numeric.hex.65816-generic' 54 | } 55 | # binary 56 | { 57 | match: '%[01]+' 58 | name: 'constant.numeric.binary.65816-generic' 59 | } 60 | # decimal 61 | { 62 | match: '\\b([0-9]+)\\b' 63 | name: 'constant.numeric.decimal.65816-generic' 64 | } 65 | ] 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 65816/65C816/65802/6502/65C02 Assembly Language Support in Atom 2 | 3 | Adds syntax highlighting to 65816/65C816/65802/6502/65C02 files in Atom, with extra support for various compilers: 4 | 5 | - [ACME Crossassembler](https://sourceforge.net/projects/acme-crossass/) 6 | - [Asar SNES Assembler](https://github.com/RPGHacker/asar) 7 | - [ASM6f](https://github.com/freem/asm6f) (support for NES emulator Mesen) 8 | - [cc65 (SNES Syntax: 65816, SPC700, SuperFX)](https://github.com/cc65/cc65) 9 | - [DASM](http://dasm-dillon.sourceforge.net/) (6502) 10 | - [EDASM](https://archive.org/details/EDASM-ProDOS_Assembler_Tools_Manual) 11 | - [Merlin](http://en.wikipedia.org/wiki/Merlin_(assembler)) 12 | - [MPW IIgs Assembler](http://store.16sector.com/index.php?main_page=product_info&products_id=24) 13 | - [NinjaForce Assembler](http://www.ninjaforce.com/html/products_nf_assembler.html) 14 | - [ORCA/M](http://www.byteworks.us/Byte_Works/Products.html) 15 | - [WLA-DX](http://www.villehelin.com/wla.html) 16 | - [WTCTools by Western Design Center](http://westerndesigncenter.com/wdc/tools.cfm) 17 | - [Kick Assembler](http://theweb.dk/KickAssembler/Main.html#frontpage) 18 | 19 | Originally [converted](http://atom.io/docs/latest/converting-a-text-mate-bundle) 20 | from the various other TextMate bundles: 21 | 22 | - [6502asm-tmbundle](https://github.com/adamv/6502asm-tmbundle) 23 | - [65816.tmbundle](https://github.com/ksherlock/65816.tmbundle) 24 | 25 | Contributions are greatly appreciated! Please fork this repository and open a 26 | pull request to add snippets, make grammar tweaks, etc. 27 | 28 | # Installation 29 | 30 | In atom, press `ctrl+shift+p` and enter `install package`, then type `language-65asm` into the search bar and hit install. 31 | 32 | #### OR 33 | 34 | Run `apm install language-65asm` in a terminal. 35 | 36 | To add automatic syntax highlighting to a set of file extensions, add this to your 37 | config.cson (`ctrl+shift+p` -> config): 38 | 39 | ``` 40 | "*": 41 | core: 42 | customFileTypes: { 43 | "source.assembly.6502.cc65": [ 44 | "asm" 45 | "inc" 46 | ] 47 | } 48 | ``` 49 | 50 | See last line in grammar files for names. 51 | 52 | # Contributors 53 | 54 | - [Matthew Callis](https://github.com/MatthewCallis) 55 | - [Matt Tuttle](https://github.com/MattTuttle) 56 | - [Tommy Savaria](https://github.com/NewLunarFire) 57 | - [ARM9](https://github.com/ARM9) 58 | - [georgjz](https://github.com/georgjz) 59 | - [GoDot](http://www.godot64.de/) 60 | - [Carson Herrington](https://github.com/ProbablyNotArtyom) 61 | - [Michael Lass](https://github.com/michaellass) 62 | -------------------------------------------------------------------------------- /grammars/edasm.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': [] 2 | 'name': 'EDASM' 3 | 'patterns': [ 4 | { 5 | 'include': '#M6502' 6 | } 7 | { 8 | 'include': '#M65C02' 9 | } 10 | { 11 | 'include': '#hex_number' 12 | } 13 | { 14 | 'include': '#binary_number' 15 | } 16 | { 17 | 'include': '#decimal_number' 18 | } 19 | { 20 | 'include': '#octal_number' 21 | } 22 | { 23 | 'match': '\\b(?i:BLT|BGE|DEA|INA|LSL)\\b' 24 | 'name': 'keyword.mnemonic.6502.alt' 25 | } 26 | { 27 | 'match': '^[A-Za-z][A-Za-z0-9@]*\\b' 28 | 'name': 'entity.name.label' 29 | } 30 | { 31 | 'match': '^[*;].*' 32 | 'name': 'comment.line' 33 | } 34 | { 35 | 'match': ';.*' 36 | 'name': 'comment.line' 37 | } 38 | { 39 | 'captures': 40 | '1': 41 | 'name': 'keyword.directive.string' 42 | '2': 43 | 'name': 'string.delimited.begin' 44 | '3': 45 | 'name': 'string.delimited' 46 | '4': 47 | 'name': 'string.delimited.end' 48 | 'comment': 'delimited strings.' 49 | 'match': '\\b((?i)ASC|STR|DCI)\\s+(\\S)(.*?)(\\2|$)' 50 | 'name': 'meta.string.delimited' 51 | } 52 | { 53 | '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' 54 | 'name': 'keyword.directive' 55 | } 56 | { 57 | 'match': '\\b(?i:DO|ELSE|FIN|IFEQ|IFGE|IFGT|IFNE|IFLE|IFLT)\\b' 58 | 'name': 'keyword.control.conditional' 59 | } 60 | { 61 | 'match': '[-+/|^!<>*#()]' 62 | 'name': 'keyword.operator' 63 | } 64 | ] 65 | 'repository': 66 | 'M6502': 67 | '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' 68 | 'name': 'keyword.mnemonic.6502' 69 | 'M65816': 70 | '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' 71 | 'name': 'keyword.mnemonic.65816' 72 | 'M65816L': 73 | 'match': '\\b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\\b' 74 | 'name': 'keyword.mnemonic.65816.long' 75 | 'M65C02': 76 | 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' 77 | 'name': 'keyword.mnemonic.65c02' 78 | 'binary_number': 79 | 'match': '%[01]+' 80 | 'name': 'constant.numeric.binary' 81 | 'decimal_number': 82 | 'match': '\\b([0-9]+)\\b' 83 | 'name': 'constant.numeric.decimal' 84 | 'hex_number': 85 | 'match': '\\$[A-Fa-f0-9]+' 86 | 'name': 'constant.numeric.hex' 87 | 'octal_number': 88 | 'match': '@([0-7]+)\\b' 89 | 'name': 'constant.numeric.octal' 90 | 'scopeName': 'source.assembly.6502.edasm' 91 | -------------------------------------------------------------------------------- /coffeelint.json: -------------------------------------------------------------------------------- 1 | { 2 | "coffeescript_error": { 3 | "level": "error" 4 | }, 5 | "arrow_spacing": { 6 | "name": "arrow_spacing", 7 | "level": "warn" 8 | }, 9 | "no_tabs": { 10 | "name": "no_tabs", 11 | "level": "error" 12 | }, 13 | "no_trailing_whitespace": { 14 | "name": "no_trailing_whitespace", 15 | "level": "error", 16 | "allowed_in_comments": false, 17 | "allowed_in_empty_lines": true 18 | }, 19 | "max_line_length": { 20 | "name": "max_line_length", 21 | "value": 128, 22 | "level": "ignore", 23 | "limitComments": true 24 | }, 25 | "line_endings": { 26 | "name": "line_endings", 27 | "level": "warn", 28 | "value": "unix" 29 | }, 30 | "no_trailing_semicolons": { 31 | "name": "no_trailing_semicolons", 32 | "level": "error" 33 | }, 34 | "indentation": { 35 | "name": "indentation", 36 | "value": 2, 37 | "level": "error" 38 | }, 39 | "camel_case_classes": { 40 | "name": "camel_case_classes", 41 | "level": "error" 42 | }, 43 | "colon_assignment_spacing": { 44 | "name": "colon_assignment_spacing", 45 | "level": "ignore", 46 | "spacing": { 47 | "left": 0, 48 | "right": 0 49 | } 50 | }, 51 | "no_implicit_braces": { 52 | "name": "no_implicit_braces", 53 | "level": "ignore", 54 | "strict": false 55 | }, 56 | "no_plusplus": { 57 | "name": "no_plusplus", 58 | "level": "ignore" 59 | }, 60 | "no_throwing_strings": { 61 | "name": "no_throwing_strings", 62 | "level": "error" 63 | }, 64 | "no_backticks": { 65 | "name": "no_backticks", 66 | "level": "error" 67 | }, 68 | "no_implicit_parens": { 69 | "name": "no_implicit_parens", 70 | "level": "ignore" 71 | }, 72 | "no_empty_param_list": { 73 | "name": "no_empty_param_list", 74 | "level": "warn" 75 | }, 76 | "no_stand_alone_at": { 77 | "name": "no_stand_alone_at", 78 | "level": "warn" 79 | }, 80 | "space_operators": { 81 | "name": "space_operators", 82 | "level": "warn" 83 | }, 84 | "duplicate_key": { 85 | "name": "duplicate_key", 86 | "level": "error" 87 | }, 88 | "empty_constructor_needs_parens": { 89 | "name": "empty_constructor_needs_parens", 90 | "level": "warn" 91 | }, 92 | "cyclomatic_complexity": { 93 | "name": "cyclomatic_complexity", 94 | "value": 10, 95 | "level": "ignore" 96 | }, 97 | "newlines_after_classes": { 98 | "name": "newlines_after_classes", 99 | "value": 3, 100 | "level": "ignore" 101 | }, 102 | "no_unnecessary_fat_arrows": { 103 | "name": "no_unnecessary_fat_arrows", 104 | "level": "warn" 105 | }, 106 | "missing_fat_arrows": { 107 | "name": "missing_fat_arrows", 108 | "level": "ignore" 109 | }, 110 | "non_empty_constructor_needs_parens": { 111 | "name": "non_empty_constructor_needs_parens", 112 | "level": "ignore" 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /grammars/6502 Assembly (DASM).cson: -------------------------------------------------------------------------------- 1 | # Syntax highlighting for the DASM macro assembler 2 | 3 | scopeName: 'source.assembly.6502.dasm' 4 | fileTypes: [] 5 | name: '6502 Assembly (DASM)' 6 | patterns: [ 7 | { include: 'source.6502-opcodes' } 8 | { include: '#comments' } 9 | { include: '#symbols' } 10 | { include: '#directives' } 11 | ] 12 | 13 | # Repository starts here ------------------------------------------------------ 14 | repository: 15 | 16 | # comments 17 | comments: 18 | patterns: [ 19 | # semicolon comments 20 | { 21 | match: ';.*$' 22 | name: 'comment.line.semicolon.dasm' 23 | } 24 | ] 25 | 26 | # symbols 27 | symbols: 28 | patterns: [ 29 | # strings 30 | { 31 | begin: '"' 32 | beginCaptures: 33 | 0: 34 | name: 'punctuation.definition.string.begin.dasm' 35 | end: '"' 36 | endCaptures: 37 | 0: 38 | name: 'punctuation.definition.string.end.dasm' 39 | name: 'string.quoted.double.dasm' 40 | } 41 | # global labels 42 | { 43 | captures: 44 | 1: 45 | name: 'entity.name.function.label.dasm' 46 | match: '\\b([A-Za-z0-9_]+):' 47 | name: 'meta.function.label.dasm' 48 | } 49 | # local labels 50 | { 51 | captures: 52 | 1: 53 | name: 'entity.name.function.label.dasm' 54 | match: '\\.\\b([A-Za-z0-9_]+):' 55 | name: 'meta.function.label.dasm' 56 | } 57 | # absolut addressing/numbers 58 | { 59 | match: '\\#(\'.\'|[^\\s\']+)' 60 | name: 'constant.numeric.hex.dasm' 61 | } 62 | # hex, prefixed with dollar sign($) 63 | { 64 | match: '-?\\$\\b[a-fA-F0-9]+\\b' 65 | name: 'constant.numeric.hex.dasm' 66 | } 67 | # octal, prefixed with zero(0) 68 | { 69 | match: '-?\\b0[1-7]+\\b' 70 | name: 'constant.numeric.octal.dasm' 71 | } 72 | # binary 73 | { 74 | match: '%[01]+' 75 | name: 'constant.numeric.binary.65816-generic' 76 | } 77 | # decimal 78 | { 79 | match: '\\b([0-9]+)\\b' 80 | name: 'constant.numeric.decimal.65816-generic' 81 | } 82 | ] 83 | 84 | # directives 85 | directives: 86 | patterns: [ 87 | # file and symbol control 88 | { 89 | match: '\\b(?i:seg(\\.u)?|include|incbin|incdir|hex|err|r?org|processor|echo|rend|align|subroutine)\\b' 90 | name: 'support.function.pseudo.dasm' 91 | } 92 | # data control 93 | { 94 | match: '\\b(?i:d[csv](.bwl)?|hex|eq[um]|set|list\\s(on|off))\\b' 95 | name: 'support.function.pseudo.dasm' 96 | } 97 | # data control II 98 | { 99 | match: '\\.\\b(?i:byte|word)\\b' 100 | name: 'support.function.pseudo.dasm' 101 | } 102 | # Macro control 103 | { 104 | match: '\\b(?i:mac|endm|mexit)\\b' 105 | name: 'support.function.pseudo.acme' 106 | } 107 | # Conditional control 108 | { 109 | match: '\\b(?i:ifn?const|if|else|e(nd)?if|repeat|repend)\\b' 110 | name: 'keyword.control.conditional.acme' 111 | } 112 | ] 113 | -------------------------------------------------------------------------------- /grammars/cc65-linker-config.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for linker config files used with ld65 of the cc65 toolchain 2 | 3 | scopeName: 'source.assembly.cc65-linker-config' 4 | name: 'Linker Config File (cc65)' # Name shown in Atom Editor grammar selection 5 | # File extensions associated with this grammar 6 | fileTypes: [ 7 | 'cfg' 8 | 'txt' 9 | ] 10 | # include all directives and commands the toolchain supports 11 | patterns: [ 12 | { include: '#comments' } 13 | { include: '#symbols' } 14 | ] 15 | 16 | # Repository starts here ------------------------------------------------------ 17 | repository: 18 | 19 | # comments 20 | comments: 21 | patterns: [ 22 | # hash comments 23 | { 24 | match: '\\#.*$' 25 | name: 'comment.line.cc65-linker-config' 26 | } 27 | ] 28 | 29 | # symbols 30 | symbols: 31 | patterns: [ 32 | # strings 33 | { 34 | begin: '"' 35 | beginCaptures: 36 | 0: 37 | name: 'punctuation.definition.string.begin.cc65-linker-config' 38 | end: '"' 39 | endCaptures: 40 | 0: 41 | name: 'punctuation.definition.string.end.cc65-linker-config' 42 | name: 'string.quoted.double.cc65-linker-config' 43 | } 44 | # hex, prefixed with dollar sign($) 45 | { 46 | match: '\\$\\b[a-fA-F0-9]+\\b' 47 | name: 'constant.numeric.hex.cc65-linker-config' 48 | } 49 | # hex, suffixed with h(h) 50 | { 51 | match: '\\b([a-fA-F0-9]+)h\\b' 52 | name: 'constant.numeric.hex.cc65-linker-config' 53 | } 54 | # binary 55 | { 56 | match: '%[01]+' 57 | name: 'constant.numeric.binary.cc65-linker-config' 58 | } 59 | # decimal 60 | { 61 | match: '\\b([0-9]+)\\b' 62 | name: 'constant.numeric.decimal.cc65-linker-config' 63 | } 64 | # areas 65 | { 66 | match: '\\b(?i:memory|segments|files|formats|features|symbols|once|lowcode|startup|zpsave)\\b' 67 | name: 'storage.modifier.cc65-linker-config' 68 | } 69 | # labels 70 | { 71 | captures: 72 | 1: name: 'entity.name.function.label.cc65-linker-config' 73 | match: '\\b([A-Za-z0-9_]+):' 74 | name: 'meta.function.label.cc65-linker-config' 75 | } 76 | # attributes 77 | { 78 | match: '\\b(?i:load|type|define|start|size|fill|file|run|format|os|version|import|export|label|count|segment|order|default|addrsize|align)\\b' 79 | name: 'storage.modifier.cc65-linker-config' 80 | } 81 | # linker constants 82 | { 83 | match: '\\b(__NAME_LOAD__|__NAME_RUN__|__NAME_SIZE__|__DATA_LOAD__|__DATA_RUN__|__DATA_SIZE__|__STACK_START__|__STACK_SIZE__|__STACK_LAST__|__STACK_FILEOFFS__)\\b' 84 | name: 'constant.language.cc65-linker-config' 85 | } 86 | # address sizes, functions 87 | { 88 | match: '\\b(?i:direct|zeropage|zp|absolut|abs|near|far|long|dword|atari|cbm|cpu|generic|longbranch|yes|ro|rw|bss|weak)\\b' 89 | name: 'constant.other.cc65-linker-config' 90 | } 91 | # case sensitive symbols 92 | { 93 | match: '(%\\bO|\\bo65)\\b' 94 | name: 'constant.other.cc65-linker-config' 95 | } 96 | # operators 97 | { 98 | match: '=' 99 | name: 'keyword.operator.cc65-linker-config' 100 | } 101 | ] 102 | -------------------------------------------------------------------------------- /grammars/ninjaforce assembler.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': [] 2 | 'name': 'NinjaForce Assembler' 3 | 'patterns': [ 4 | { 5 | 'include': '#M6502' 6 | } 7 | { 8 | 'include': '#M65C02' 9 | } 10 | { 11 | 'include': '#M65816' 12 | } 13 | { 14 | 'include': '#M65816L' 15 | } 16 | { 17 | 'include': '#binary_number' 18 | } 19 | { 20 | 'include': '#decimal_number' 21 | } 22 | { 23 | 'include': '#hex_number' 24 | } 25 | { 26 | 'match': '\\b(?i:BLT|BGE)\\b' 27 | 'name': 'keyword.mnemonic.65816.alt' 28 | } 29 | { 30 | 'match': '^[A-Za-z][A-Za-z0-9_]*' 31 | 'name': 'entity.name.function' 32 | } 33 | { 34 | 'match': '^\\][A-Za-z][A-Za-z0-9_]*' 35 | 'name': 'entity.name.local' 36 | } 37 | { 38 | 'begin': '"' 39 | 'end': '"' 40 | 'name': 'string.quoted.double' 41 | } 42 | { 43 | 'begin': '\'' 44 | 'end': '\'' 45 | 'name': 'string.quoted.single' 46 | } 47 | { 48 | 'begin': '\\b(?i:MAC)\\b' 49 | 'comment': 'enable &# macro parameters w/in a MAC ... ^^^ definition.' 50 | 'end': '\\^\\^\\^' 51 | 'name': 'support.macro' 52 | 'patterns': [ 53 | { 54 | 'include': '$self' 55 | } 56 | { 57 | 'match': '&\\d+' 58 | 'name': 'variable.parameter' 59 | } 60 | ] 61 | } 62 | { 63 | 'begin': '\\b((?i)HEX)\\b' 64 | 'captures': 65 | '1': 66 | 'name': 'keyword.directive' 67 | 'comment': 'HEX has a list of hex bytes w/o the $' 68 | 'end': '$|;' 69 | 'name': 'meta.hex' 70 | 'patterns': [ 71 | { 72 | 'match': '\\b[0-9A-Fa-f]{1,2}\\b' 73 | 'name': 'constant.numeric.hex' 74 | } 75 | { 76 | 'include': '$self' 77 | } 78 | ] 79 | } 80 | { 81 | 'match': '(?<=,)([xXyYsS])\\b' 82 | 'name': 'variable.language.register' 83 | } 84 | { 85 | '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' 86 | 'name': 'keyword.directive' 87 | } 88 | { 89 | 'match': '^[;*].*' 90 | 'name': 'comment.line' 91 | } 92 | { 93 | 'match': ';.*' 94 | 'name': 'comment.line' 95 | } 96 | { 97 | 'match': '[-+/*^><|#\\[\\](),=]' 98 | 'name': 'keyword.operator' 99 | } 100 | ] 101 | 'repository': 102 | 'M6502': 103 | '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' 104 | 'name': 'keyword.mnemonic.6502' 105 | 'M65816': 106 | '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' 107 | 'name': 'keyword.mnemonic.65816' 108 | 'M65816L': 109 | 'match': '\\b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\\b' 110 | 'name': 'keyword.mnemonic.65816.long' 111 | 'M65C02': 112 | 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' 113 | 'name': 'keyword.mnemonic.65c02' 114 | 'binary_number': 115 | 'match': '%[01]+' 116 | 'name': 'constant.numeric.binary' 117 | 'decimal_number': 118 | 'match': '\\b([0-9]+)\\b' 119 | 'name': 'constant.numeric.decimal' 120 | 'hex_number': 121 | 'match': '\\$[A-Fa-f0-9]+' 122 | 'name': 'constant.numeric.hex' 123 | 'octal_number': 124 | 'match': '@([0-7]+)\\b' 125 | 'name': 'constant.numeric.octal' 126 | 'scopeName': 'source.assembly.65816.ninjaforce' 127 | -------------------------------------------------------------------------------- /grammars/WLA-DX.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': [] 2 | 'name': 'WLA-DX' 3 | 'patterns': [ 4 | { 5 | 'include': '#M6502' 6 | } 7 | { 8 | 'include': '#M65C02' 9 | } 10 | { 11 | 'include': '#M65816' 12 | } 13 | { 14 | 'include': '#decimal_number' 15 | } 16 | { 17 | 'include': '#hex_number' 18 | } 19 | { 20 | 'include': '#hex_number_h' 21 | } 22 | { 23 | 'include': '#binary_number' 24 | } 25 | { 26 | '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' 27 | 'name': 'keyword.directive' 28 | } 29 | { 30 | 'begin': '/\\*' 31 | 'beginCaptures': 32 | '0': 33 | 'name': 'punctuation.definition.comment.begin' 34 | 'end': '\\*/' 35 | 'endCaptures': 36 | '0': 37 | 'name': 'punctuation.definition.comment.end' 38 | 'name': 'comment.block' 39 | } 40 | { 41 | 'begin': '(;)' 42 | 'beginCaptures': 43 | '1': 44 | 'name': 'punctuation.definition.comment' 45 | 'end': '\\n' 46 | 'name': 'comment.line.semicolon' 47 | } 48 | { 49 | 'begin': '(^\\*)' 50 | 'beginCaptures': 51 | '1': 52 | 'name': 'punctuation.definition.comment' 53 | 'end': '\\n' 54 | 'name': 'comment.line.asterisk' 55 | } 56 | { 57 | 'match': '^[A-Za-z_][A-Za-z0-9_]*' 58 | 'name': 'variable.other.readwrite.assembly' # 'entity.name.label' 59 | } 60 | { 61 | 'match': '^\\_[A-Za-z_][A-Za-z0-9_]*' 62 | 'name': 'variable.other.readwrite.instance.assembly' # 'entity.name.label.local' 63 | } 64 | { 65 | 'begin': '"' 66 | 'beginCaptures': 67 | '0': 68 | 'name': 'punctuation.definition.string.begin' 69 | 'end': '"' 70 | 'endCaptures': 71 | '0': 72 | 'name': 'punctuation.definition.string.end' 73 | 'name': 'string.quoted.double.assembly' 74 | } 75 | ] 76 | 'repository': 77 | 'M6502': 78 | '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' 79 | 'name': 'keyword.mnemonic.6502' 80 | 'M65816': 81 | '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' 82 | 'name': 'keyword.mnemonic.65816' 83 | 'M65C02': 84 | 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' 85 | 'name': 'keyword.mnemonic.65c02' 86 | 'decimal_number': 87 | 'match': '\\b([0-9]+)\\b' 88 | 'name': 'constant.numeric.decimal' 89 | 'hex_number': 90 | 'match': '\\$[A-Fa-f0-9]+' 91 | 'name': 'constant.numeric.hex' 92 | 'hex_number_h': 93 | 'match': '\\b([0-9]+)h\\b' 94 | 'name': 'constant.numeric.hex' 95 | 'binary_number': 96 | 'match': '%[01]+' 97 | 'name': 'constant.numeric.binary' 98 | 'scopeName': 'source.assembly.65816.wla-dx' 99 | -------------------------------------------------------------------------------- /grammars/asm6.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for the asm6 assembler 2 | 3 | scopeName: 'source.asm6' 4 | name: 'ASM6f (6502)' # Name shown in Atom Editor grammar selection 5 | # File extensions associated with this grammar 6 | fileTypes: [ 7 | 's' 8 | 'asm' 9 | ] 10 | patterns: [ 11 | { include: 'source.65c02-opcodes' } # extend with 6502X opcodes 12 | { include: 'source.6502x-opcodes' } # extend with 6502X opcodes 13 | { include: '#comments' } # comments 14 | { include: '#symbols' } # symbols, constants, numbers 15 | { include: '#directives' } # cc65 assembler directives 16 | ] 17 | 18 | # Repository starts here ------------------------------------------------------ 19 | repository: 20 | 21 | # comments 22 | comments: 23 | patterns: [ 24 | # semicolon comments 25 | { 26 | match: ';.*$' 27 | name: 'comment.line.semicolon.cc65-directives' 28 | } 29 | ] 30 | 31 | # symbols 32 | symbols: 33 | patterns: [ 34 | # strings 35 | { 36 | begin: '[\"\']' 37 | beginCaptures: 38 | 0: 39 | name: 'punctuation.definition.string.begin.cc65-directives' 40 | end: '[\"\']' 41 | endCaptures: 42 | 0: 43 | name: 'punctuation.definition.string.end.cc65-directives' 44 | name: 'string.quoted.double.cc65-directives' 45 | } 46 | # absolut addressing/numbers 47 | { 48 | match: '\\#(\'.\'|[^\\s\']+)' 49 | name: 'constant.numeric.hex.cc65-directives' 50 | } 51 | # hex, prefixed with dollar sign($) 52 | { 53 | match: '-?\\$\\b[a-fA-F0-9]+\\b' 54 | name: 'constant.numeric.hex.cc65-directives' 55 | } 56 | # hex, suffixed with h(h) 57 | { 58 | match: '-?\\b([a-fA-F0-9]+)h\\b' 59 | name: 'constant.numeric.hex.cc65-directives' 60 | } 61 | # binary prefixed with % 62 | { 63 | match: '%[01]+' 64 | name: 'constant.numeric.binary.cc65-directives' 65 | } 66 | # binary suffixed with b 67 | { 68 | match: '[01]+[bB]' 69 | name: 'constant.numeric.binary.cc65-directives' 70 | } 71 | # decimal 72 | { 73 | match: '\\b([0-9]+)\\b' 74 | name: 'constant.numeric.decimal.cc65-directives' 75 | } 76 | ] 77 | 78 | # assembler directives 79 | directives: 80 | patterns: [ 81 | # ca65 pseudo variables 82 | { 83 | match: '(\\.)?\\b(?i:equ|include|incsrc|(inc)?bin|db|dw|byte|word|dcb|dcw|(dc\\.b)|(dc\\.w)|ignorenl|endinl|unstable|hunstable|inesprog|ineschr|inesmap|inesmir|nes2chrram|nes2prgram|nes2usb|nes2tv|nes2vs|nes2bram|nes2chrbram)\\b' 84 | name: 'support.function.pseudo.cc65-directives' 85 | } 86 | # ca65 pseudo functions 87 | { 88 | match: '(\\.)?\\b(?i:dl|dh|hex|(ds\\.?b)|(ds\\.?w)|pad|org|align|fillvalue|base|if|elseif|else|endif|ifdef|ifndef|macro|endm|rept|endr|enum|ende|error)\\b' 89 | name: 'support.function.pseudo.cc65-directives' 90 | } 91 | # address sizes, macpack packages 92 | # { 93 | # match: '\\b(?i:direct|zeropage|zp|absolute|abs|near|far|long|dword|atari|cbm|cpu|generic|longbranch)\\b' 94 | # name: 'constant.language.cc65-directives' 95 | # } 96 | # Operators 97 | { 98 | match: '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|\\%' 99 | name: 'keyword.operator.cc65-directives' 100 | } 101 | # Operators II/undocumented opcodes 102 | { 103 | match: '(\\.)\\b(?i:slo|rla|sre|rra|sax|lax|dcp|isc|anc|alr|arr|axs|las|ahx|shy|shx|tas|xaa)\\b' 104 | name: 'keyword.operator.cc65-directives' 105 | } 106 | ] 107 | -------------------------------------------------------------------------------- /grammars/wdc-directives.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for the Western Design Center toolchain directives 2 | 3 | scopeName: 'source.wdc-directives' 4 | 5 | patterns: [ 6 | { include: '#comments' } 7 | { include: '#symbols' } # symbols, constants, numbers 8 | { include: '#directives' } 9 | ] 10 | 11 | # Repository starts here ------------------------------------------------------ 12 | repository: 13 | 14 | # comments 15 | comments: 16 | patterns: [ 17 | # semicolon comments 18 | { 19 | match: ';.*$' 20 | name: 'comment.line.semicolon.wdc-toolchain' 21 | } 22 | ] 23 | 24 | # symbols 25 | symbols: 26 | patterns: [ 27 | # strings 28 | { 29 | begin: '"' 30 | beginCaptures: 31 | 0: 32 | name: 'punctuation.definition.string.begin.wdc-toolchain' 33 | end: '"' 34 | endCaptures: 35 | 0: 36 | name: 'punctuation.definition.string.end.wdc-toolchain' 37 | name: 'string.quoted.double.wdc-toolchain' 38 | } 39 | # absolut addressing/numbers 40 | { 41 | match: '\\#(\'.\'|[^\\s\']+)' 42 | name: 'constant.numeric.hex.wdc-toolchain' 43 | } 44 | # hex, prefixed with dollar sign($) 45 | { 46 | match: '-?\\$\\b[a-fA-F0-9]+\\b' 47 | name: 'constant.numeric.hex.wdc-toolchain' 48 | } 49 | # hex, suffixed with h(h) 50 | { 51 | match: '-?\\b([a-fA-F0-9]+)h' 52 | name: 'constant.numeric.hex.wdc-toolchain' 53 | } 54 | # binary prefixed with % 55 | { 56 | match: '%[01]+' 57 | name: 'constant.numeric.binary.wdc-toolchain' 58 | } 59 | # binary suffixed with B 60 | { 61 | match: '[01]+(?i:b)' 62 | name: 'constant.numeric.binary.wdc-toolchain' 63 | } 64 | # octal and decimal 65 | { 66 | match: '\\b([0-9]+[doq]?)\\b' 67 | name: 'constant.numeric.decimal.wdc-toolchain' 68 | } 69 | ] 70 | 71 | # assembler directives 72 | directives: 73 | patterns: [ 74 | # File and Symbol control 75 | { 76 | match: '\\b(?i:append|include|insert|end(s|mod)?|exit|module|section|ref_only|org|origin|equ(al)?|gequ|defl|set|var|extern(al|s)?|xref|globals?|public|xdef|message|messg|efunc|incdebug)\\b' 77 | name: 'support.function.pseudo.wdc-toolchain' 78 | } 79 | # Parsing control 80 | { 81 | 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' 82 | name: 'support.function.pseudo.wdc-toolchain' 83 | } 84 | # Macro control 85 | { 86 | match: '\\b(?i:macro|endm|macend|argchk|macfirst|macdelim|macexit|ifma|ifnma|rept|endr)\\b' 87 | name: 'support.function.pseudo.wdc-toolchain' 88 | } 89 | # Conditional control 90 | { 91 | 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' 92 | name: 'keyword.control.conditional.wdc-toolchain' 93 | } 94 | # Listing control 95 | { 96 | 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' 97 | name: 'support.function.pseudo.wdc-toolchain' 98 | } 99 | # Pre-defined sections 100 | { 101 | match: '\\b(?i:page0|code|(k|u)?data)\\b' 102 | name: 'constant.other.wdc-toolchain' 103 | } 104 | # Operators 105 | { 106 | match: '!|\\+|\\-|\\/|\\*|<<|>>|&|\\||\\^|=|<|>|\\:|\\|\\|' 107 | name: 'keyword.operator.wdc-toolchain' 108 | } 109 | # Operators II 110 | { 111 | match: '\\.\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b\\.' 112 | name: 'keyword.operator.wdc-toolchain' 113 | } 114 | ] 115 | -------------------------------------------------------------------------------- /grammars/acme.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for the acme directives 2 | 3 | scopeName: 'source.assembly.6502.acme' 4 | name: 'ACME Crossassembler' 5 | filetypes: [ 6 | 'a' 7 | 'asm' 8 | ] 9 | 10 | patterns: [ 11 | { include: 'source.6502-opcodes' } 12 | { include: 'source.6502x-opcodes' } 13 | { include: '#comments' } 14 | # directives 15 | { include: '#directives' } 16 | # symbols, constants, numbers 17 | { include: '#symbols' } 18 | ] 19 | 20 | # Repository starts here ------------------------------------------------------ 21 | 22 | repository: 23 | # comments 24 | comments: 25 | patterns: [ 26 | # semicolon comments 27 | { 28 | match: ';.*$' 29 | name: 'comment.line.semicolon.acme' 30 | } 31 | ] 32 | 33 | # symbols 34 | symbols: 35 | patterns: [ 36 | # Labels (at beginning of a line) 37 | { 38 | match: '^[A-Za-z\\._][A-Za-z0-9_:]*' 39 | name: 'entity.name.function.acme' 40 | } 41 | # this section hilights labels as variables: results in pretty colorful listings, maybe you like it 42 | # Labels inline 43 | # { 44 | # match: '\\b[A-Za-z][A-Za-z0-9_:]*\\b' 45 | # name: 'variable.language' 46 | # } 47 | # Register A (like in ASL A) 48 | { 49 | match: '\\b[aA]\\b' 50 | name: 'variable.language.register.acme' 51 | } 52 | # Registers X and Y (like in LDA $1000,X or LDA ($30),Y ) 53 | { 54 | match: '(?<=,)([xXyY])\\b' 55 | name: 'variable.language.register.acme' 56 | } 57 | # strings 58 | { 59 | begin: '"' 60 | end: '"' 61 | endCaptures: 62 | 0: 63 | name: 'punctuation.definition.string.end.acme' 64 | name: 'string.quoted.double.acme' 65 | } 66 | { 67 | begin: '\'' 68 | end: '\'' 69 | name: 'string.quoted.single.assembly.acme' 70 | } 71 | # absolut addressing/numbering (including lo/hibyte by < or >) 72 | { 73 | match: '\\#(\\>?\\>|&|\\||\\^|=|<|>|\\:' 128 | name: 'keyword.operator.acme' 129 | } 130 | # Operators II 131 | { 132 | match: '\\b(?i:and|not|mod|sh[lr]|x?or|eq|u?[gl]t)\\b' 133 | name: 'keyword.operator.acme' 134 | } 135 | ] 136 | -------------------------------------------------------------------------------- /grammars/cc65-directives.cson: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting for the cc65 toolchain directives 2 | 3 | scopeName: 'source.cc65-directives' 4 | 5 | patterns: [ 6 | { include: '#comments' } # comments 7 | { include: '#symbols' } # symbols, constants, numbers 8 | { include: '#directives' } # cc65 assembler directives 9 | ] 10 | 11 | # Repository starts here ------------------------------------------------------ 12 | repository: 13 | 14 | # comments 15 | comments: 16 | patterns: [ 17 | # semicolon comments 18 | { 19 | match: ';.*$' 20 | name: 'comment.line.semicolon.cc65-directives' 21 | } 22 | ] 23 | 24 | # symbols 25 | symbols: 26 | patterns: [ 27 | # strings 28 | { 29 | begin: '"' 30 | beginCaptures: 31 | 0: 32 | name: 'punctuation.definition.string.begin.cc65-directives' 33 | end: '"' 34 | endCaptures: 35 | 0: 36 | name: 'punctuation.definition.string.end.cc65-directives' 37 | name: 'string.quoted.double.cc65-directives' 38 | } 39 | # absolut addressing/numbers 40 | { 41 | match: '\\#(\'.\'|[^\\s\']+)' 42 | name: 'constant.numeric.hex.cc65-directives' 43 | } 44 | # hex, prefixed with dollar sign($) 45 | { 46 | match: '-?\\$\\b[a-fA-F0-9]+\\b' 47 | name: 'constant.numeric.hex.cc65-directives' 48 | } 49 | # hex, suffixed with h(h) 50 | { 51 | match: '-?\\b([a-fA-F0-9]+)h\\b' 52 | name: 'constant.numeric.hex.cc65-directives' 53 | } 54 | # binary 55 | { 56 | match: '%[01]+' 57 | name: 'constant.numeric.binary.cc65-directives' 58 | } 59 | # decimal 60 | { 61 | match: '\\b([0-9]+)\\b' 62 | name: 'constant.numeric.decimal.cc65-directives' 63 | } 64 | ] 65 | 66 | # assembler directives 67 | directives: 68 | patterns: [ 69 | # ca65 pseudo variables 70 | { 71 | match: '(\\.)\\b(?i:\\*|asize|cpu|isize|paramcount|time|version)\\b' 72 | name: 'support.function.pseudo.cc65-directives' 73 | } 74 | # ca65 pseudo functions 75 | { 76 | 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' 77 | name: 'support.function.pseudo.cc65-directives' 78 | } 79 | # ca65 control commands, A through C 80 | { 81 | match: '(\\.)\\b(?i:a(8|16)|addr|align|asciiz|assert|autoimport|(bank|hi)bytes|bss|byte?|case|charmap|code|condes|(con|de)structor)\\b' 82 | name: 'support.function.pseudo.cc65-directives' 83 | } 84 | # ca65 control commands, D and E 85 | { 86 | 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' 87 | name: 'support.function.pseudo.cc65-directives' 88 | } 89 | # ca65 control commands, F through I 90 | { 91 | 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' 92 | name: 'support.function.pseudo.cc65-directives' 93 | } 94 | # ca65 control commands, L through R 95 | { 96 | 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' 97 | name: 'support.function.pseudo.cc65-directives' 98 | } 99 | # ca65 control commands, S through Z 100 | { 101 | match: '(\\.)\\b(?i:scope|segment|set(cpu)?|smart|struct|tag|undef(ine)?|union|warning|word|zeropage)\\b' 102 | name: 'support.function.pseudo.cc65-directives' 103 | } 104 | # CPU constants 105 | { 106 | 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__|VER_MAJOR|VER_MINOR)\\b' 107 | name: 'constant.language.cc65-directives' 108 | } 109 | # address sizes, macpack packages 110 | { 111 | match: '\\b(?i:direct|zeropage|zp|absolute|abs|near|far|long|dword|atari|cbm|cpu|generic|longbranch)\\b' 112 | name: 'constant.language.cc65-directives' 113 | } 114 | # Operators 115 | { 116 | match: '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|' 117 | name: 'keyword.operator.cc65-directives' 118 | } 119 | # Operators II 120 | { 121 | match: '(\\.)\\b(?i:and|(bit)?(and|not|or|xor)|mod|shl|shr)\\b' 122 | name: 'keyword.operator.cc65-directives' 123 | } 124 | ] 125 | -------------------------------------------------------------------------------- /grammars/kickass.cson: -------------------------------------------------------------------------------- 1 | scopeName: 'source.assembly.6502.kickass' 2 | name: 'Kick Assembler' 3 | 4 | fileTypes: [ 5 | 'a' 6 | 'asm' 7 | 's' 8 | 'S' 9 | ] 10 | 11 | patterns: [ 12 | { include: 'source.65c02-opcodes' } 13 | { include: 'source.6502x-opcodes' } 14 | { include: '#comments' } 15 | { include: '#directives' } 16 | { include: '#symbols' } 17 | 18 | ] 19 | 20 | repository: 21 | comments: 22 | patterns: [ 23 | { 24 | match: '(\\/\\/[^\\n]+)' 25 | name: 'comment.line' 26 | } 27 | { 28 | begin: '\\/\\*' 29 | end: '\\*\\/' 30 | name: 'comment.block' 31 | } 32 | ] 33 | symbols: 34 | patterns: [ 35 | 36 | # =============================================================== 37 | # Assembler symbols 38 | { # Labels 39 | match: '^\\s*[a-zA-Z_][a-zA-Z0-9_]*:' 40 | name: 'entity.name.function.kickass' 41 | } 42 | { # Local labels 43 | match: '!(:|[\\+\\-]+)' 44 | name: 'entity.name.function.kickass' 45 | } 46 | { # Variable functions, like var.getValue() 47 | match: '(\\w+(?=\\())' 48 | name: 'entity.name.function.kickass' 49 | } 50 | 51 | # =============================================================== 52 | # Data types 53 | { # Chars 54 | match: "\\'\\S\\'" 55 | name: 'string.char.kickass' 56 | } 57 | { # Strings 58 | begin: '"' 59 | end: '"' 60 | name: 'string.quoted.kickass' 61 | } 62 | 63 | { # Hex numbers 64 | match: '-?\\$[A-Fa-f0-9]+' 65 | name: 'constant.numeric.hex.kickass' 66 | } 67 | { # Octals 68 | match: '@([0-7]+)\\b' 69 | name: 'constant.numeric.octal.kickass' 70 | } 71 | { # Binary numbers 72 | match: '%[01]+' 73 | name: 'constant.numeric.binary.kickass' 74 | } 75 | { # Decimal numbers 76 | match: '\\b([0-9]+)\\b' 77 | name: 'constant.numeric.decimal.kickass' 78 | } 79 | { # Immediate values 80 | match: '\\#([^\\s]+)' 81 | name: 'constant.numeric.hex.kickass' 82 | } 83 | { # Constants 84 | match: '\\b([_A-Z][_A-Z0-9]+)\\b' 85 | name: 'variable.kickass' 86 | } 87 | ] 88 | directives: 89 | patterns: [ 90 | 91 | # =============================================================== 92 | # Preprocessor directives 93 | { 94 | match: '(\\#)((?:define|undef))([\\s\\w]+)' 95 | captures: 96 | 1: name: 'keyword.control.directive.kickass' 97 | 2: name: 'keyword.control.directive.kickass' 98 | 3: name: 'variable.kickass' 99 | } 100 | { 101 | match: '(\\#)((?:endif|el(se|if)|if|importif))([\\s\\w]+)' 102 | captures: 103 | 1: name: 'keyword.control.directive.kickass' 104 | 2: name: 'keyword.control.directive.kickass' 105 | 4: name: 'variable.kickass' 106 | } 107 | { 108 | match: '(\\#)((import(once)?))([\\s\\w]+)' 109 | name: 'keyword.control.directive.kickass' 110 | } 111 | 112 | # =============================================================== 113 | # Assembler directive conditionals 114 | { 115 | match: '(\\.)((?:elif|if))' 116 | captures: 117 | 1: name: 'keyword.control.directive.kickass' 118 | 2: name: 'keyword.control.directive.kickass' 119 | } 120 | { 121 | match: '(\\}?(\\s+)?)(else)' 122 | captures: 123 | 3: name: 'keyword.control.directive.kickass' 124 | } 125 | 126 | # =============================================================== 127 | # Assembler directives misc 128 | { # Assembler directives that have inconsistant syntax 129 | match: '(\\.)((?:return|namespace|print(now)?|by(te)?|align|assert(error)?|break|disk|dw(ord)?|encoding|enum|error(if)?|file(modify|namespace)?|fill(word)?|for|lohifill|memblock|modify|pc|plugin|pseudopc|segment(def|out)?|struct|te(xt)?|while|wo(rd)?|zp|import( binary| c64| source| text|once)))\\b' 130 | name: 'keyword.control.directive.kickass' 131 | } 132 | { 133 | match: '(\\}?(\\s+)?)(else)' 134 | captures: 135 | 2: name: 'keyword.control.directive.kickass' 136 | } 137 | 138 | # =============================================================== 139 | # Variables and Macros 140 | { 141 | match: '(\\.)(var|eval|const|label)(\\s*[a-zA-Z0-9_]*)(\\s*=)?' 142 | captures: 143 | 1: name: 'keyword.control.directive.kickass' 144 | 2: name: 'keyword.control.directive.kickass' 145 | 3: name: 'support.function.kickass' 146 | 4: name: 'keyword.operator.kickass' 147 | } 148 | { 149 | match: '(?:\\()(var|eval|const|label)(?=\\s*[a-zA-Z0-9_]*)' 150 | captures: 151 | 1: name: 'keyword.control.directive.kickass' 152 | 2: name: 'support.function.kickass' 153 | } 154 | { 155 | match: '(\\.)(function|macro)([\\s\\w_.]*)(\\()([^)]*)(\\))' 156 | captures: 157 | 1: name: 'keyword.control.directive.kickass' 158 | 2: name: 'keyword.control.directive.kickass' 159 | 3: name: 'entity.name.function.kickass' 160 | 4: name: 'keyword.operator.kickass' 161 | 5: name: 'constant.variable.kickass' 162 | 6: name: 'keyword.operator.kickass' 163 | } 164 | { 165 | match: '(\\.)(pseudocommand)(\\s+)([^\\s\\n]+)' 166 | captures: 167 | 1: name: 'keyword.control.directive.kickass' 168 | 2: name: 'keyword.control.directive.kickass' 169 | 4: name: 'entity.name.function.kickass' 170 | } 171 | ] 172 | -------------------------------------------------------------------------------- /grammars/SNES Assembly (cc65).cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': [] 2 | 'name': 'SNES Assembly (cc65)' 3 | 'patterns': [ 4 | { 5 | 'include': '#M6502' 6 | } 7 | { 8 | 'include': '#M65C02' 9 | } 10 | { 11 | 'include': '#M65816' 12 | } 13 | { 14 | 'include': '#M65816_alias' 15 | } 16 | { 17 | 'include': '#MSuperFX' 18 | } 19 | { 20 | 'include': '#MSPC700' 21 | } 22 | { 23 | 'match': ';.*$' 24 | 'name': 'comment.line.semicolon' 25 | } 26 | { 27 | 'match': '\\b(?i:R0|R1|R2|R3|R4|R5|R6|R7|R8|R9|R10|R11|R12|R13|R14|R15|SP|LR|PC)\\b' 28 | 'name': 'support.function.pseudo' 29 | } 30 | { 31 | 'begin': '"' 32 | 'beginCaptures': 33 | '1': 34 | 'name': 'punctuation.definition.string.begin' 35 | 'end': '"' 36 | 'endCaptures': 37 | '1': 38 | 'name': 'punctuation.definition.string.end' 39 | 'name': 'string.quoted.double.assembly' 40 | } 41 | { 42 | 'match': '\\$[A-Fa-f0-9]+' 43 | 'name': 'constant.numeric.hex' 44 | } 45 | { 46 | 'match': '\\b[0-9][0-9a-fA-f]*h\\b' 47 | 'name': 'constant.numeric.hex' 48 | } 49 | { 50 | 'match': '%[01]+' 51 | 'name': 'constant.numeric.binary' 52 | } 53 | { 54 | 'match': '\\b[0-9]+\\b' 55 | 'name': 'constant.numeric.decimal' 56 | } 57 | { 58 | 'match': '\\b[A-Za-z_][A-Za-z0-9_]*\\b' 59 | 'name': 'variable.other.readwrite.assembly' # 'entity.name.label' 60 | } 61 | { 62 | 'match': '@[A-Za-z_][A-Za-z0-9_]*\\b' 63 | 'name': 'variable.other.readwrite.instance.assembly' # 'entity.name.label.local' 64 | } 65 | { 66 | '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' 67 | 'name': 'support.function.pseudo' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc10 68 | } 69 | { 70 | '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' 71 | 'name': 'storage.modifier' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc11 72 | } 73 | { 74 | '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' 75 | 'name': 'constant.language.assembly.cc65' 76 | } 77 | { 78 | 'match': '!|&|&&|\\^|\\*|\\/|\\-|\\+|~|=|<=|>=|<<|>>|<>|<|>|\\||\\|\\|' 79 | 'name': 'keyword.operator.assembly.cc65' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc5.5 80 | } 81 | { 82 | 'match': '(\\.)\\b(?i:and|bankbyte|bitand|bitnot|bitor|bitxor|mod|not|or|shl|shr|xor)\\b' 83 | 'name': 'keyword.operator.assembly.cc65' # http://oliverschmidt.github.io/cc65/doc/ca65.html#toc5.5 84 | } 85 | ] 86 | 'repository': 87 | 'M6502': 88 | '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' 89 | 'name': 'keyword.mnemonic.6502' 90 | 'M65816': 91 | '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' 92 | 'name': 'keyword.mnemonic.65816' 93 | 'M65816_alias': 94 | 'match': '\\b(?i:BGE|BLT|CPA|DEA|INA|SWA|TAD|TAS|TDA|TSA)\\b' 95 | 'name': 'keyword.mnemonic.65816_alias' 96 | 'M65C02': 97 | 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' 98 | 'name': 'keyword.mnemonic.65c02' 99 | 'MSuperFX': 100 | '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' 101 | 'name': 'keyword.mnemonic.superfx' 102 | 'MSPC700': 103 | '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' 104 | 'name': 'keyword.mnemonic.spc700' 105 | 'scopeName': 'source.assembly.snes.cc65' 106 | -------------------------------------------------------------------------------- /grammars/orca-m.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': [ 2 | 'src' 3 | 's' 4 | ] 5 | 'name': 'ORCA/M' 6 | 'patterns': [ 7 | { 8 | 'include': '#M6502' 9 | } 10 | { 11 | 'include': '#M65C02' 12 | } 13 | { 14 | 'include': '#M65816' 15 | } 16 | { 17 | 'include': '#hex_number' 18 | } 19 | { 20 | 'include': '#binary_number' 21 | } 22 | { 23 | 'include': '#decimal_number' 24 | } 25 | { 26 | 'include': '#octal_number' 27 | } 28 | { 29 | 'match': '\\b(?i:BLT|BGE|CPA)\\b' 30 | 'name': 'keyword.mnemonic.65816.alt' 31 | } 32 | { 33 | 'captures': 34 | '1': 35 | 'name': 'entity.name.function' 36 | '2': 37 | 'name': 'keyword.directive' 38 | 'match': '^([_~A-Za-z][_~A-Za-z0-9]*)\\s+((?i)START|PRIVATE|DATA|PRIVDATA)\\b' 39 | 'name': 'meta.function' 40 | } 41 | { 42 | 'match': '^[*;!.].*' 43 | 'name': 'comment.line.m65816' 44 | } 45 | { 46 | 'comment': 'actually this is position dependent...' 47 | 'match': ';.*' 48 | 'name': 'comment.line.m65816' 49 | } 50 | { 51 | 'match': '^[_~A-Za-z][_~A-Za-z0-9]*\\b' 52 | 'name': 'entity.name.label' 53 | } 54 | { 55 | 'captures': 56 | '1': 57 | 'name': 'keyword.directive' 58 | '2': 59 | 'name': 'constant.language' 60 | 'comment': 'eg: LONGA ON' 61 | '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' 62 | 'name': 'meta.onoff.directive' 63 | } 64 | { 65 | 'captures': 66 | '1': 67 | 'name': 'keyword.directive' 68 | '2': 69 | 'name': 'string.quoted.other.path' 70 | 'comment': 'eg: KEEP pathname' 71 | 'match': '\\b((?i)APPEND|COPY|KEEP|MCOPY)\\s+(\\S*)' 72 | 'name': 'meta.path.directive' 73 | } 74 | { 75 | 'begin': '\\b((?i)DC)\\s+(\\d*)([bB])(\')' 76 | 'beginCaptures': 77 | '1': 78 | 'name': 'keyword.directive' 79 | '2': 80 | 'name': 'constant.numeric.decimal' 81 | '3': 82 | 'name': 'storage.type' 83 | 'comment': 'DC nB\'...\'' 84 | 'end': '(\')$' 85 | 'name': 'meta.dc.b' 86 | 'patterns': [ 87 | { 88 | 'match': '[0|1]' 89 | 'name': 'constant.numeric.binary' 90 | } 91 | { 92 | 'match': '\\S' 93 | 'name': 'invalid.illegal.binary' 94 | } 95 | ] 96 | } 97 | { 98 | 'begin': '\\b((?i)DC)\\s+(\\d*)([hH])(\')' 99 | 'beginCaptures': 100 | '1': 101 | 'name': 'keyword.directive' 102 | '2': 103 | 'name': 'constant.numeric.decimal' 104 | '3': 105 | 'name': 'storage.type' 106 | 'comment': 'dc nH\'...\'' 107 | 'end': '\'' 108 | 'name': 'meta.dc.h' 109 | 'patterns': [ 110 | { 111 | 'match': '[0-9A-Fa-f]' 112 | 'name': 'constant.numeric.hexidecimal' 113 | } 114 | { 115 | 'match': '\\S' 116 | 'name': 'invalid.illegal.hexidecimal' 117 | } 118 | ] 119 | } 120 | { 121 | 'begin': '\\b((?i)DC)\\s+(\\d*)([A-Za-z])(\\d*)(\')' 122 | 'beginCaptures': 123 | '1': 124 | 'name': 'keyword.directive' 125 | '2': 126 | 'name': 'constant.numeric.decimal' 127 | '3': 128 | 'name': 'storage.type' 129 | '4': 130 | 'name': 'constant.numeric.decimal' 131 | 'comment': 'DC nIn\'...\', DC C\'...\'' 132 | 'contentName': 'string.quited.single' 133 | 'end': '(\')|$' 134 | 'name': 'meta.dc.other' 135 | } 136 | { 137 | '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' 138 | 'name': 'keyword.directive' 139 | } 140 | { 141 | 'match': '\\b[aA]\\b' 142 | 'name': 'variable.language.register' 143 | } 144 | { 145 | 'match': '(?<=,)([xXyYsS])\\b' 146 | 'name': 'variable.language.register' 147 | } 148 | { 149 | 'match': '[=<>+-/|*#()^\\[\\]]|(<>|<=|>=)' 150 | 'name': 'keyword.operator' 151 | } 152 | { 153 | 'match': '(?i:\\.AND\\.|\\.EOR\\.|\\.OR\\.)' 154 | 'name': 'keyword.operator' 155 | } 156 | { 157 | 'match': '"[^"]*"' 158 | 'name': 'string.quoted.double' 159 | } 160 | { 161 | 'match': '\'[^\']*\'' 162 | 'name': 'string.quoted.single' 163 | } 164 | ] 165 | 'repository': 166 | 'M6502': 167 | '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' 168 | 'name': 'keyword.mnemonic.6502' 169 | 'M65816': 170 | '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' 171 | 'name': 'keyword.mnemonic.65816' 172 | 'M65816L': 173 | 'match': '\\b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\\b' 174 | 'name': 'keyword.mnemonic.65816.long' 175 | 'M65C02': 176 | 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' 177 | 'name': 'keyword.mnemonic.65c02' 178 | 'binary_number': 179 | 'match': '%[01]+' 180 | 'name': 'constant.numeric.binary' 181 | 'decimal_number': 182 | 'match': '\\b([0-9]+)\\b' 183 | 'name': 'constant.numeric.decimal' 184 | 'hex_number': 185 | 'match': '\\$[A-Fa-f0-9]+' 186 | 'name': 'constant.numeric.hex' 187 | 'octal_number': 188 | 'match': '@([0-7]+)\\b' 189 | 'name': 'constant.numeric.octal' 190 | 'scopeName': 'source.assembly.65816.orcam' 191 | -------------------------------------------------------------------------------- /grammars/asar.cson: -------------------------------------------------------------------------------- 1 | # Adds Syntax highlighting for the Asar SNES Assembler 2 | 3 | scopeName: 'source.assembly.65816.asar' 4 | fileTypes: [ 5 | 'asm' 6 | ] 7 | name: 'Asar SNES Assembler' 8 | patterns: [ 9 | { include: 'source.65816-opcodes' } 10 | { include: 'source.65816l-opcodes' } 11 | { include: 'source.65816alt-opcodes' } 12 | { include: 'source.spc700-opcodes' } 13 | { include: 'source.superfx-opcodes' } 14 | { include: '#comments' } 15 | { include: '#symbols' } 16 | { include: '#directives' } 17 | ] 18 | 19 | # Repository starts here ------------------------------------------------------ 20 | repository: 21 | 22 | # comments 23 | comments: 24 | patterns: [ 25 | # semicolon line comment 26 | { 27 | match: ';.*$' 28 | name: 'comment.line.semicolon.asar' 29 | } 30 | ] 31 | 32 | # symbols 33 | symbols: 34 | patterns: [ 35 | # delimited strings 36 | { 37 | begin: '"' 38 | beginCaptures: 39 | 0: name: 'punctuation.definition.string.begin.asar' 40 | end: '"' 41 | endCaptures: 42 | 0: name: 'punctuation.definition.string.end.asar' 43 | name: 'string.quoted.double.assembly.asar' 44 | } 45 | # labels 46 | { 47 | captures: 48 | 1: name: 'entity.name.function.label.asar' 49 | 2: name: 'entity.name.function.label.asar' 50 | match: '(\\.*)\\b([A-Za-z0-9_]+):' 51 | name: 'meta.label.asar' 52 | } 53 | # defines 54 | { 55 | captures: 56 | 1: name: 'keyword.operator.asar' 57 | 2: name: 'entity.name.function.label.asar' 58 | match: '(!)\\b([A-Za-z0-9_]+)\\b' 59 | name: 'meta.define.asar' 60 | } 61 | # absolut address/number 62 | { 63 | match: '\\#(\'.\'|[^\\s\']+)' 64 | name: 'constant.numeric.hex.asar' 65 | } 66 | # hex, prefixed with ampersand($) 67 | { 68 | match: '-?\\$[A-Fa-f0-9]+' 69 | name: 'constant.numeric.hex.asar' 70 | } 71 | # binary 72 | { 73 | match: '-?%[01]+' 74 | name: 'constant.numeric.binary.asar' 75 | } 76 | # decimal 77 | { 78 | match: '-?\\b([0-9]+)\\b' 79 | name: 'constant.numeric.decimal.asar' 80 | } 81 | ] 82 | 83 | # assembler directives 84 | directives: 85 | patterns: [ 86 | # arch command 87 | { 88 | captures: 89 | 1: name: 'support.function.pseudo.asar' 90 | 2: name: 'constant.language.asar' 91 | match: '\\b(arch)\\s+(65816|spc700(-inline)?|superfx)' 92 | name: 'meta.arch.directive.asar' 93 | } 94 | # warn xkas command 95 | { 96 | captures: 97 | 1: name: 'support.function.pseudo.asar' 98 | 2: name: 'support.function.pseudo.asar' 99 | 3: name: 'constant.language.asar' 100 | match: '\\b(warn)\\s+(xkas)\\s+(on|off)\\b' 101 | name: 'meta.warn.directive.asar' 102 | } 103 | # math command 104 | { 105 | captures: 106 | 1: name: 'support.function.pseudo.asar' 107 | 2: name: 'support.function.pseudo.asar' 108 | 3: name: 'constant.language.asar' 109 | match: '\\b(math)\\s+(pri|round)\\s+(on|off)\\b' 110 | name: 'meta.math.directive.asar' 111 | } 112 | # namespace command 113 | { 114 | begin: '\\b(namespace)\\b' 115 | captures: 116 | 1: 117 | name: 'support.function.pseudo.asar' 118 | end: '$' 119 | name: 'meta.namespace.directive.asar' 120 | patterns: [ 121 | # nested 122 | { 123 | captures: 124 | 1: name: 'support.function.pseudo.asar' 125 | 2: name: 'constant.language.asar' 126 | match: '\\b(nested)\\s+(on|off)\\b' 127 | name: 'meta.namespace.nested.asar' 128 | } 129 | # off 130 | { 131 | match: '\\b(off)\\b' 132 | name: 'constant.language.asar' 133 | } 134 | # identifier 135 | { 136 | match: '\\b[a-zA-Z0-9_]+\\b' 137 | name: 'entity.name.function.label.asar' 138 | } 139 | ] 140 | } 141 | # base command 142 | { 143 | captures: 144 | 1: name: 'support.function.pseudo.asar' 145 | 2: name: 'constant.language.asar' 146 | match: '\\b(base)\\s+(off)*' 147 | name: 'meta.base.directive.asar' 148 | } 149 | # bank command 150 | { 151 | captures: 152 | 1: name: 'support.function.pseudo.asar' 153 | 2: name: 'constant.language.asar' 154 | match: '\\b(bank)\\s+(noassume|auto)*' 155 | name: 'meta.bank.directive.asar' 156 | } 157 | # struct command 158 | { 159 | captures: 160 | 1: name: 'support.function.pseudo.asar' 161 | 2: name: 'entity.name.function.label.asar' 162 | 3: name: 'constant.numeric.hex.asar' 163 | match: '\\b(struct)\\s+([a-zA-Z0-9_]+)\\s+(\\S+)\\b' 164 | name: 'meta.struct.directive.asar' 165 | } 166 | # endstruct command 167 | { 168 | captures: 169 | 1: name: 'support.function.pseudo.asar' 170 | 2: name: 'support.function.pseudo.asar' 171 | 3: name: 'constant.numeric.decimal.asar' 172 | match: '\\b(endstruct)\\s+(align)*\\s+(\\S+)*' 173 | name: 'meta.struct.directive.asar' 174 | } 175 | # data control 176 | { 177 | match: '\\b(inc(bin|src)|(push|pull)(pc|base)|warnpc|skip|asar|org|rep|d[bdlw]|(ex)?(lo|hi)rom|(full)?sa1rom|(no|sfx)rom|function)\\b' 178 | name: 'support.function.pseudo.asar' 179 | } 180 | # conditional control 181 | { 182 | match: '\\b((end)?if)\\b' 183 | name: 'keyword.control.conditional.asar' 184 | } 185 | # macro control 186 | # TODO: fix identifier 187 | { 188 | match: '\\b((end)?macro)\\b' 189 | # name: 'support.function.pseudo.asar' 190 | name: 'keyword.directive.macro.asar' 191 | } 192 | # operators 193 | { 194 | match: '[-+/*^><|#\\[\\]()=.!&]' 195 | name: 'keyword.operator.asar' 196 | } 197 | # TODO: Add built-in functions 198 | ] 199 | -------------------------------------------------------------------------------- /grammars/merlin.cson: -------------------------------------------------------------------------------- 1 | scopeName: 'source.assembly.65816.merlin' 2 | fileTypes: [] 3 | name: 'Merlin' 4 | patterns: [ 5 | { include: 'source.65c02-opcodes' } 6 | { include: 'source.65816-opcodes' } 7 | { include: 'source.65816l-opcodes' } 8 | { include: 'source.65816alt-opcodes' } 9 | { include: '#comments' } 10 | { include: '#symbols' } 11 | { include: '#directives' } 12 | # registers 13 | # TODO: fix registers 14 | # { 15 | # 'match': '(?<=,)([xXyYsS])\\b' 16 | # 'name': 'variable.language.register' 17 | # } 18 | ] 19 | 20 | 21 | repository: 22 | 23 | # comments 24 | comments: 25 | patterns: [ 26 | # asterisk line comment 27 | { 28 | match: '^[*].*' 29 | name: 'comment.line.asterisk.merlin' 30 | } 31 | # semicolon line comment 32 | { 33 | match: ';.*$' 34 | name: 'comment.line.semicolon.merlin' 35 | } 36 | ] 37 | 38 | # symbols 39 | symbols: 40 | patterns: [ 41 | # delimited strings 42 | { 43 | begin: '[\'"]' 44 | beginCaptures: 45 | 0: name: 'punctuation.definition.string.begin.merlin' 46 | end: '[\'"]' 47 | endCaptures: 48 | 0: name: 'punctuation.definition.string.end.merlin' 49 | name: 'string.quoted.double.assembly.merlin' 50 | } 51 | # TODO: highlight strings with all valid delimiters 52 | # { 53 | # captures: 54 | # 1: name: 'string.delimited.begin.merlin' 55 | # 2: name: 'string.delimited.merlin' 56 | # 3: name: 'string.delimited.end.merlin' 57 | # match: '\\b(\\S)(.*?)(\\1)\\b' 58 | # } 59 | # TODO: fix label scopes 60 | # Variables 61 | { 62 | match: '^][:-~][0-~]+' 63 | # name: 'variable.named.merlin' 64 | name: 'entity.name.function.label.merlin' 65 | } 66 | # Local labels 67 | { 68 | match: '^:[:-~][0-~]+' 69 | name: 'entity.name.function.label.merlin' 70 | } 71 | # Global labels 72 | { 73 | match: '^[:-~][0-~]+' 74 | name: 'entity.name.function.merlin' 75 | } 76 | # absolut address/number 77 | { 78 | match: '\\#(\'.\'|[^\\s\']+)' 79 | name: 'constant.numeric.hex.merlin' 80 | } 81 | # hex, prefixed with ampersand($) 82 | { 83 | match: '-?\\$[A-Fa-f0-9]+' 84 | name: 'constant.numeric.hex.merlin' 85 | } 86 | # octal, prefixed with @ 87 | { 88 | match: '@([0-7]+)\\b' 89 | name: 'constant.numeric.octal.merlin' 90 | } 91 | # binary 92 | { 93 | match: '%[01]+' 94 | name: 'constant.numeric.binary.merlin' 95 | } 96 | # decimal 97 | { 98 | match: '\\b([0-9]+)\\b' 99 | name: 'constant.numeric.decimal.merlin' 100 | } 101 | ] 102 | 103 | # assembler directives 104 | directives: 105 | patterns: [ 106 | # file control 107 | { 108 | match: '\\b(?i:equ|ext|ent|org|rel|obj|var|typ|end|dum|dend|ast|dat|lstdo|pag|ttl|skp|chk|err|kbd|lup|--\\^|mx|pau|sw|usr|xc)\\b' 109 | name: 'keyword.directive.merlin' 110 | } 111 | # data control 112 | { 113 | match: '\\b(?i:da|dw|ddb|db|dfb|adr|adrl|ds)\\b' 114 | name: 'support.function.pseudo.merlin' 115 | } 116 | # conditional control 117 | { 118 | match: '\\b(?i:do|else|if|fin)\\b' 119 | name: 'keyword.control.conditional.merlin' 120 | } 121 | # macro control 122 | { 123 | match: '\\b(?i:mac)\\b|<<<' 124 | name: 'support.function.pseudo.merlin' 125 | # name: 'keyword.directive.macro.merlin' 126 | } 127 | # operators 128 | { 129 | match: '[-+/*^><|#\\[\\](),=.!&]' 130 | name: 'keyword.operator.merlin' 131 | } 132 | # disk commands 133 | { 134 | captures: 135 | 1: name: 'support.function.pseudo.merlin' 136 | 2: name: 'string.quoted.other.path.merlin' 137 | match: '\\b((?i:dsk|put|use|sav))\\s+(\\S*)' 138 | name: 'meta.disk.directive.merlin' 139 | } 140 | # cycle count 141 | { 142 | captures: 143 | 1: name: 'support.function.pseudo.merlin' 144 | 2: name: 'constant.language.merlin' 145 | match: '\\b((?i:cyc))\\s+((?i:on|off|ave))\\b' 146 | name: 'meta.cyc.directive.merlin' 147 | } 148 | # expand control 149 | { 150 | captures: 151 | 1: name: 'support.function.pseudo.merlin' 152 | 2: name: 'constant.language.merlin' 153 | match: '\\b((?i:exp))\\s+((?i:on|off|only))\\b' 154 | name: 'meta.exp.directive.merlin' 155 | } 156 | # list control 157 | { 158 | captures: 159 | 1: name: 'support.function.pseudo.merlin' 160 | 2: name: 'constant.language.merlin' 161 | match: '\\b((?i:lst))\\s+((?i:off))\\b' 162 | name: 'meta.exp.directive.merlin' 163 | } 164 | # truncation control 165 | { 166 | captures: 167 | 1: name: 'support.function.pseudo.merlin' 168 | 2: name: 'constant.language.merlin' 169 | match: '\\b((?i:tr))\\s+((?i:on|off|adr))\\b' 170 | name: 'meta.tr.directive.merlin' 171 | } 172 | # string command 173 | { 174 | captures: 175 | 1: name: 'support.function.pseudo.merlin' 176 | 2: name: 'string.delimited.begin.merlin' 177 | 3: name: 'string.delimited.merlin' 178 | 4: name: 'string.delimited.end.merlin' 179 | 5: name: 'constant.numeric.hex.merlin' 180 | match: '\\b((?i:asc|dci|inv|fls|str))\\s+(\\S)(.*?)(\\2|\\S),([a-fA-F0-9]+)?' 181 | } 182 | # reverse command 183 | { 184 | captures: 185 | 1: name: 'support.function.pseudo.merlin' 186 | 2: name: 'string.delimited.begin.merlin' 187 | 3: name: 'string.delimited.merlin' 188 | 4: name: 'string.delimited.end.merlin' 189 | match: '\\b((?i:rev))\\s+(\\S)(.*?)(\\2|$)' 190 | } 191 | # hex command 192 | { 193 | begin: '\\b((?i:hex))\\b' 194 | captures: 195 | 1: 196 | name: 'support.function.pseudo.merlin' 197 | end: '$' 198 | name: 'meta.hex.directive.merlin' 199 | patterns: [ 200 | # hex without $ 201 | { 202 | match: '\\b[a-fA-F0-9]{1,2}\\b' 203 | name: 'constant.numeric.hex.merlin' 204 | } 205 | # semicolon comments 206 | { 207 | match: ';.*' 208 | name: 'comment.line.semicolon.merlin' 209 | } 210 | # number check 211 | { 212 | match: '(?!,)\\S' 213 | name: 'invalid.illegal.merlin' 214 | } 215 | ] 216 | } 217 | ] 218 | -------------------------------------------------------------------------------- /grammars/mpw.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': [ 2 | 'aii' 3 | ] 4 | 'name': 'MPW IIgs Assembler' 5 | 'patterns': [ 6 | { 7 | 'include': '#M6502' 8 | } 9 | { 10 | 'include': '#M65C02' 11 | } 12 | { 13 | 'include': '#M65816' 14 | } 15 | { 16 | 'include': '#hex_number' 17 | } 18 | { 19 | 'include': '#binary_number' 20 | } 21 | { 22 | 'include': '#decimal_number' 23 | } 24 | { 25 | 'match': '\\b(?i:BLT|BGE|CPA|DEA|INA|SWA|TAS|TSA)\\b' 26 | 'name': 'keyword.mnemonic.65816.alt' 27 | } 28 | { 29 | 'comment': 'Rockwell/m740' 30 | 'match': '\\b(?:BBC|BBR|BBS|CLB|RMB|SEB|SMB)[0-9]\\b' 31 | 'name': 'keyword.mnemonic.other' 32 | } 33 | { 34 | 'comment': 'Rockwell/m740' 35 | 'match': '\\b(?i:CLT|COM|LDM|RRF|SETT|TST)\\b' 36 | 'name': 'keyword.mnemonic.other' 37 | } 38 | { 39 | 'captures': 40 | '1': 41 | 'name': 'entity.name.function' 42 | '2': 43 | 'name': 'keyword.directive' 44 | 'match': '^([A-Za-z@_~][A-Za-z0-9@_~%$#]*)\\s+((?i)PROC|PROCNAME|FUNC|INIT|STACKDP)\\b' 45 | 'name': 'meta.function' 46 | } 47 | { 48 | 'captures': 49 | '1': 50 | 'name': 'keyword.directive' 51 | '2': 52 | 'name': 'entity.name.function' 53 | 'match': '\\b((?i)ENTRY)\\s+([A-Za-z@_~][A-Za-z0-9@_~%$#]*)\\b' 54 | 'name': 'meta.entry' 55 | } 56 | { 57 | 'captures': 58 | '1': 59 | 'name': 'entity.name.record' 60 | '2': 61 | 'name': 'keyword.directive' 62 | 'match': '^([A-Za-z@_~][A-Za-z0-9@_~%$#]*)\\s+((?i)RECORD)\\b' 63 | 'name': 'meta.record' 64 | } 65 | { 66 | 'match': '^[A-Za-z@_~][A-Za-z0-9@_~%$#]*\\b' 67 | 'name': 'entity.name.label' 68 | } 69 | { 70 | 'match': '(?<=,)([xXyYsS])\\b' 71 | 'name': 'variable.language.register' 72 | } 73 | { 74 | 'match': '\\b(?i:NOT|DIV|MOD|AND|OR|XOR|EOR)\\b' 75 | 'name': 'keyword.operator' 76 | } 77 | { 78 | 'begin': '"' 79 | 'end': '"' 80 | 'name': 'string.quoted.double' 81 | } 82 | { 83 | 'begin': '\'' 84 | 'end': '\'' 85 | 'name': 'string.quoted.single' 86 | } 87 | { 88 | 'match': '^[*;].*' 89 | 'name': 'comment.line' 90 | } 91 | { 92 | 'match': ';.*' 93 | 'name': 'comment.line' 94 | } 95 | { 96 | 'match': '[=<>+-/|*#()^]|(<>|<=|>=)' 97 | 'name': 'keyword.operator' 98 | } 99 | { 100 | 'match': '\\b(?i:NOT|DIV|MOD|AND|OR|XOR|EOR)\\b' 101 | 'name': 'keyword.operator' 102 | } 103 | { 104 | 'begin': '\\b((?i)MACRO)\\b' 105 | 'captures': 106 | '1': 107 | 'name': 'keyword.directive' 108 | '2': 109 | 'name': 'keyword.directive' 110 | 'comment': 'enable &# macro parameters w/in a MAC ... ^^^ definition.' 111 | 'end': '\\b((?i)ENDMACRO|ENDM|MEND)\\b' 112 | 'name': 'meta.macro' 113 | 'patterns': [ 114 | { 115 | 'include': '$self' 116 | } 117 | { 118 | 'match': '&[A-Za-z][A-Za-z0-9]*' 119 | 'name': 'variable.parameter' 120 | } 121 | ] 122 | } 123 | { 124 | 'captures': 125 | '1': 126 | 'name': 'keyword.directive' 127 | '2': 128 | 'name': 'constant.language' 129 | 'comment': 'eg: LONGA ON' 130 | 'match': '\\b((?i)CODECHK|DATACHK|LONGA|LONGI|MSB)\\s+((?i)ON|OFF)\\b' 131 | 'name': 'meta.onoff.directive' 132 | } 133 | { 134 | 'captures': 135 | '1': 136 | 'name': 'keyword.directive' 137 | '2': 138 | 'name': 'constant.language' 139 | 'match': '\\b((?i)STRING)\\s+((?i)ASIS|PASCAL|C|GS/OS)\\b' 140 | 'name': 'meta.string.directive' 141 | } 142 | { 143 | 'captures': 144 | '1': 145 | 'name': 'keyword.directive' 146 | '2': 147 | 'name': 'constant.language' 148 | 'match': '\\b((?i)BLANKS)\\s+((?i)ON|OFF|YES|NO|Y|N)\\b' 149 | 'name': 'meta.blanks.directive' 150 | } 151 | { 152 | 'captures': 153 | '1': 154 | 'name': 'keyword.directive' 155 | '2': 156 | 'name': 'constant.language' 157 | 'match': '\\b((?i)BLANKS)\\s+((?i)ON|OFF|YES|NO|Y|N|OBJECT|OBJ)\\b' 158 | 'name': 'meta.case.directive' 159 | } 160 | { 161 | 'captures': 162 | '1': 163 | 'name': 'keyword.directive' 164 | '2': 165 | 'name': 'constant.language' 166 | 'match': '\\b((?i)MACHINE)\\s+((?i)M65816|M6502|M65C02|M65CX02|M740)\\b' 167 | 'name': 'meta.machine.directive' 168 | } 169 | { 170 | 'begin': '\\b((?i)PRINT)\\b' 171 | 'beginCaptures': 172 | '1': 173 | 'name': 'keyword.directive' 174 | 'end': '$' 175 | 'name': 'meta.print.directive' 176 | 'patterns': [ 177 | { 178 | 'match': ';.*' 179 | 'name': 'comment.line' 180 | } 181 | { 182 | 'match': '\\b(?i:ON|OFF|PUSH|POP)\\b' 183 | 'name': 'constant.language' 184 | } 185 | { 186 | 'match': '\\b(?i:NO)?(?i:GEN|PAGE|WARN|MCALL|OBJ|DATA|MDIR|HDR|LITS|STAT|SYM)\\b' 187 | 'name': 'constant.language' 188 | } 189 | { 190 | 'match': '[^,\\t ]' 191 | 'name': 'invalid.illegal.operand' 192 | } 193 | ] 194 | } 195 | { 196 | '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' 197 | 'name': 'keyword.directive' 198 | } 199 | { 200 | 'captures': 201 | '1': 202 | 'name': 'keyword.directive.data' 203 | '3': 204 | 'name': 'storage.type' 205 | 'match': '\\b((?i)DC|DCB|DS)([.](.))?\\b' 206 | 'name': 'meta.dc.directive' 207 | } 208 | { 209 | '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' 210 | 'name': 'support.function.macro' 211 | } 212 | { 213 | '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' 214 | 'name': 'support.function.macro' 215 | } 216 | ] 217 | 'repository': 218 | 'M6502': 219 | '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' 220 | 'name': 'keyword.mnemonic.6502' 221 | 'M65816': 222 | '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' 223 | 'name': 'keyword.mnemonic.65816' 224 | 'M65816L': 225 | 'match': '\\b(?i:ADCL|ANDL|CMPL|EORL|LDAL|ORAL|SBCL|STAL)\\b' 226 | 'name': 'keyword.mnemonic.65816.long' 227 | 'M65C02': 228 | 'match': '\\b(?i:BRA|PHX|PHY|PLX|PLY|STP|STZ|TRB|TSB|WAI)\\b' 229 | 'name': 'keyword.mnemonic.65c02' 230 | 'binary_number': 231 | 'match': '%[01]+' 232 | 'name': 'constant.numeric.binary' 233 | 'decimal_number': 234 | 'match': '\\b([0-9]+)\\b' 235 | 'name': 'constant.numeric.decimal' 236 | 'hex_number': 237 | 'match': '\\$[A-Fa-f0-9]+' 238 | 'name': 'constant.numeric.hex' 239 | 'octal_number': 240 | 'match': '@([0-7]+)\\b' 241 | 'name': 'constant.numeric.octal' 242 | 'scopeName': 'source.assembly.65816.mpw' 243 | --------------------------------------------------------------------------------