-
Notifications
You must be signed in to change notification settings - Fork 11
/
avr-asm.JSON-tmLanguage
107 lines (89 loc) · 3.43 KB
/
avr-asm.JSON-tmLanguage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
"name": "AVR ASM",
"scopeName": "source.asm",
"fileTypes": ["asm", "inc"],
"patterns": [
{
"match": "(?i)\\br(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)\\b",
"name": "storage.type.asm",
"comment": "General perpose register set"
},
{
"match": "(?i)\\b(xl|xh|yl|yh|zl|zh)\\b",
"name": "storage.type.asm",
"comment": "General perpose register set (16-bit pointers)"
},
{
"match": "(?i)\\b(add|adc|adiw|sub|subi|sbc|sbci|sbiw|fmul|fmuls|fmulsu|and|andi|or|ori|eor|com|neg|sbr|cbr|inc|dec|tst|clr|ser)\\b",
"name": "keyword.operator.asm",
"comment": "Arithmetic and logic instruction mnemonics"
},
{
"match": "(?i)\\b(eijmp|rjmp|ijmp|eicall|icall|rcall|ret|reti|cpse|cp|cpc|cpi|sbrc|sbrs|sbic|sbis|brbs|brbc|breq|brne|brcs|brcc|brsh|brlo|brmi|brpl|brge|brlt|brhs|brhc|brts|brtc|brvs|brvc|brie|brid)\\b",
"name": "keyword.operator.asm",
"comment": "Branch instruction mnemonics"
},
{
"match": "(?i)\\b(sbi|cbi|lsl|lsr|rol|ror|asr|swap|bset|bclr|bst|bld|sec|clc|sen|cln|sez|clz|sei|cli|ses|cls|sev|clv|set|clt|seh|clh)\\b",
"name": "keyword.operator.asm",
"comment": "Bit and bit-test instruction mnemonics"
},
{
"match": "(?i)\\b(mov|movw|lac|las|lat|ldi|ld|ldd|lds|st|std|sts|lpm|spm|in|out|push|pop|xch)\\b",
"name": "keyword.operator.asm",
"comment": "Data transfer instruction mnemonics"
},
{
"match": "(?i)\\b(nop|sleep|wdr|break)\\b",
"name": "keyword.coperator.asm",
"comment": "MCU control instruction mnemonics"
},
{
"match": "(?i)(^|\\s)\\.\\b(byte|cseg|csegsize|db|dd|def|device|dq|dseg|dw|elif|else|endif|endm|endmacro|equ|error|eseg|exit|if|ifdef|ifndef|include|list|listmac|macro|message|nolist|org|set|undef)\\b",
"name": "constant.character.asm",
"comment": "AVR ASM 1.0 directives"
},
{
"match": "(\/\/|;)(\\s|\\S)*",
"name": "comment.line.asm",
"comment": "Comment line"
},
{
"begin": "(\/\\*)",
"end": "(\\*\/)",
"name": "comment.block.asm",
"comment": "C-style comment block (AVR ASM 2.0 only)"
},
{
"match": "(^|\\s)\"[\\w\\s\\W]*\"($|\\s)",
"name": "string.asm",
"comment": "Single-line string"
},
{
"match": "(^|\\s)\\'[\\w\\s\\W]*\\'($|\\s)",
"name": "string.asm",
"comment": "Single-line string"
},
{
"match": "(?i)\\b(0x(\\d|[A-F])+)\\b",
"name": "constant.numeric.asm",
"comment": "Hex number constant"
},
{
"match": "\\b(0[0-7]+)\\b",
"name": "constant.numeric.asm",
"comment": "Oct number constant"
},
{
"match": "\\b(0b(0|1)+)\\b",
"name": "constant.numeric.asm",
"comment": "Bin number constant"
},
{
"match": "\\b(0|[1-9]\\d+)\\b",
"name": "constant.numeric.asm",
"comment": "Dec number constant"
}
],
"uuid": "97b6acae-cfc1-4c14-b572-c51987e1e023"
}