Quote:
I expected the register $v0 to store 32 (11 + 11 + 10) and $a0 to store 154 (79 + 75).
Your assumptions are wrong.
addi $v0, $zero, 11
could be written (pseudocode)
v0 <- ([$zero]+11)
That is: add the immediate integer
11
with the content of register
0
and store the result into register
v0
.
So the sequence
addi $v0, $zero, 11
addi $a0, $zero, 79
syscall
is
$v0 <- 11
$a0 <- 79
syscall
syscall
is invoked with code
11
('print_character') and argument
79
(
ASCII
code of
'O'
).
A similar argument applies to the remaining lines of the program.