2017-08-21 19:37:14 +00:00
|
|
|
%YAML 1.2
|
|
|
|
---
|
|
|
|
name: ORCA/M Assembler
|
|
|
|
file_extensions: [src, s]
|
|
|
|
scope: source.asm.65816.orcam
|
|
|
|
|
|
|
|
variables:
|
|
|
|
ws: '[ \t]+'
|
|
|
|
ident: '[_~A-Za-z][_~A-Za-z0-9]*'
|
|
|
|
|
|
|
|
contexts:
|
2017-09-17 00:59:13 +00:00
|
|
|
|
2017-08-21 19:37:14 +00:00
|
|
|
main:
|
|
|
|
|
|
|
|
- meta_include_prototype: false
|
|
|
|
- match: '{{ws}}'
|
2017-09-17 00:59:13 +00:00
|
|
|
set: opcode
|
2017-08-21 19:37:14 +00:00
|
|
|
|
|
|
|
- match: '^({{ident}}){{ws}}((?i)START|PRIVATE|DATA|PRIVDATA)\b'
|
|
|
|
captures:
|
|
|
|
1: entity.name.function
|
|
|
|
2: keyword.directive
|
2017-09-17 00:59:13 +00:00
|
|
|
set: operand-segname
|
2017-08-21 19:37:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
- match: '^{{ident}}'
|
|
|
|
scope: entity.name.label
|
|
|
|
|
2017-09-17 00:59:13 +00:00
|
|
|
- match: ^[*;!.].*$
|
|
|
|
scope: comment.line
|
2017-08-21 19:37:14 +00:00
|
|
|
|
|
|
|
opcode:
|
2017-09-17 00:59:13 +00:00
|
|
|
- include: comment
|
|
|
|
|
|
|
|
- include: scope:source.asm.65816#mnemonics-6502
|
|
|
|
- include: scope:source.asm.65816#mnemonics-65c02
|
|
|
|
- include: scope:source.asm.65816#mnemonics-65816
|
2017-08-21 19:37:14 +00:00
|
|
|
- include: mnemonics-65816-alt
|
|
|
|
|
|
|
|
- match: \b(?i:DC)\b
|
|
|
|
scope: keyword.directive
|
|
|
|
set: operand-dc
|
|
|
|
|
|
|
|
- match: \b(?i:APPEND|COPY|KEEP|MCOPY)\b
|
|
|
|
scope: keyword.control.import
|
|
|
|
set: operand-path
|
|
|
|
|
|
|
|
|
|
|
|
- match: \b(?i:ABSADDR|CASE|CODECHK|DATACHECK|DYNCHK|ERR|EXPAND|IEEE|INSTIME|LIST|LONGA|LONGI|MSB|NUMSEX|OBJCASE|PRINTER|SYMBOL|65C02|65816)\b
|
|
|
|
scope: keyword.directive
|
|
|
|
set: operand-on-off
|
|
|
|
|
2017-09-17 00:59:13 +00:00
|
|
|
- match: \b(?i:DIRECT)\b
|
|
|
|
scope: keyword.directive
|
|
|
|
set: operand-or-off
|
|
|
|
|
|
|
|
- match: \b(?i:ALIGN|DS|EQU|GEQU|KIND|MERR|ORG|RENAME|SETCOM)\b
|
|
|
|
scope: keyword.directive
|
|
|
|
set: operand
|
|
|
|
|
|
|
|
# using label
|
|
|
|
- match: \b(?i:USING)\b
|
|
|
|
scope: keyword.directive
|
|
|
|
set: operand-label
|
|
|
|
|
|
|
|
|
|
|
|
- match: \b(?i:ANOP|EJECT|END|ENTRY|OBJEND)\b
|
|
|
|
scope: keyword.directive
|
|
|
|
set: expect-comment
|
|
|
|
|
|
|
|
- match: \b(?i:START|PRIVATE|DATA|PRIVDATA)\b
|
|
|
|
scope: keyword.directive
|
|
|
|
set: operand-segname
|
|
|
|
|
|
|
|
- match: \b(?i:TITLE)\b
|
|
|
|
scope: keyword.directive
|
|
|
|
set: operand-title
|
2017-08-21 19:37:14 +00:00
|
|
|
|
|
|
|
|
2017-09-17 00:59:13 +00:00
|
|
|
- match: \b(?i:MEM)\b
|
|
|
|
scope: invalid.deprecated
|
|
|
|
set: operand
|
|
|
|
|
2017-08-21 19:37:14 +00:00
|
|
|
|
|
|
|
- match: '{{ws}}'
|
|
|
|
set: operand
|
|
|
|
|
|
|
|
operand:
|
2017-09-17 00:59:13 +00:00
|
|
|
- include: comment
|
2017-08-21 19:37:14 +00:00
|
|
|
- include: numbers
|
|
|
|
- include: strings
|
|
|
|
|
2017-09-17 00:59:13 +00:00
|
|
|
operand-label:
|
|
|
|
- match: '\b{{ident}}\b'
|
|
|
|
set: expect-comment
|
|
|
|
- include: need-operand
|
|
|
|
|
|
|
|
need-operand:
|
|
|
|
- match: '\n'
|
|
|
|
scope: invalid.illegal.operand
|
|
|
|
set: main
|
|
|
|
- match: '\S'
|
|
|
|
scope: invalid.illegal.operand
|
|
|
|
|
|
|
|
operand-or-off:
|
|
|
|
- include: comment
|
|
|
|
|
|
|
|
- match: \b(?i:OFF)\b
|
|
|
|
scope: constant.language
|
|
|
|
set: expect-comment
|
|
|
|
- include: operand
|
|
|
|
|
|
|
|
|
|
|
|
# optional label.
|
|
|
|
operand-segname:
|
|
|
|
- match: '\b{{ident}}\b'
|
|
|
|
set: expect-comment
|
|
|
|
- include: expect-comment
|
|
|
|
|
|
|
|
operand-title:
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.begin
|
|
|
|
set:
|
|
|
|
- meta_include_prototype: false
|
|
|
|
- meta_scope: string.quoted.single
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.end
|
|
|
|
set: expect-comment
|
|
|
|
- match: \n
|
|
|
|
scope: invalid.illegal.newline.asm
|
|
|
|
set: main
|
|
|
|
|
|
|
|
- match: '([^ \t\n;]+)'
|
|
|
|
scope: string.unquoted
|
|
|
|
set: expect-comment
|
|
|
|
|
|
|
|
|
2017-08-21 19:37:14 +00:00
|
|
|
|
|
|
|
operand-on-off:
|
2017-09-17 00:59:13 +00:00
|
|
|
- include: comment
|
2017-08-21 19:37:14 +00:00
|
|
|
- match: \b(?i:ON|OFF)\b
|
|
|
|
scope: constant.language
|
|
|
|
set: expect-comment
|
|
|
|
- match: \S
|
|
|
|
scope: invalid.illegal.operand
|
|
|
|
|
|
|
|
operand-path:
|
|
|
|
- match: '([^ \t\n;]+)'
|
|
|
|
scope: string.unquoted
|
|
|
|
set: expect-comment
|
|
|
|
|
|
|
|
operand-dc:
|
|
|
|
# dc nB
|
|
|
|
# dc nH
|
|
|
|
# dc nX
|
|
|
|
|
|
|
|
- match: \d+
|
|
|
|
scope: constant.numeric
|
|
|
|
set: operand-dc-format
|
|
|
|
- include: operand-dc-format
|
|
|
|
|
|
|
|
operand-dc-format:
|
|
|
|
|
2017-09-17 00:59:13 +00:00
|
|
|
- include: comment
|
|
|
|
|
2017-08-21 19:37:14 +00:00
|
|
|
- match: ([bB])
|
|
|
|
scope: storage.type
|
|
|
|
set: operand-dc-b
|
|
|
|
|
|
|
|
- match: ([cC])
|
|
|
|
scope: storage.type
|
|
|
|
set: operand-dc-c
|
|
|
|
|
|
|
|
|
|
|
|
- match: ([hH])
|
|
|
|
scope: storage.type
|
|
|
|
set: operand-dc-h
|
|
|
|
|
|
|
|
- match: ((?i)[ABCDEFHIRS])(\d+)?
|
|
|
|
captures:
|
|
|
|
1: storage.type
|
|
|
|
2: constant.numeric
|
|
|
|
set: operand-dc-other
|
|
|
|
|
|
|
|
- match: '[^ \t,]'
|
|
|
|
scope: invalid.illegal.operand
|
|
|
|
set: operand-dc-other
|
|
|
|
|
|
|
|
operand-dc-b:
|
|
|
|
# '[01]+'
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.begin
|
|
|
|
set:
|
|
|
|
- meta_include_prototype: false
|
|
|
|
- meta_scope: string.quoted.single
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.end
|
|
|
|
set: operand-dc
|
|
|
|
|
|
|
|
- match: \n
|
|
|
|
scope: invalid.illegal.newline
|
|
|
|
pop: true
|
|
|
|
|
|
|
|
- match: '[^01]'
|
|
|
|
scope: invalid.illegal
|
|
|
|
|
|
|
|
operand-dc-h:
|
|
|
|
# '[A-Fa-f0-9]+'
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.begin
|
|
|
|
set:
|
|
|
|
- meta_include_prototype: false
|
|
|
|
- meta_scope: string.quoted.single
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.end
|
|
|
|
set: operand-dc
|
|
|
|
|
|
|
|
- match: \n
|
|
|
|
scope: invalid.illegal.newline
|
|
|
|
pop: true
|
|
|
|
|
|
|
|
- match: '[^A-Fa-f0-9\t ]'
|
|
|
|
scope: invalid.illegal
|
|
|
|
|
|
|
|
operand-dc-c:
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.begin
|
|
|
|
set:
|
|
|
|
- meta_include_prototype: false
|
|
|
|
- meta_scope: string.quoted.single
|
2017-09-17 01:15:30 +00:00
|
|
|
- match: \''|[^'\n] # '' to escape
|
2017-08-21 19:37:14 +00:00
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.end
|
|
|
|
set: operand-dc
|
|
|
|
|
|
|
|
- match: \n
|
|
|
|
scope: invalid.illegal.newline
|
|
|
|
pop: true
|
|
|
|
|
|
|
|
|
|
|
|
operand-dc-other:
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.begin
|
|
|
|
set:
|
|
|
|
- meta_include_prototype: false
|
|
|
|
- meta_scope: string.quoted.single
|
|
|
|
- include: numbers
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.end
|
|
|
|
set: operand-dc
|
|
|
|
|
|
|
|
- match: \n
|
|
|
|
scope: invalid.illegal.newline.asm
|
|
|
|
pop: true
|
|
|
|
|
|
|
|
|
|
|
|
expect-comment:
|
2017-09-17 00:59:13 +00:00
|
|
|
- include: comment
|
2017-08-21 19:37:14 +00:00
|
|
|
- match: \S
|
|
|
|
scope: invalid.illegal.expect.comment
|
|
|
|
|
|
|
|
|
|
|
|
comment:
|
|
|
|
- match: ;[^\n]*
|
|
|
|
scope: comment.line.partial
|
2017-09-17 00:59:13 +00:00
|
|
|
- match: '$'
|
|
|
|
set: main
|
2017-08-21 19:37:14 +00:00
|
|
|
|
|
|
|
numbers:
|
|
|
|
- match: \d+
|
|
|
|
scope: constant.numeric
|
|
|
|
- match: \$[0-9a-fA-F]+
|
|
|
|
scope: constant.numeric.hex
|
|
|
|
- match: \%[01]+
|
|
|
|
scope: constant.numeric.binary
|
|
|
|
- match: \@[0-7]+
|
|
|
|
scope: constant.numeric.octal
|
|
|
|
|
|
|
|
strings:
|
2017-09-17 00:59:13 +00:00
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.begin
|
|
|
|
push:
|
|
|
|
- meta_include_prototype: false
|
|
|
|
- meta_scope: string.quoted.single
|
2017-09-17 01:15:30 +00:00
|
|
|
- match: \''|[^'\n] # '' to escape
|
2017-09-17 00:59:13 +00:00
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.end
|
|
|
|
pop: true
|
|
|
|
- match: \n
|
|
|
|
scope: invalid.illegal.newline.asm
|
|
|
|
pop: true
|
|
|
|
- match: '"'
|
|
|
|
scope: punctuation.definition.string.begin
|
|
|
|
push:
|
|
|
|
- meta_include_prototype: false
|
|
|
|
- meta_scope: string.quoted.double
|
2017-09-17 01:15:30 +00:00
|
|
|
- match: \""|[^"\n] # '' to escape
|
2017-09-17 00:59:13 +00:00
|
|
|
- match: '"'
|
|
|
|
scope: punctuation.definition.string.end
|
|
|
|
pop: true
|
|
|
|
- match: \n
|
|
|
|
scope: invalid.illegal.newline.asm
|
|
|
|
pop: true
|
|
|
|
|
|
|
|
string:
|
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.begin
|
|
|
|
push:
|
|
|
|
- meta_include_prototype: false
|
|
|
|
- meta_scope: string.quoted.single
|
2017-09-17 01:15:30 +00:00
|
|
|
- match: \''|[^'\n] # '' to escape
|
2017-09-17 00:59:13 +00:00
|
|
|
- match: "'"
|
|
|
|
scope: punctuation.definition.string.end
|
|
|
|
pop: true
|
|
|
|
- match: \n
|
|
|
|
scope: invalid.illegal.newline.asm
|
|
|
|
pop: true
|
2017-08-21 19:37:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mnemonics-65816-alt:
|
|
|
|
- match: \b(?i:BLT|BGE|CPA)\b
|
|
|
|
scope: keyword.mnemonic.65816.alt
|
|
|
|
|