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.
Table of Contents
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) andautoCompletion/MIPS.xml(autocompletion). On GitHub, open each one and click the download button (Download raw file).
Step 1 — Download and install Notepad++
- Go to notepad-plus-plus.org > Download and get the 64-bit installer (Installer 64-bit x64).
- 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:
- File > Save As…
- In Save as type, choose “All types (\.\)” and type the name with its extension:
suma.s. - 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:
To install it:
- Language > User Defined Language > Define your language…
- In the User Defined Language window, click Import… and choose
MIPS-colores.xml.

- Close the window and restart Notepad++.
- Open your
suma.s. Since the file says the language is for.sand.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++ 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).
- Copy
MIPS.xml(the one in theautoCompletionfolder) toC:\Program Files\Notepad++\autoCompletion\. Windows will ask for administrator permission: it’s the program’s folder. - 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.

- Restart Notepad++, open a
.sfile and typeadon a new line.

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:
| Setting | Where | Why |
|---|---|---|
| Remember the session | Settings > Preferences > Backup | When you open Notepad++, your programs are where you left them |
| Tab = spaces | Preferences > Indentation, “Replace by space” | The columns (label, instruction, operands, comment) stay aligned in any editor |
| Go to a line | Ctrl+G | You 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 in Notepad++.
- 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.
- Reload in QtSpim with File > Reinitialize and Load File (or its toolbar button). It suggests the same file: Enter and done.
- 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.sshow colours (instructions in violet, registers in coral, comments in grey)? - When you type
ad, does it suggestadd,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
| Symptom | Likely cause | Fix |
|---|---|---|
| Everything is black | The language isn’t selected or wasn’t imported | Language > MIPS; if it isn’t there, repeat step 3 and restart |
| It shows odd (x86) colours | Notepad++ chose Assembly for an .asm | Language > MIPS |
| It suggests nothing as you type | The file is missing or autocompletion is off | Check C:\Program Files\Notepad++\autoCompletion\MIPS.xml and step 4 |
| QtSpim can’t see the file | It was saved as .txt | Save As, type “All types”, name with .s |
| QtSpim runs the old version | You didn’t save | Ctrl+S (look at the tab colour) |
| The message’s accented letters look odd in the console | Strings with accents | Write the strings without accents |
Summary
| I want… | In Notepad++ |
|---|---|
| MIPS colours | Import MIPS-colores.xml in Language > User Defined Language |
| Autocompletion | MIPS.xml in autoCompletion + Preferences > Auto-Completion |
| To save for QtSpim | Ctrl+S, .s extension, UTF-8 |
| To go to the error line | Ctrl+G |
| To see if there are unsaved changes | The tab colour |
Three ideas to take away:
- QtSpim doesn’t edit: Notepad++ writes, QtSpim loads. Saving and Reinitialize and Load File always go together.
- Colours are a free typo checker: anything that should have a colour and comes out black is misspelt.
- 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 articlesDid this article help you? Here is how you can support SergioLearns →



