System call : Invokes an OS service identified by the integer in $v0. 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.
syscall
Operands
Variants
- System call : Invokes an OS service identified by the integer in $v0. 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. syscall
.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