main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | 'use strict'
|
---|
2 |
|
---|
3 | module.exports = asm6502
|
---|
4 | asm6502.displayName = 'asm6502'
|
---|
5 | asm6502.aliases = []
|
---|
6 | function asm6502(Prism) {
|
---|
7 | Prism.languages.asm6502 = {
|
---|
8 | comment: /;.*/,
|
---|
9 | directive: {
|
---|
10 | pattern: /\.\w+(?= )/,
|
---|
11 | alias: 'property'
|
---|
12 | },
|
---|
13 | string: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,
|
---|
14 | 'op-code': {
|
---|
15 | pattern:
|
---|
16 | /\b(?: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|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/,
|
---|
17 | alias: 'keyword'
|
---|
18 | },
|
---|
19 | 'hex-number': {
|
---|
20 | pattern: /#?\$[\da-f]{1,4}\b/i,
|
---|
21 | alias: 'number'
|
---|
22 | },
|
---|
23 | 'binary-number': {
|
---|
24 | pattern: /#?%[01]+\b/,
|
---|
25 | alias: 'number'
|
---|
26 | },
|
---|
27 | 'decimal-number': {
|
---|
28 | pattern: /#?\b\d+\b/,
|
---|
29 | alias: 'number'
|
---|
30 | },
|
---|
31 | register: {
|
---|
32 | pattern: /\b[xya]\b/i,
|
---|
33 | alias: 'variable'
|
---|
34 | },
|
---|
35 | punctuation: /[(),:]/
|
---|
36 | }
|
---|
37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.