# `syscall`

[MIPS Documentation](https://asm-editor.specy.app/documentation/mips.md) › [Instructions](https://asm-editor.specy.app/documentation/mips/instruction.md)

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

**System call**

Category: System

Invokes an OS service identified by the integer in $v0.

Used in: [.data, .text and directives](https://asm-editor.specy.app/learn/courses/mips/introduction/data-text-and-directives.md) (MIPS assembly), [Memory, little endian and alignment](https://asm-editor.specy.app/learn/courses/mips/introduction/memory-little-endian-and-alignment.md) (MIPS assembly), [Words, halves and bytes](https://asm-editor.specy.app/learn/courses/mips/introduction/words-halves-and-bytes.md) (MIPS assembly), [The MIPS instruction set](https://asm-editor.specy.app/learn/courses/mips/introduction/the-mips-instruction-set.md) (MIPS assembly), [Loads, stores and immediates](https://asm-editor.specy.app/learn/courses/mips/introduction/loads-stores-and-immediates.md) (MIPS assembly), [Comparing two numbers](https://asm-editor.specy.app/learn/courses/mips/introduction/comparing-two-numbers.md) (MIPS assembly), [Memory regions and executable files](https://asm-editor.specy.app/learn/courses/mips/introduction/memory-regions-and-executable-files.md) (MIPS assembly), [Branch on compare](https://asm-editor.specy.app/learn/courses/mips/think-in-assembly/branch-on-compare.md) (MIPS assembly), [Loops](https://asm-editor.specy.app/learn/courses/mips/think-in-assembly/loops.md) (MIPS assembly), [Arithmetic, logic and bits](https://asm-editor.specy.app/learn/courses/mips/think-in-assembly/arithmetic-logic-and-bits.md) (MIPS assembly)

## Forms

- `syscall`

## Description

Common services: 1=print integer ($a0), 4=print string (addr in $a0), 5=read integer (result in $v0), 8=read string ($a0=buf addr, $a1=len), 10=exit. See the Help menu for the full list.

## Example

```mips
.data
message: .asciiz "MIPS syscall example\n"
.text
# Service 4 prints the string addressed by $a0. Service 10 exits after the line. Inspect Console: MIPS syscall example, then a newline.
la $a0, message
li $v0, 4
syscall
li $v0, 10
syscall
```
