Warning, /frameworks/syntax-highlighting/autotests/reference/highlight.asm-mips.ref is written in an unsupported language. File is not indexed.

0001 <Comment># A demonstration of some simple MIPS instructions</Comment><br/>
0002 <Comment># used to test QtSPIM</Comment><br/>
0003 <Normal Text></Normal Text><br/>
0004 <Normal Text>   </Normal Text><Comment># Declare main as a global function</Comment><br/>
0005 <Normal Text>   </Normal Text><Section>.globl</Section><Normal Text> main </Normal Text><br/>
0006 <Normal Text></Normal Text><br/>
0007 <Normal Text>   </Normal Text><Comment># All program code is placed after the</Comment><br/>
0008 <Normal Text>   </Normal Text><Comment># .text assembler directive</Comment><br/>
0009 <Normal Text>   </Normal Text><Type>.text</Type><Normal Text>           </Normal Text><br/>
0010 <Normal Text></Normal Text><br/>
0011 <Comment># The label 'main' represents the starting point</Comment><br/>
0012 <Label>main:</Label><br/>
0013 <Normal Text>   </Normal Text><Pseudo Instruction>li</Pseudo Instruction><Normal Text> </Normal Text><Other Register>$t2</Other Register><Normal Text>, </Normal Text><Decimal>25</Decimal><Normal Text>                </Normal Text><Comment># Load immediate value (25) </Comment><br/>
0014 <Normal Text>   </Normal Text><Hardware Instruction>lw</Hardware Instruction><Normal Text> </Normal Text><Other Register>$t3</Other Register><Normal Text>, value               </Normal Text><Comment># Load the word stored in value (see bottom)</Comment><br/>
0015 <Normal Text>   </Normal Text><Hardware Instruction>add</Hardware Instruction><Normal Text> </Normal Text><Other Register>$t4</Other Register><Normal Text>, </Normal Text><Other Register>$t2</Other Register><Normal Text>, </Normal Text><Other Register>$t3</Other Register><Normal Text>   </Normal Text><Comment># Add</Comment><br/>
0016 <Normal Text>   </Normal Text><Hardware Instruction>sub</Hardware Instruction><Normal Text> </Normal Text><Other Register>$t5</Other Register><Normal Text>, </Normal Text><Other Register>$t2</Other Register><Normal Text>, </Normal Text><Other Register>$t3</Other Register><Normal Text>   </Normal Text><Comment># Subtract</Comment><br/>
0017 <Normal Text>   </Normal Text><Hardware Instruction>sw</Hardware Instruction><Normal Text> </Normal Text><Other Register>$t5</Other Register><Normal Text>, Z           </Normal Text><Comment>#Store the answer in Z (declared at the bottom)  </Comment><br/>
0018 <Normal Text></Normal Text><br/>
0019 <Normal Text>   </Normal Text><Comment># Exit the program by means of a syscall.</Comment><br/>
0020 <Normal Text>   </Normal Text><Comment># There are many syscalls - pick the desired one</Comment><br/>
0021 <Normal Text>   </Normal Text><Comment># by placing its code in $v0. The code for exit is "10"</Comment><br/>
0022 <Normal Text>   </Normal Text><Pseudo Instruction>li</Pseudo Instruction><Normal Text> </Normal Text><Main Register>$v0</Main Register><Normal Text>, </Normal Text><Decimal>10</Decimal><Normal Text> </Normal Text><Comment># Sets $v0 to "10" to select exit syscall</Comment><br/>
0023 <Normal Text>   </Normal Text><Hardware Instruction>syscall</Hardware Instruction><Normal Text> </Normal Text><Comment># Exit</Comment><br/>
0024 <Normal Text></Normal Text><br/>
0025 <Normal Text>   </Normal Text><Comment># All memory structures are placed after the</Comment><br/>
0026 <Normal Text>   </Normal Text><Comment># .data assembler directive</Comment><br/>
0027 <Normal Text>   </Normal Text><Type>.data</Type><br/>
0028 <Normal Text></Normal Text><br/>
0029 <Normal Text>   </Normal Text><Comment># The .word assembler directive reserves space</Comment><br/>
0030 <Normal Text>   </Normal Text><Comment># in memory for a single 4-byte word (or multiple 4-byte words)</Comment><br/>
0031 <Normal Text>   </Normal Text><Comment># and assigns that memory location an initial value</Comment><br/>
0032 <Normal Text>   </Normal Text><Comment># (or a comma separated list of initial values)</Comment><br/>
0033 <Label>value:</Label><Normal Text>      </Normal Text><Section>.word</Section><Normal Text> </Normal Text><Decimal>12</Decimal><br/>
0034 <Label>Z:</Label><Normal Text>  </Normal Text><Section>.word</Section><Normal Text> </Normal Text><Decimal>0</Decimal><br/>