# MIPS Documentation

> MIPS assembly for the MARS simulator. Covers instructions and pseudo-instructions, directives, registers, syscalls, screen and keyboard access, and using C and C++.

Web page: https://asm-editor.specy.app/documentation/mips

This reference covers the MIPS simulator’s instructions, assembler directives, registers, and services. For a service call, put its number in `$v0` and use the listed registers for its arguments and result; see [Syscalls](https://asm-editor.specy.app/documentation/mips/syscall.md).

## Chapters

- [Instructions](https://asm-editor.specy.app/documentation/mips/instruction.md): Every instruction and pseudo-instruction the assembler accepts. (224 entries)
- [Directives](https://asm-editor.specy.app/documentation/mips/directive.md): What the assembler does with the lines that start with a dot. (40 entries)
- [Syscalls](https://asm-editor.specy.app/documentation/mips/syscall.md): MARS simulator services selected by the number in `$v0`, with arguments and results in the registers listed for each service. (50 entries)
- [Registers](https://asm-editor.specy.app/documentation/mips/registers.md): The general purpose registers, the FPU and coprocessor 0. (24 entries)
- [Screen](https://asm-editor.specy.app/documentation/mips/screen.md): The bitmap display, the keyboard and console registers, and program time. (6 entries)
- [Interrupts and the timer](https://asm-editor.specy.app/documentation/mips/interrupts.md): Handle timer and keyboard interrupts, and step through an interrupt handler. (9 entries)
- [Synth](https://asm-editor.specy.app/documentation/mips/synth.md): Control eight sound channels through memory registers, with waveforms, volume envelopes, programmable wavetables and sample playback. (9 entries)
- [Input controller](https://asm-editor.specy.app/documentation/mips/input-controller.md): Read held keys, key presses and releases, mouse buttons, pointer position and wheel events through memory registers. (13 entries)
- [MIDI and sampled audio](https://asm-editor.specy.app/documentation/mips/midi-and-audio.md): Play MIDI notes and stream audio samples through memory registers. (12 entries)
- [Runtime library](https://asm-editor.specy.app/documentation/mips/runtime-library.md): The C standard library compiled programs use, which hand-written assembly can call too. (185 entries)
- [Using C and C++](https://asm-editor.specy.app/documentation/mips/using-c.md): Compile C or C++, call simulator services through <sim.h>, and debug the generated MIPS assembly. (7 entries)

## Optional

- [The whole MIPS Documentation](https://asm-editor.specy.app/documentation/mips/llms-full.txt): every entry of every Chapter in one file, to search through
