In MIPS Assembly language, when do you know when to use syscall?

740 views Asked by At

I am not looking for a subjective answer, but rather a concrete one. I thought you were supposed to use syscall when you finish writing an instruction.

However, the following code when put into QTSpim gives me the error: "Unknown System Call: 115".

.text
main:
li $v0, 12
syscall

add $s0, $v0, $0
syscall

move $a0, $s0
li $v0, 11
syscall

li $v0, 10
syscall

.data

After looking into it a little deeper, I discover that this works:

.text
main:
li $v0, 12
syscall

add $s0, $v0, $0
move $a0, $s0
li $v0, 11
syscall

li $v0, 10
syscall

.data

So why is this so, and when are you supposed to use syscall so it works without errors?

0

There are 0 answers