Skip to content

Instantly share code, notes, and snippets.

@Raymo111
Last active Jan 27, 2022
Embed
What would you like to do?
CS 241 MIPS KSyntaxHighlighting
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="CS 241 MIPS" version="1" kateversion="5.0" section="Assembler" extensions="*.asm;*.hex;" mimetype="text/x-mips" author="Raymond Li" priority="1">
<highlighting>
<list name="type">
<item>.word</item>
</list>
<list name="rinstr">
<item>add</item>
<item>sub</item>
<item>mult</item>
<item>multu</item>
<item>div</item>
<item>divu</item>
<item>mfhi</item>
<item>mflo</item>
<item>lis</item>
<item>slt</item>
<item>sltu</item>
<item>jr</item>
<item>jalr</item>
</list>
<list name="iinstr">
<item>lw</item>
<item>sw</item>
<item>beq</item>
<item>bne</item>
</list>
<list name="register">
<item>$0</item>
<item>$1</item>
<item>$2</item>
<item>$3</item>
<item>$4</item>
<item>$5</item>
<item>$6</item>
<item>$7</item>
<item>$8</item>
<item>$9</item>
<item>$10</item>
<item>$11</item>
<item>$12</item>
<item>$13</item>
<item>$14</item>
<item>$15</item>
<item>$16</item>
<item>$17</item>
<item>$18</item>
<item>$19</item>
<item>$20</item>
<item>$21</item>
<item>$22</item>
<item>$23</item>
<item>$24</item>
<item>$25</item>
<item>$26</item>
<item>$27</item>
<item>$28</item>
<item>$29</item>
<item>$30</item>
<item>$31</item>
</list>
<contexts>
<context name="normal" attribute="Normal Text" lineEndContext="#stay">
<keyword attribute="Section" context="#stay" String="type"/>
<keyword attribute="Register Instruction" context="#stay" String="rinstr"/>
<keyword attribute="Immediate Instruction" context="#stay" String="iinstr"/>
<keyword attribute="Register" context="#stay" String="register"/>
<RegExpr attribute="Region Marker" context="#stay" String="#\s*BEGIN.*$" beginRegion="region" firstNonSpace="true"/>
<RegExpr attribute="Region Marker" context="#stay" String="#\s*END.*$" endRegion="region" firstNonSpace="true"/>
<DetectChar attribute="Comment" context="Comment" char=";" />
<RegExpr attribute="Label" context="#stay" String="[\w_\.]+:" firstNonSpace="true"/>
<DetectChar attribute="String" context="string" char="&quot;" />
<Float attribute="Float" context="#stay"/>
<HlCOct attribute="Octal" context="#stay"/>
<HlCHex attribute="Hex" context="#stay"/>
<Int attribute="Decimal" context="#stay"/>
</context>
<context name="string" attribute="String" lineEndContext="#stay" >
<RegExpr attribute="Char" context="#stay" String="\\." />
<DetectChar attribute="String" context="#pop" char="&quot;" />
</context>
<context name="Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<IncludeRules context="##Comments"/>
<keyword attribute="Section" context="#stay" String="type"/>
<keyword attribute="Register Instruction" context="#stay" String="rinstr"/>
<keyword attribute="Immediate Instruction" context="#stay" String="iinstr"/>
<keyword attribute="Register" context="#stay" String="register"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" />
<itemData name="Register Instruction" defStyleNum="dsKeyword" />
<itemData name="Immediate Instruction" defStyleNum="dsFunction"/>
<itemData name="Register" defStyleNum="dsAttribute"/>
<itemData name="Section" defStyleNum="dsDataType"/>
<itemData name="Comment" defStyleNum="dsComment" />
<itemData name="Char" defStyleNum="dsChar" />
<itemData name="String" defStyleNum="dsString" />
<itemData name="Label" defStyleNum="dsControlFlow" />
<itemData name="Decimal" defStyleNum="dsDecVal"/>
<itemData name="Octal" defStyleNum="dsBaseN"/>
<itemData name="Hex" defStyleNum="dsBaseN"/>
<itemData name="Float" defStyleNum="dsFloat"/>
<itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start=";" />
</comments>
<keywords casesensitive="0" weakDeliminator="."/>
</general>
</language>
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment