.text main: # read in data li $v0, 4 #"Enter first initial: " la $a0, prompt1 syscall li $v0, 12 #syscall 12 read char syscall move $t0, $v0 # $t0 = first initial li $t3, 0 # offset sb $t0, person($t3) # store the data li $v0, 4 #"Enter last initial: " la $a0, prompt2 syscall li $v0, 12 #syscall 12 read char syscall move $t1, $v0 # $t1 = last initial li $t3, 1 # offset sb $t1, person($t3) # store the data at the address + offset li $v0, 4 #"Enter age: " la $a0, prompt3 syscall li $v0, 5 #syscall 5 read int syscall move $t2, $v0 # $t2 = age li $t3, 4 # offset sw $t2, person($t3) # store the data at the address + offset #### print data out li $t3, 0 li $v0, 11 #syscall 11 print char lb $a0, person($t3) #print first intitial syscall li $t3, 1 # offset li $v0, 11 #syscall 11 print char lb $a0, person($t3) #print last intitial syscall li $v0, 11 #syscall 11 print char la $a0, '\n' syscall li $t3, 4 # offset li $v0, 1 #syscall 1 print int lw $a0, person($t3) #print age syscall li $v0, 11 #syscall 11 print char la $a0, '\n' syscall li $v0, 0 jr $ra .data person: .space 1 # char first_initial; //offset .space 1 # char last_initial; //offset .align 2 .space 4 # int age; prompt1: .asciiz "Enter first initial: " prompt2: .asciiz "Enter second initial: " prompt3: .asciiz "Enter age: "