Notepad++ for MIPS — colours, autocompletion and the Notepad++-to-QtSpim workflow used in the lab (and the $to I didn’t see)

Half an hour stuck on a QtSpim error: syntax error on line 14. I look at line 14: add $t2, $t2, $to. I read it five times and it looks perfect. Until I type it again by hand and realise: I’d written $to, with the letter o, instead of $t0, with a zero. In an editor without colours, “o” and “0” look almost the same. With colours, $t0 comes out in coral, like every register, and $to stays black: impossible to miss.

In this guide you get Notepad++ ready for writing MIPS: you install it, load our colours and autocompletion file (you can download it) and learn the edit, save and reload loop with QtSpim that you’ll repeat in every lab and in the exam. If you don’t have QtSpim yet, start with install QtSpim.

Why Notepad++ (and not Notepad)

QtSpim has no editor: it only loads a text file and runs it. The program is written somewhere else, and in the IC1 lab that somewhere is Notepad++ (the lab virtual machine comes with Windows, QtSpim and Notepad++). Using it at home too has three advantages:

  • Line numbers. When QtSpim says syntax error on line 14, you go straight to line 14.
  • MIPS colours. Instructions, registers, directives, numbers, strings and comments, each in its own colour: typos jump out at you.
  • It saves plain text with whatever extension you give it, without Notepad’s hidden .txt.

Before you start: what you need

  • Windows 10 or 11 (Notepad++ is Windows only; on Linux or Mac use any code editor and skip to the edit-save-reload loop).
  • QtSpim installed (guide).
  • SergioLearns’s two MIPS files, in the SergioLearns code repository: MIPS-colores.xml (colours) and autoCompletion/MIPS.xml (autocompletion). On GitHub, open each one and click the download button (Download raw file).

Step 1 — Download and install Notepad++

  1. Go to notepad-plus-plus.org > Download and get the 64-bit installer (Installer 64-bit x64).
  2. Run it and keep the default options: it installs into C:\Program Files\Notepad++.

Downloading it from a download site or an ad. In early 2026 it came out that attackers had redirected some of Notepad++’s automatic updates to installers with malware; versions 8.8.9 and 8.9.2 strengthened the update checks. Download it only from notepad-plus-plus.org and, if you already had it, update to 8.9.2 or later (? > Update Notepad++).

Step 2 — Saving a MIPS program properly

Open Notepad++, paste the suma.s program from install QtSpim (or download it from the repository’s herramientas/mips/ejemplos/ folder) and save it:

  1. File > Save As…
  2. In Save as type, choose “All types (\.\)” and type the name with its extension: suma.s.
  3. Check the encoding at the bottom right: it should say UTF-8 (not UTF-8-BOM). If not, Encoding > Convert to UTF-8 and save again.

Why .s? Because QtSpim’s dialog only shows .a, .s and .asm files. In the lab .s and .asm are used interchangeably.

QtSpim 9.1.24 accepts accented letters in comments (we tried it with Spanish comments), but avoid them in the strings the program prints: QtSpim’s console doesn’t always show them properly and in the exam they only waste your time.

Step 3 — MIPS colours

Notepad++ comes with colours for lots of languages, but not for MIPS. You add them with a user defined language (UDL): an XML file with the words and their colours. Ours (MIPS-colores.xml) follows the website’s palette:

MIPS colour legend in Notepad++Excerpt of suma.s coloured as Notepad++ shows it with the MIPS-colores.xml file and a legend: instructions in violet, pseudo-instructions in light violet, registers in coral, directives in green, numbers in amber, strings in blue and comments in grey.What each colour means (MIPS-colores.xml file).dataminutes: .word 45, 30, 60, 25msg: .asciiz "Minutes in total: ".textmain: la $t0, minutes # address of the first daybucle: beq $t1, $zero, fin addi $t0, $t0, 4Real instruction (add, lw, beq…)Pseudo-instruction (li, la, move…)Register ($t0, $a0, $zero…)Directive (.data, .word, .asciiz…)Number (also 0x1F)String in quotesComment (#)Anything black that should have a colouris a typo: $to instead of $t0, adi…
The colours don't change the program: they just help you spot typos before loading it.

To install it:

  1. Language > User Defined Language > Define your language…
  2. In the User Defined Language window, click Import… and choose MIPS-colores.xml.
Notepad++ user defined language window, in Spanish, with the Import, Export, Create new and Save as buttons
The user defined language window (Spanish interface): the Import… button is at the top left.
  1. Close the window and restart Notepad++.
  2. Open your suma.s. Since the file says the language is for .s and .asm, it gets coloured on its own, and the bottom left says User Defined language file – MIPS. If not, choose Language > MIPS (at the end of the list).
Notepad++ with suma.s open and coloured as MIPS: directives in green, instructions in violet, registers in coral, numbers in amber, the string in blue and comments in grey italics
suma.s in Notepad++ with MIPS-colores.xml (Spanish version of the program and of the interface).

Notepad++ comes with an Assembly language that picks up .asm files, but it’s for x86 assembly (the PC kind): it colours mov, eax… and not $t0 or .asciiz. If an .asm file shows odd colours, choose Language > MIPS by hand.

Step 4 — Autocompletion

With autocompletion, when you type ad Notepad++ offers add, addi, addiu, addu; when you type $t, the registers $t0–$t9; and when you type .as, .ascii and .asciiz. The list has QtSpim’s 271 MIPS words (instructions, pseudo-instructions, registers and directives).

  1. Copy MIPS.xml (the one in the autoCompletion folder) to C:\Program Files\Notepad++\autoCompletion\. Windows will ask for administrator permission: it’s the program’s folder.
  2. Settings > Preferences… > Auto-Completion: tick Enable auto-completion on each input, choose Function and word completion and leave From 1st character, or raise it to 2 if it pops up too early for you.
Notepad++ preferences, Auto-Completion section, in Spanish: auto-completion on each input enabled, function and word completion selected, from the first character, and insert selection with TAB and ENTER
Settings > Preferences > Auto-Completion (Spanish interface), as Sergio has it.
  1. Restart Notepad++, open a .s file and type ad on a new line.
Notepad++ suggesting words when typing ad in suma.s: abs.d, abs.s, add, add.d and also words from the file itself such as actual and acumulada
Typing ad: the MIPS instructions (with their icon) and words that are already in your file.

Press Enter or Tab to accept the suggestion and Esc to close it. Notice it also offers words from your own file (like acumulada, from a Spanish comment): handy for not getting your labels wrong when you type them again.

The autocompletion file has to have exactly the same name as the language (MIPS.xml, for the MIPS language). If you rename it, Notepad++ doesn’t find it and gives no warning.

Step 5 — Settings that help

These aren’t compulsory, but they make life easier:

SettingWhereWhy
Remember the sessionSettings > Preferences > BackupWhen you open Notepad++, your programs are where you left them
Tab = spacesPreferences > Indentation, “Replace by space”The columns (label, instruction, operands, comment) stay aligned in any editor
Go to a lineCtrl+GYou jump straight to the line QtSpim mentions

The edit-save-reload loop

With Notepad++ and QtSpim open at the same time (side by side, or switching with Alt+Tab), the work is always this:

Edit, save, reload and runFour-step loop: edit in Notepad++, save with Ctrl+S, reload in QtSpim with Reinitialize and Load File and run with F5 or F10; if there is an error you go back to editing.The loop you'll repeat a hundred timesEditNotepad++SaveCtrl+SReloadReinitialize and LoadRunF5 · F10error?If you don't save,QtSpim loads theprevious versionReloading clearsregisters and memory
The two most common slips are on the right-hand arrows: not saving and loading without reinitialising.
  1. Edit in Notepad++.
  2. Save with Ctrl+S. The file’s tab changes colour while there are unsaved changes: if it looks like that, QtSpim will load the old version.
  3. Reload in QtSpim with File > Reinitialize and Load File (or its toolbar button). It suggests the same file: Enter and done.
  4. Run with F5, or with F10 to go step by step (how to use QtSpim).

If QtSpim finds an error when loading, its messages show something like this:

spim: (parser) syntax error on line 14 of file C:/Users/…/suma.s
	  add  $t2, $t2, $to         # total = total + minutes
	                                                     ^

You go back to Notepad++, Ctrl+G, 14, and fix it. With colours, $to was already black before loading.

In the practical exam you hand in one file per part. Save each part under a different name from the start (part1.s, part2.s) instead of overwriting the same one: if the second goes wrong, the first stays intact.

Final check: is everything ready?

  • Is Notepad++ version 8.9.2 or later, and did you download it from notepad-plus-plus.org?
  • Does your suma.s show colours (instructions in violet, registers in coral, comments in grey)?
  • When you type ad, does it suggest add, addi…?
  • Is the encoding UTF-8 and does the file end in .s?
  • Have you done a full round: change a number, Ctrl+S, Reinitialize and Load File and F5?

Common problems and how to fix them

SymptomLikely causeFix
Everything is blackThe language isn’t selected or wasn’t importedLanguage > MIPS; if it isn’t there, repeat step 3 and restart
It shows odd (x86) coloursNotepad++ chose Assembly for an .asmLanguage > MIPS
It suggests nothing as you typeThe file is missing or autocompletion is offCheck C:\Program Files\Notepad++\autoCompletion\MIPS.xml and step 4
QtSpim can’t see the fileIt was saved as .txtSave As, type “All types”, name with .s
QtSpim runs the old versionYou didn’t saveCtrl+S (look at the tab colour)
The message’s accented letters look odd in the consoleStrings with accentsWrite the strings without accents

Summary

I want…In Notepad++
MIPS coloursImport MIPS-colores.xml in Language > User Defined Language
AutocompletionMIPS.xml in autoCompletion + Preferences > Auto-Completion
To save for QtSpimCtrl+S, .s extension, UTF-8
To go to the error lineCtrl+G
To see if there are unsaved changesThe tab colour

Three ideas to take away:

  1. QtSpim doesn’t edit: Notepad++ writes, QtSpim loads. Saving and Reinitialize and Load File always go together.
  2. Colours are a free typo checker: anything that should have a colour and comes out black is misspelt.
  3. Download Notepad++ only from its official website and keep it up to date.

With QtSpim and Notepad++ ready, you now have the same setup as in the lab. If you want to understand every QtSpim panel, carry on with how to use QtSpim.

Keep goingAll Tools articles

Did this article help you? Here is how you can support SergioLearns →