UNPKG

936 BJavaScriptView Raw
1Prism.languages.asm6502 = {
2 'comment': /;.*/,
3 'directive': {
4 pattern: /\.\w+(?= )/,
5 alias: 'keyword'
6 },
7 'string': /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,
8 'opcode': {
9 pattern: /\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/,
10 alias: 'property'
11 },
12 'hexnumber': {
13 pattern: /#?\$[\da-f]{2,4}\b/i,
14 alias: 'string'
15 },
16 'binarynumber': {
17 pattern: /#?%[01]+\b/,
18 alias: 'string'
19 },
20 'decimalnumber': {
21 pattern: /#?\b\d+\b/,
22 alias: 'string'
23 },
24 'register': {
25 pattern: /\b[xya]\b/i,
26 alias: 'variable'
27 }
28};