-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrgbasm.lang
161 lines (142 loc) · 5.38 KB
/
rgbasm.lang
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: Sanky
License: Public domain
-->
<language id="gbz80asm" _name="gbz80asm" version="2.0" _section="Source">
<metadata>
<property name="mimetypes">text/x-z80asm</property>
<property name="globs">*.asm;*.z80</property>
<property name="line-comment-start">;</property>
</metadata>
<styles>
<style id="instruction" _name="instruction" map-to="def:statement"/>
<style id="keyword" _name="keyword" map-to="def:function"/>
<style id="comment" _name="comment" map-to="def:comment"/>
<style id="string" _name="string" map-to="def:string"/>
<style id="num" _name="num" map-to="def:base-n-integer"/>
<style id="meta" _name="meta" map-to="def:keyword"/>
<style id="label" _name="label" map-to="def:constant"/>
</styles>
<definitions>
<context id="gbz80asm">
<include>
<context id="comment" style-ref="comment">
<start>;</start>
<end>$</end>
</context>
<context id="string" end-at-line-end="true" style-ref="string">
<start>"</start>
<end>"</end>
</context>
<context id="binary" style-ref="num">
<match extended="true">
(?<![\w\.]) %[01]+ (?![\w\.])
</match>
</context>
<context id="hexadecimal" style-ref="num">
<match extended="true">
(?<![\w\.]) \$[0-9a-fA-F]+ (?![\w\.])
</match>
</context>
<context id="decimal" style-ref="num">
<match extended="true">
(?<![\w\.]) [0-9]+ (?![\w\.])
</match>
</context>
<context id="instructions" style-ref="instruction">
<keyword>ld</keyword>
<keyword>push</keyword>
<keyword>pop</keyword>
<keyword>add</keyword>
<keyword>adc</keyword>
<keyword>sub</keyword>
<keyword>sbc</keyword>
<keyword>and</keyword>
<keyword>or</keyword>
<keyword>xor</keyword>
<keyword>cp</keyword>
<keyword>inc</keyword>
<keyword>dec</keyword>
<keyword>rlca</keyword>
<keyword>rla</keyword>
<keyword>rrca</keyword>
<keyword>rra</keyword>
<keyword>jp</keyword>
<keyword>jr</keyword>
<keyword>call</keyword>
<keyword>ret</keyword>
<keyword>reti</keyword>
<keyword>rst</keyword>
<keyword>daa</keyword>
<keyword>cpl</keyword>
<keyword>nop</keyword>
<keyword>halt</keyword>
<keyword>stop</keyword>
<keyword>di</keyword>
<keyword>ei</keyword>
<keyword>scf</keyword>
<keyword>ccf</keyword>
<keyword>rlc</keyword>
<keyword>rl</keyword>
<keyword>rrc</keyword>
<keyword>rr</keyword>
<keyword>sla</keyword>
<keyword>sra</keyword>
<keyword>srl</keyword>
<keyword>swap</keyword>
<keyword>bit</keyword>
<keyword>set</keyword>
<keyword>res</keyword>
</context>
<context id="data" style-ref="instruction">
<keyword>db</keyword>
<keyword>dw</keyword>
<keyword>dbw</keyword>
<keyword>dwb</keyword>
</context>
<context id="registers" style-ref="keyword">
<keyword>a</keyword>
<keyword>f</keyword>
<keyword>b</keyword>
<keyword>c</keyword>
<keyword>d</keyword>
<keyword>e</keyword>
<keyword>h</keyword>
<keyword>l</keyword>
<keyword>af</keyword>
<keyword>sp</keyword>
<keyword>z</keyword>
<keyword>nz</keyword>
<keyword>c</keyword>
<keyword>nc</keyword>
</context>
<context id="registers16" style-ref="keyword">
<prefix>\[?</prefix>
<suffix>\]?</suffix>
<keyword>bc</keyword>
<keyword>de</keyword>
<keyword>hli</keyword>
<keyword>hld</keyword>
<keyword>hl</keyword>
</context>
<context id="meta" style-ref="meta">
<keyword>INCLUDE</keyword>
<keyword>INCBIN</keyword>
<keyword>EQU</keyword>
<keyword>MACRO</keyword>
<keyword>SECTION</keyword>
<keyword>BANK</keyword>
<keyword>HOME</keyword>
<keyword>DATA</keyword>
</context>
<!-- anything else is a label. not very smart, but works. -->
<context id="label" style-ref="label">
<match extended="true">
(?<![\w\.]) \.?[a-zA-Z#_][0-9a-zA-Z@#_]*:? (?![\w\.])
</match>
</context>
</include>
</context>
</definitions>
</language>