| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language SYSTEM "language.dtd" |
| 3 |
[ |
| 4 |
<!ENTITY opcode "\b(adc|and|asl|bcc|bcs|beq|bge|bit|blt|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpa|cpx|cpy|dec|dex|dey|eor|gcc|gcs|geq|gge|glt|gmi|gne|gpl|gvc|gvs|inc|inx|iny|jmp|jsr|lda|ldr|ldx|ldy|lsr|nop|ora|orr|pha|php|pla|plp|psh|pul|rol|ror|rti|rts|sbc|sec|sed|sei|shl|shr|sta|str|stx|sty|tax|tay|tsx|txa|txs|tya)((?:\s+(a(?=(\s|;|$))))|(?=(\s|;|$)))"> |
| 5 |
<!ENTITY iopcode "\b(ahx|alr|anc|ane|arr|asr|axs|dcm|dcp|ins|isb|isc|jam|lae|las|lax|lds|lxa|rla|rra|sax|sbx|sha|shs|shx|shy|slo|sre|tas|xaa)((?:\s+(#|a(?=(\s|;|$))))|(?=(\s|;|$)))"> |
| 6 |
<!ENTITY datadef "\.(byte|char|[lsd]int|rta|long|d?word|fill|p?text|null|shiftl?|dstruct|dunion|binary|addr)\b"> |
| 7 |
<!ENTITY preproc "\.(b?include|lbl|goto|from|c?error|c?warn|[ax][ls]|autsiz|mansiz|pron|proff|hidemac|showmac|offs|alignpageind|alignind|alignblk|align|assert|check|[cet]def|databank|dpage|cpu|enc|option|var|end|eor|seed|dsection|breakif|continueif|break|continue|sfunction)\b"> |
| 8 |
]> |
| 9 |
<!-- ex:set ts=2 et: |
| 10 |
|
| 11 |
$Id: katepart-asm6502.xml 3179 2025-03-26 06:31:53Z soci $ |
| 12 |
|
| 13 |
Katepart language definition file for 64tass |
| 14 |
Usable with kwrite, kate, kdevelop |
| 15 |
|
| 16 |
Depending on the version of KDE place it into one of these folders: |
| 17 |
|
| 18 |
~/.kde/share/apps/katepart/syntax |
| 19 |
~/.local/share/katepart5/syntax |
| 20 |
~/.local/share/org.kde.syntax-highlighting/syntax |
| 21 |
|
| 22 |
Author: Zsolt Kajtar <soci at c64.rulez.org> |
| 23 |
Copyright (C) 2012 Zsolt Kajtar <soci at c64.rulez.org> |
| 24 |
|
| 25 |
This library is free software; you can redistribute it and/or modify |
| 26 |
it under the terms of the GNU General Public License as published by |
| 27 |
the Free Software Foundation; either version 2 of the License, or |
| 28 |
(at your option) any later version. |
| 29 |
|
| 30 |
This program is distributed in the hope that it will be useful, |
| 31 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 32 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 33 |
GNU General Public License for more details. |
| 34 |
|
| 35 |
You should have received a copy of the GNU General Public License |
| 36 |
along with this program; if not, write to the Free Software |
| 37 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 38 |
|
| 39 |
--> |
| 40 |
<language name="6502 assembly (64tass)" version="1.05" kateversion="2.1" section="Assembler" extensions="*.asm" mimetype="text/x-64tass;application/x-64tass"> |
| 41 |
<highlighting> |
| 42 |
<contexts> |
| 43 |
<context name="Base" attribute="Normal Text" lineEndContext="#stay"> |
| 44 |
<IncludeRules context="Opcode"/> |
| 45 |
<RegExpr String="((?![0-9])\w[\w_.]*|_\w[\w_.]*):?" context="Opcode2" insensitive="TRUE"/> |
| 46 |
<RegExpr String="[+\-*](?=(\s|$|=))" context="Opcode2" insensitive="TRUE"/> |
| 47 |
</context> |
| 48 |
<context name="Opcode2" attribute="Normal Text" lineEndContext="Base"> |
| 49 |
<RegExpr String="(<<|>>|&&|\|\||\*\*|\.\.|::|[<>:]\?|[-+*%/&|^.:x])?=" attribute="Keyword" context="Miscparam" insensitive="TRUE"/> |
| 50 |
<IncludeRules context="Opcode"/> |
| 51 |
</context> |
| 52 |
|
| 53 |
<context name="Opcode" lineEndContext="#pop"> |
| 54 |
<RegExpr String="&opcode;" attribute="Keyword" context="Miscparam" insensitive="TRUE"/> |
| 55 |
<RegExpr String="&iopcode;" attribute="Keyword" context="Miscparam" insensitive="TRUE"/> |
| 56 |
<RegExpr String="&datadef;" attribute="Data Type" context="Miscparam" insensitive="TRUE"/> |
| 57 |
<RegExpr String="&preproc;" attribute="Preprocessor" context="Miscparam" insensitive="TRUE"/> |
| 58 |
<RegExpr context="folding" beginRegion="foldingRegion" String="\.comment\b" attribute="Preprocessor" insensitive="TRUE"/> |
| 59 |
<RegExpr String="#(\\?((?![0-9])\w[\w_.]*|_\w[\w_.]*)|\\[1-9@])\b" attribute="Preprocessor" context="Miscparam" insensitive="TRUE"/> |
| 60 |
<IncludeRules context="foldstuff"/> |
| 61 |
<RegExpr String=";.*$" attribute="Comment" context="#stay"/> |
| 62 |
</context> |
| 63 |
<context name="Miscparam" attribute="Normal Text" lineEndContext="Base"> |
| 64 |
<RegExpr String="[\-+]+\s*(?=($|[)},;.\]]))" attribute="Label" context="Miscparam2"/> |
| 65 |
<RegExpr String="[bnlspxz]"" attribute="String" context="string1"/> |
| 66 |
<RegExpr String="[bnlspxz]'" attribute="String" context="string2"/> |
| 67 |
<RegExpr String="((?![0-9])\w[\w_]*|_\w[\w_]*)\s*(?=\()" attribute="Normal Text" context="#stay" insensitive="TRUE"/> |
| 68 |
<RegExpr String="(?![0-9])\w[\w_]*|_\w[\w_]*" attribute="Label" context="Miscparam2" insensitive="TRUE"/> |
| 69 |
<RegExpr String="\\((?![0-9])\w[\w_]*|_\w[\w_]*)" attribute="Preprocessor" context="Miscparam2" insensitive="TRUE"/> |
| 70 |
<RegExpr String="\\\{((?![0-9])\w[\w_]*|_\w[\w_]*)\}" attribute="Preprocessor" context="Miscparam" insensitive="TRUE"/> |
| 71 |
<RegExpr String="\\[@1-9]" attribute="Preprocessor" context="Miscparam2" insensitive="TRUE"/> |
| 72 |
<RegExpr String="%((\.(([01]_+)+[01]|[01])+|(([01]_+)+[01]|[01])+\.(?!\.)(([01]_+)+[01]|[01])*)([ep][+-]?(([0-9]_+)+[0-9]|[0-9])+)?|(([01]_+)+[01]|[01])+[ep][+-]?(([0-9]_+)+[0-9]|[0-9])+)" attribute="Float" context="Miscparam2" insensitive="TRUE"/> |
| 73 |
<RegExpr String="%(([01]_+)+[01]|[01])*" attribute="Bin" context="Miscparam2"/> |
| 74 |
<RegExpr String="[*?]" attribute="Hex" context="Miscparam2"/> |
| 75 |
<RegExpr String="@[bwl]" attribute="Operator" context="#stay"/> |
| 76 |
<RegExpr String="(\.(([0-9]_+)+[0-9]|[0-9])+|(([0-9]_+)+[0-9]|[0-9])+\.(?!\.)(([0-9]_+)+[0-9]|[0-9])*)([ep][+-]?(([0-9]_+)+[0-9]|[0-9])+)?|(([0-9]_+)+[0-9]|[0-9])+[ep][+-]?(([0-9]_+)+[0-9]|[0-9])+" attribute="Float" context="Miscparam2" insensitive="TRUE"/> |
| 77 |
<RegExpr String="(([0-9]_+)+[0-9]|[0-9])+" attribute="Decimal" context="Miscparam2"/> |
| 78 |
<RegExpr String="\$((\.(([0-9a-f]_+)+[0-9a-f]|[0-9a-f])+|(([0-9a-f]_+)+[0-9a-f]|[0-9a-f])+\.(?!\.)(([0-9a-f]_+)+[0-9a-f]|[0-9a-f])*)(p[+-]?(([0-9]_+)+[0-9]|[0-9])+)?|(([0-9a-f]_+)+[0-9a-f]|[0-9a-f])+p[+-]?(([0-9]_+)+[0-9]|[0-9])+)" attribute="Float" context="Miscparam2" insensitive="TRUE"/> |
| 79 |
<RegExpr String="\$(([0-9a-f]_+)+[0-9a-f]|[0-9a-f])*" attribute="Hex" context="Miscparam2" insensitive="TRUE"/> |
| 80 |
<RegExpr String="\.[([]" attribute="Operator" context="#stay"/> |
| 81 |
<RegExpr String="\.(?![0-9])(?=\w)" attribute="Operator" context="#stay"/> |
| 82 |
<RegExpr String="[,({\[+\-!~<>#`\^:]" attribute="Operator" context="#stay"/> |
| 83 |
<RegExpr String="[)}\]]" attribute="Operator" context="Miscparam2"/> |
| 84 |
<DetectChar char=""" attribute="String" context="string1"/> |
| 85 |
<DetectChar char="'" attribute="String" context="string2"/> |
| 86 |
<RegExpr String=";.*$" attribute="Comment" context="#pop"/> |
| 87 |
<RegExpr String="[^ \t]" attribute="Error" context="#stay"/> |
| 88 |
</context> |
| 89 |
<context name="Miscparam2" attribute="Normal Text" lineEndContext="Base"> |
| 90 |
<RegExpr String=",[xyzrsdbk]\b" attribute="Operator" context="#stay"/> |
| 91 |
<RegExpr String="[)}\]]" attribute="Operator" context="#stay"/> |
| 92 |
<RegExpr String="&&|\|\||^^|\*\*|\.\.|\?\?|[=!]==?|<=>|<[<=?]|>[>=?]|\bx\b|!?\bin\b" attribute="Operator" context="Miscparam"/> |
| 93 |
<RegExpr String="[,({\[&|^*%/\-+.?:=<>]" attribute="Operator" context="Miscparam"/> |
| 94 |
<RegExpr String=";.*$" attribute="Comment" context="#pop"/> |
| 95 |
<RegExpr String="[^ \t]" attribute="Error" context="#stay"/> |
| 96 |
</context> |
| 97 |
<context name="string1" lineEndContext="Base" attribute="String"> |
| 98 |
<Detect2Chars attribute="Preprocessor" context="#stay" char=""" char1="""/> |
| 99 |
<RegExpr String="\{[^}"]*\}" attribute="Preprocessor" context="#stay"/> |
| 100 |
<DetectChar attribute="String" context="Miscparam2" char="""/> |
| 101 |
</context> |
| 102 |
<context name="string2" lineEndContext="Base" attribute="String"> |
| 103 |
<Detect2Chars attribute="Preprocessor" context="#stay" char="'" char1="'"/> |
| 104 |
<RegExpr String="\{[^}']*\}" attribute="Preprocessor" context="#stay"/> |
| 105 |
<DetectChar attribute="String" context="Miscparam2" char="'"/> |
| 106 |
</context> |
| 107 |
<context name="Error" attribute="Error" lineEndContext="Base"> |
| 108 |
</context> |
| 109 |
<context name="foldstuff"> |
| 110 |
<RegExpr beginRegion="proc" String="\.proc\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 111 |
<RegExpr endRegion="proc" String="\.(pend|endproc)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 112 |
<RegExpr beginRegion="block" String="\.block\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 113 |
<RegExpr endRegion="block" String="\.(bend|endblock)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 114 |
<RegExpr beginRegion="encode" String="\.encode\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 115 |
<RegExpr endRegion="encode" String="\.endencode\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 116 |
<RegExpr beginRegion="section" String="\.section\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 117 |
<RegExpr endRegion="section" String="\.(send|endsection)\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 118 |
<RegExpr beginRegion="struct" String="\.struct\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 119 |
<RegExpr endRegion="struct" String="\.(ends|endstruct)\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 120 |
<RegExpr beginRegion="union" String="\.union\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 121 |
<RegExpr endRegion="union" String="\.(endu|endunion)\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 122 |
<RegExpr beginRegion="page" String="\.page\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 123 |
<RegExpr endRegion="page" String="\.(endp|endpage)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 124 |
<RegExpr beginRegion="namespace" String="\.namespace\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 125 |
<RegExpr endRegion="namespace" String="\.(endn|endnamespace)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 126 |
<RegExpr beginRegion="with" String="\.with\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 127 |
<RegExpr endRegion="with" String="\.endwith\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 128 |
<RegExpr beginRegion="segment" String="\.segment\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 129 |
<RegExpr endRegion="segment" String="\.(endm|endsegment)\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 130 |
<RegExpr beginRegion="macro" String="\.macro\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 131 |
<RegExpr endRegion="macro" String="\.(endm|endmacro)\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 132 |
<RegExpr beginRegion="function" String="\.function\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 133 |
<RegExpr endRegion="function" String="\.(endf|endfunction)\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 134 |
<RegExpr beginRegion="for" String="\.b?for\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 135 |
<RegExpr endRegion="for" String="\.(next|endfor)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 136 |
<RegExpr beginRegion="rept" String="\.b?rept\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 137 |
<RegExpr endRegion="rept" String="\.(next|endrept)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 138 |
<RegExpr beginRegion="while" String="\.b?while\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 139 |
<RegExpr endRegion="while" String="\.(next|endwhile)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 140 |
<RegExpr beginRegion="logical" String="\.logical\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 141 |
<RegExpr endRegion="logical" String="\.(here|endlogical)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 142 |
<RegExpr beginRegion="virtual" String="\.virtual\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 143 |
<RegExpr endRegion="virtual" String="\.(endv|endvirtual)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 144 |
<RegExpr beginRegion="weak" String="\.weak\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 145 |
<RegExpr endRegion="weak" String="\.endweak\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 146 |
<RegExpr beginRegion="alignblk" String="\.alignblk\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 147 |
<RegExpr endRegion="alignblk" String="\.endalignblk\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 148 |
<RegExpr beginRegion="if" String="\.(if|ifeq|ifne|ifpl|ifmi)\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 149 |
<RegExpr endRegion="if" beginRegion="if" String="\.els?if\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 150 |
<RegExpr endRegion="if" beginRegion="if" String="\.else\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 151 |
<RegExpr endRegion="if" String="\.(fi|endif)\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 152 |
<RegExpr beginRegion="switch" String="\.switch\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 153 |
<RegExpr endRegion="switch" beginRegion="switch" String="\.case\b" context="Miscparam" attribute="Preprocessor" insensitive="TRUE"/> |
| 154 |
<RegExpr endRegion="switch" beginRegion="switch" String="\.default\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 155 |
<RegExpr endRegion="switch" String="\.endswitch\b" context="Error" attribute="Preprocessor" insensitive="TRUE"/> |
| 156 |
</context> |
| 157 |
|
| 158 |
<context attribute="Comment" name="folding" lineEndContext="#stay"> |
| 159 |
<RegExpr context="#pop" endRegion="foldingRegion" String="\.(endc|endcomment)\b" attribute="Preprocessor" insensitive="TRUE"/> |
| 160 |
</context> |
| 161 |
</contexts> |
| 162 |
|
| 163 |
<itemDatas> |
| 164 |
<itemData name="Normal Text" defStyleNum="dsNormal"/> |
| 165 |
<itemData name="Label" defStyleNum="dsFunction"/> |
| 166 |
<itemData name="Keyword" defStyleNum="dsKeyword"/> |
| 167 |
<itemData name="Decimal" defStyleNum="dsDecVal"/> |
| 168 |
<itemData name="Float" defStyleNum="dsFloat"/> |
| 169 |
<itemData name="Data Type" defStyleNum="dsDataType"/> |
| 170 |
<itemData name="Hex" defStyleNum="dsBaseN"/> |
| 171 |
<itemData name="Bin" defStyleNum="dsBaseN"/> |
| 172 |
<itemData name="String" defStyleNum="dsString"/> |
| 173 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 174 |
<itemData name="Preprocessor" defStyleNum="dsOthers"/> |
| 175 |
<itemData name="Operator" defStyleNum="dsNormal"/> |
| 176 |
<itemData name="Error" defStyleNum="dsError"/> |
| 177 |
</itemDatas> |
| 178 |
</highlighting> |
| 179 |
<general> |
| 180 |
<comments> |
| 181 |
<comment name="singleLine" start=";"/> |
| 182 |
</comments> |
| 183 |
<keywords casesensitive="1"/> |
| 184 |
</general> |
| 185 |
</language> |
| 186 |
|