main: #int x = 3; //global variable #int main(void) { # # printf("%d\n", x+5); # return 0; #} lw $t0, x # $t0 = x addi $t1, $t0, 5 # $t1 = $t0 + 5 # = x + 5 li $v0, 1 # syscall 1 printf("%d"); move $a0, $t1 # $a0 = $t1 syscall li $v0, 11 # printf("%c", '\n'); li $a0, '\n' syscall li $v0, 0 # return 0 jr $ra .data x: .word 3 #int x = 3; #global variable #.word means 4 byte value