| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY hex "[0-9a-f]++h?"> |
| 5 |
<!ENTITY oct_hex "[0-7]++(?:&hex;|[hoq]?)|&hex;"> |
| 6 |
<!ENTITY bin_oct_hex "[01]++(?:&oct_hex;|[hoqb]?)|&oct_hex;"> |
| 7 |
]> |
| 8 |
<!-- kate: space-indent on; indent-width 2; --> |
| 9 |
|
| 10 |
<!-- Microchip PIC assembler syntaxfile for gpasm/mpasm assembler by |
| 11 |
* Original author: Alain GIBAUD ([email protected]) |
| 12 |
* Small modifications for the new DTD: Joseph Wenninger <[email protected]> |
| 13 |
* Updated for 16-bit devices, etc.: Laurence Withers <[email protected]> |
| 14 |
--> |
| 15 |
|
| 16 |
<language name="PicAsm" version="7" kateversion="5.62" section="Assembler" extensions="*.src;*.SRC;*.asm;*.ASM;*.pic;*.PIC" mimetype="text/x-PicSrc;text/x-PicHdr" author="Alain GIBAUD ([email protected])" license="LGPL"> |
| 17 |
|
| 18 |
<highlighting> |
| 19 |
<list name="directives"> |
| 20 |
<item>__BADRAM</item> |
| 21 |
<item>__CONFIG</item> |
| 22 |
<item>__IDLOCS</item> |
| 23 |
<item>__MAXRAM</item> |
| 24 |
|
| 25 |
<item>cblock</item> |
| 26 |
<item>constant</item> |
| 27 |
<item>da</item> |
| 28 |
<item>data</item> |
| 29 |
<item>db</item> |
| 30 |
<item>de</item> |
| 31 |
<item>dt</item> |
| 32 |
<item>dw</item> |
| 33 |
<item>endc</item> |
| 34 |
<item>endm</item> |
| 35 |
<item>equ</item> |
| 36 |
<item>error</item> |
| 37 |
<item>errorlevel</item> |
| 38 |
<item>exitm</item> |
| 39 |
<item>fill</item> |
| 40 |
<item>list</item> |
| 41 |
<item>local</item> |
| 42 |
<item>macro</item> |
| 43 |
<item>messg</item> |
| 44 |
<item>noexpand</item> |
| 45 |
<item>nolist</item> |
| 46 |
<item>org</item> |
| 47 |
<item>page</item> |
| 48 |
<item>processor</item> |
| 49 |
<item>radix</item> |
| 50 |
<item>res</item> |
| 51 |
<item>set</item> |
| 52 |
<item>space</item> |
| 53 |
<item>subtitle</item> |
| 54 |
<item>title</item> |
| 55 |
<item>variable</item> |
| 56 |
<item>end</item> |
| 57 |
</list> |
| 58 |
|
| 59 |
<list name="conditional"> |
| 60 |
<item>if</item> |
| 61 |
<item>else</item> |
| 62 |
<item>idef</item> |
| 63 |
<item>ifndef</item> |
| 64 |
<item>endif</item> |
| 65 |
<item>while</item> |
| 66 |
<item>include</item> |
| 67 |
<item>endw</item> |
| 68 |
</list> |
| 69 |
|
| 70 |
<list name="gpasm_macro"> |
| 71 |
<item>addcf</item> |
| 72 |
<item>b</item> |
| 73 |
<item>clrc</item> |
| 74 |
<item>clrz</item> |
| 75 |
<item>setc</item> |
| 76 |
<item>setz</item> |
| 77 |
<item>movfw</item> |
| 78 |
<item>skpc</item> |
| 79 |
<item>skpz</item> |
| 80 |
<item>skpnc</item> |
| 81 |
<item>skpnz</item> |
| 82 |
<item>subcf</item> |
| 83 |
<item>tstf</item> |
| 84 |
</list> |
| 85 |
|
| 86 |
<list name="branch instructions"> |
| 87 |
<item>bra</item> |
| 88 |
<item>brw</item> |
| 89 |
<item>bc</item> |
| 90 |
<item>bz</item> |
| 91 |
<item>bnc</item> |
| 92 |
<item>bnz</item> |
| 93 |
<item>call</item> |
| 94 |
<item>goto</item> |
| 95 |
</list> |
| 96 |
|
| 97 |
<list name="instructions"> |
| 98 |
<item>addlw</item> |
| 99 |
<item>addwf</item> |
| 100 |
<item>addwfc</item> |
| 101 |
<item>andlw</item> |
| 102 |
<item>andwf</item> |
| 103 |
<item>bcf</item> |
| 104 |
<item>bn</item> |
| 105 |
<item>bnov</item> |
| 106 |
<item>bov</item> |
| 107 |
<item>bsf</item> |
| 108 |
<item>btg</item> |
| 109 |
<item>btfsc</item> |
| 110 |
<item>btfss</item> |
| 111 |
<item>clrf</item> |
| 112 |
<item>clrw</item> |
| 113 |
<item>clrwdt</item> |
| 114 |
<item>comf</item> |
| 115 |
<item>cpfseq</item> |
| 116 |
<item>cpfslt</item> |
| 117 |
<item>cpfsgt</item> |
| 118 |
<item>daw</item> |
| 119 |
<item>decf</item> |
| 120 |
<item>dcfsnz</item> |
| 121 |
<item>decfsz</item> |
| 122 |
<item>incf</item> |
| 123 |
<item>incfsz</item> |
| 124 |
<item>infsnz</item> |
| 125 |
<item>iorlw</item> |
| 126 |
<item>iorwf</item> |
| 127 |
<item>lfsr</item> |
| 128 |
<item>movf</item> |
| 129 |
<item>movff</item> |
| 130 |
<item>movlb</item> |
| 131 |
<item>movlw</item> |
| 132 |
<item>movwf</item> |
| 133 |
<item>mullw</item> |
| 134 |
<item>mulwf</item> |
| 135 |
<item>negf</item> |
| 136 |
<item>nop</item> |
| 137 |
<item>option</item> |
| 138 |
<item>pop</item> |
| 139 |
<item>push</item> |
| 140 |
<item>rcall</item> |
| 141 |
<item>reset</item> |
| 142 |
<item>retfie</item> |
| 143 |
<item>retlw</item> |
| 144 |
<item>return</item> |
| 145 |
<item>rlcf</item> |
| 146 |
<item>rlf</item> |
| 147 |
<item>rlncf</item> |
| 148 |
<item>rrcf</item> |
| 149 |
<item>rrf</item> |
| 150 |
<item>rrncf</item> |
| 151 |
<item>setf</item> |
| 152 |
<item>sleep</item> |
| 153 |
<item>subfwb</item> |
| 154 |
<item>sublw</item> |
| 155 |
<item>subwf</item> |
| 156 |
<item>subwfb</item> |
| 157 |
<item>swapf</item> |
| 158 |
<item>tblrd</item> |
| 159 |
<item>tblwt</item> |
| 160 |
<item>tstfsz</item> |
| 161 |
<item>xorlw</item> |
| 162 |
<item>xorwf</item> |
| 163 |
</list> |
| 164 |
|
| 165 |
<list name="instruction_attr"> |
| 166 |
<item>A</item> |
| 167 |
<item>ACCESS</item> |
| 168 |
<item>BANKED</item> |
| 169 |
<item>W</item> |
| 170 |
<item>F</item> |
| 171 |
</list> |
| 172 |
|
| 173 |
<list name="preprocessor"> |
| 174 |
<item>define</item> |
| 175 |
<item>undefine</item> |
| 176 |
<item>v</item> |
| 177 |
</list> |
| 178 |
|
| 179 |
<list name="comment instructions"> |
| 180 |
<item>INPUT</item> |
| 181 |
<item>OUTPUT</item> |
| 182 |
<item>PARAMETERS</item> |
| 183 |
<item>AUTHOR</item> |
| 184 |
<item>EMAIL</item> |
| 185 |
</list> |
| 186 |
|
| 187 |
<contexts> |
| 188 |
|
| 189 |
<!-- The main ('normal') context --> |
| 190 |
|
| 191 |
<context name="normal" attribute="Normal Text" lineEndContext="#stay"> |
| 192 |
<DetectSpaces attribute="Normal Text" context="#stay"/> |
| 193 |
|
| 194 |
<keyword attribute="Directives" context="Operands" String="directives" insensitive="1"/> |
| 195 |
<keyword attribute="Preprocessor" context="Operands" String="conditional"/> |
| 196 |
<DetectIdentifier attribute="Label" context="EndLabel" column="0"/> |
| 197 |
<keyword attribute="Instructions" context="Operands" String="instructions" insensitive="1"/> |
| 198 |
<keyword attribute="Branch Instructions" context="Operands" String="branch instructions" insensitive="1"/> |
| 199 |
<keyword attribute="InstructionAttr" context="Operands" String="instruction_attr" insensitive="1"/> |
| 200 |
<keyword attribute="GPASM-macros" context="Operands" String="gpasm_macro" insensitive="1"/> |
| 201 |
|
| 202 |
<DetectIdentifier attribute="Unknown Instructions" context="Operands"/> |
| 203 |
|
| 204 |
<DetectChar attribute="Comment" context="#pop!comment" char=";" /> |
| 205 |
<DetectChar attribute="Preprocessor" context="preprocessor1" char="#"/> |
| 206 |
</context> |
| 207 |
|
| 208 |
<context name="Operands" attribute="Normal Text" lineEndContext="#pop"> |
| 209 |
<DetectSpaces attribute="Normal Text"/> |
| 210 |
|
| 211 |
<DetectChar attribute="Unbased Numbers" context="Number16or10" char="0" lookAhead="1"/> |
| 212 |
<Int attribute="Unbased Numbers" context="CheckNumberSuffix"/> |
| 213 |
<DetectChar attribute="Based Numbers" context="Number10" char="."/> |
| 214 |
|
| 215 |
<HlCChar attribute="Char" context="#stay"/> |
| 216 |
<Detect2Chars attribute="Char" context="ASCIIChar" char="A" char1="'" /> |
| 217 |
<Detect2Chars attribute="Char" context="ASCIIChar" char="a" char1="'" /> |
| 218 |
<Detect2Chars attribute="Based Numbers" context="binaryDigits" char="B" char1="'" /> |
| 219 |
<Detect2Chars attribute="Based Numbers" context="binaryDigits" char="b" char1="'" /> |
| 220 |
<Detect2Chars attribute="Based Numbers" context="hexDigits" char="H" char1="'" /> |
| 221 |
<Detect2Chars attribute="Based Numbers" context="hexDigits" char="h" char1="'" /> |
| 222 |
<Detect2Chars attribute="Based Numbers" context="octDigits" char="O" char1="'" /> |
| 223 |
<Detect2Chars attribute="Based Numbers" context="octDigits" char="o" char1="'" /> |
| 224 |
<Detect2Chars attribute="Based Numbers" context="decimalDigits" char="D" char1="'" /> |
| 225 |
<Detect2Chars attribute="Based Numbers" context="decimalDigits" char="d" char1="'" /> |
| 226 |
<DetectChar attribute="String" context="string" char=""" /> |
| 227 |
<DetectChar attribute="Comment" context="#pop!comment" char=";" /> |
| 228 |
<DetectChar attribute="Preprocessor" context="preprocessor2" char="#"/> |
| 229 |
<AnyChar attribute="Symbol" context="#stay" String=",-/*%+=><&|^!~()" /> |
| 230 |
|
| 231 |
<DetectIdentifier attribute="Normal Text"/> |
| 232 |
</context> |
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
<!-- Additional contexts --> |
| 237 |
|
| 238 |
<context name="EndLabel" attribute="Label" lineEndContext="#pop" fallthroughContext="#pop"> |
| 239 |
<Detect2Chars attribute="Char" context="#pop!LabelReplaceMacro" char="#" char1="v" /> |
| 240 |
<DetectChar attribute="Symbol" context="#pop" char=":"/> |
| 241 |
</context> |
| 242 |
<context name="LabelReplaceMacro" attribute="Label" lineEndContext="#pop" fallthroughContext="#pop"> |
| 243 |
<DetectChar attribute="Symbol" context="#pop!ReplaceMacro" char="("/> |
| 244 |
</context> |
| 245 |
<context name="ReplaceMacro" attribute="Label" lineEndContext="#pop"> |
| 246 |
<DetectChar attribute="Symbol" context="ReplaceMacro2" char="("/> |
| 247 |
<DetectChar attribute="Symbol" context="#pop!ContinueLabel" char=")"/> |
| 248 |
<IncludeRules context="Operands"/> |
| 249 |
</context> |
| 250 |
<context name="ReplaceMacro2" attribute="Label" lineEndContext="#pop"> |
| 251 |
<DetectChar attribute="Symbol" context="ReplaceMacro" char="("/> |
| 252 |
<DetectChar attribute="Symbol" context="#pop" char=")"/> |
| 253 |
<IncludeRules context="Operands"/> |
| 254 |
</context> |
| 255 |
<context name="ContinueLabel" attribute="Label" lineEndContext="#pop" fallthroughContext="#pop"> |
| 256 |
<DetectIdentifier attribute="Label" context="#pop!EndLabel"/> |
| 257 |
<DetectChar attribute="Symbol" context="#pop" char=":"/> |
| 258 |
</context> |
| 259 |
|
| 260 |
<context name="string" attribute="String" lineEndContext="#pop"> |
| 261 |
<LineContinue attribute="String" context="#stay"/> |
| 262 |
<HlCStringChar attribute="Char" context="#stay"/> |
| 263 |
<DetectChar attribute="String" context="#pop" char="""/> |
| 264 |
</context> |
| 265 |
|
| 266 |
<context name="comment" attribute="Comment" lineEndContext="#pop"> |
| 267 |
<DetectSpaces attribute="Comment"/> |
| 268 |
<IncludeRules context="##Comments" /> |
| 269 |
<keyword attribute="Instructions" context="#stay" String="comment instructions" insensitive="0"/> |
| 270 |
<DetectIdentifier attribute="Comment"/> |
| 271 |
</context> |
| 272 |
|
| 273 |
<context name="preprocessor1" attribute="Preprocessor" lineEndContext="#pop" fallthroughContext="#pop!Operands"> |
| 274 |
<keyword attribute="Preprocessor" context="#pop!Operands" String="preprocessor" insensitive="1"/> |
| 275 |
<DetectIdentifier attribute="Error" context="#pop!Operands"/> |
| 276 |
</context> |
| 277 |
<context name="preprocessor2" attribute="Preprocessor" lineEndContext="#pop" fallthroughContext="#pop"> |
| 278 |
<keyword attribute="Preprocessor" context="#pop" String="preprocessor" insensitive="1"/> |
| 279 |
<DetectIdentifier attribute="Error" context="#pop"/> |
| 280 |
</context> |
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
<!-- Number --> |
| 285 |
|
| 286 |
<context name="Number10" attribute="Based Numbers" lineEndContext="#pop" fallthroughContext="#pop"> |
| 287 |
<Int attribute="Unbased Numbers" context="#pop!CheckNumberSuffix"/> |
| 288 |
</context> |
| 289 |
|
| 290 |
<context name="Number16or10" attribute="Based Numbers" lineEndContext="#pop" fallthroughContext="#pop"> |
| 291 |
<Detect2Chars attribute="Based Numbers" context="#pop!Number16" char="0" char1="x"/> |
| 292 |
<Detect2Chars attribute="Based Numbers" context="#pop!Number16" char="0" char1="X"/> |
| 293 |
<Int attribute="Unbased Numbers" context="#pop!CheckNumberSuffix"/> |
| 294 |
</context> |
| 295 |
|
| 296 |
<context name="Number16" attribute="Hex" lineEndContext="#pop" fallthroughContext="#pop"> |
| 297 |
<RegExpr attribute="Hex" context="#pop!CheckNumberSuffix" String="[0-9A-Fa-f]+"/> |
| 298 |
</context> |
| 299 |
|
| 300 |
<context name="CheckNumberSuffix" attribute="Based Numbers" lineEndContext="#pop" fallthroughContext="#pop"> |
| 301 |
<DetectSpaces attribute="Normal Text" context="#pop"/> |
| 302 |
<AnyChar attribute="Symbol" context="#pop" String=",-/*%+=><&|^!~"/> |
| 303 |
<RegExpr attribute="Error" context="#pop" String="[\d\w]+"/> |
| 304 |
</context> |
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
<!-- Quoted numbers --> |
| 309 |
|
| 310 |
<context name="decimalDigits" attribute="Unbased Numbers" lineEndContext="#pop" fallthroughContext="QuotedNumEnd"> |
| 311 |
<RegExpr attribute="Unbased Numbers" context="QuotedNumEnd" String="\d+"/> |
| 312 |
</context> |
| 313 |
|
| 314 |
<context name="binaryDigits" attribute="Binary" lineEndContext="#pop" fallthroughContext="QuotedNumEnd"> |
| 315 |
<RegExpr attribute="Binary" context="QuotedNumEnd" String="[01]+"/> |
| 316 |
</context> |
| 317 |
|
| 318 |
<context name="hexDigits" attribute="Hex" lineEndContext="#pop" fallthroughContext="QuotedNumEnd"> |
| 319 |
<RegExpr attribute="Hex" context="QuotedNumEnd" String="[0-9A-Fa-f]+"/> |
| 320 |
</context> |
| 321 |
|
| 322 |
<context name="octDigits" attribute="Octal" lineEndContext="#pop" fallthroughContext="QuotedNumEnd"> |
| 323 |
<RegExpr attribute="Octal" context="QuotedNumEnd" String="[0-7]+" /> |
| 324 |
</context> |
| 325 |
|
| 326 |
<context name="QuotedNumEnd" attribute="Error" lineEndContext="#pop#pop"> |
| 327 |
<DetectChar attribute="Based Numbers" context="#pop#pop" char="'"/> |
| 328 |
<RegExpr attribute="Error" context="#pop#pop" String="."/> |
| 329 |
</context> |
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
<!-- Quoted char --> |
| 334 |
|
| 335 |
<context name="ASCIIChar" attribute="Char" lineEndContext="#pop"> |
| 336 |
<RegExpr attribute="Char" context="QuotedASCIICharEnd" String="." /> |
| 337 |
</context> |
| 338 |
|
| 339 |
<context name="QuotedASCIICharEnd" attribute="Error" lineEndContext="#pop#pop" fallthroughContext="#pop#pop"> |
| 340 |
<DetectChar attribute="Char" context="#pop#pop" char="'"/> |
| 341 |
<RegExpr attribute="Error" context="#pop#pop" String="."/> |
| 342 |
</context> |
| 343 |
|
| 344 |
</contexts> |
| 345 |
|
| 346 |
|
| 347 |
<itemDatas> |
| 348 |
<itemData name="Normal Text" defStyleNum="dsNormal"/> |
| 349 |
<itemData name="Label" defStyleNum="dsFunction"/> |
| 350 |
<itemData name="Directives" defStyleNum="dsOthers"/> |
| 351 |
<itemData name="Preprocessor" defStyleNum="dsPreprocessor"/> |
| 352 |
<itemData name="Instructions" defStyleNum="dsKeyword"/> |
| 353 |
<itemData name="Unknown Instructions" defStyleNum="dsNormal"/> |
| 354 |
<itemData name="Branch Instructions" defStyleNum="dsControlFlow"/> |
| 355 |
<itemData name="InstructionAttr" defStyleNum="dsNormal" color="#000080" selColor="#000080" bold="0" italic="1"/> |
| 356 |
<itemData name="Unbased Numbers" defStyleNum="dsDecVal"/> |
| 357 |
<itemData name="Based Numbers" defStyleNum="dsBaseN" /> |
| 358 |
<itemData name="Hex" defStyleNum="dsBaseN" /> |
| 359 |
<itemData name="Octal" defStyleNum="dsBaseN" /> |
| 360 |
<itemData name="Binary" defStyleNum="dsBaseN" /> |
| 361 |
<itemData name="Char" defStyleNum="dsChar"/> |
| 362 |
<itemData name="String" defStyleNum="dsString"/> |
| 363 |
<itemData name="Comment" defStyleNum="dsComment" /> |
| 364 |
<itemData name="Symbol" defStyleNum="dsOperator"/> |
| 365 |
<itemData name="GPASM-macros" defStyleNum="dsNormal" color="#000000" selColor="#000000" bold="1" italic="1"/> |
| 366 |
<itemData name="Error" defStyleNum="dsError" /> |
| 367 |
</itemDatas> |
| 368 |
|
| 369 |
</highlighting> |
| 370 |
|
| 371 |
|
| 372 |
<general> |
| 373 |
<comments> |
| 374 |
<comment name="singleLine" start=";" /> |
| 375 |
</comments> |
| 376 |
<keywords casesensitive="1" additionalDeliminator="#"/> |
| 377 |
</general> |
| 378 |
|
| 379 |
</language> |