language-65asm/grammars/6502-opcodes.cson
2018-03-20 20:54:24 +01:00

36 lines
1.3 KiB
Plaintext

# Syntax Highlighting for the basic instruction set of the 6502 microprocessor.
# This file only contains rules for 6502 mnemonics. The rules here are used by
# other grammars only that add rules for comments, symbols, etc.
scopeName: 'source.6502-opcodes'
patterns: [
# The basic 6502 instruction set
{
include: '#mnemonics-6502'
}
]
# Respository starts here -----------------------------------------------------
repository:
# basic 6502 instruction set
'mnemonics-6502':
patterns: [
# mnemonics
{
match: '\\b(?i:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA)\\b'
name: 'keyword.mnemonic.6502.6502-opcodes'
}
]
# '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'