#--------------------------------------------------- # Example program to print a string # and read an integer from the kayboard and store # that integer at location x. #--------------------------------------------------- .data output_msg: .asciiz "Enter an integer: " .align 2 x: .word 0 .text main: # print a message to the console li $v0, 4 la $a0, output_msg syscall # read an integer from keyboard li $v0, 5 syscall # store the integer read in location x la $t0, x sw $v0, 0($t0) jr $ra