# Starter file for ex1.asm .data 0x0 input: space 22 ... .text 0x3000 main: ... ... #----------------------------------------------------------------# # Write code here to do exactly what main does in the C program. # # Please follow these guidelines: # # Use syscall 8 to do the job of fgets() # Then call a_to_i to perform conversion from string to integer # Then use syscall 1 to print the integer result #----------------------------------------------------------------# ... ... end: ori $v0, $0, 10 # system call 10 for exit syscall # we are out of here. a_to_i: #----------------------------------------------------------------# # $a0 has address of the string to be parsed. # # Write code here to implement the function you wrote in C. # Since this is a leaf procedure, you may be able to get away # without using the stack at all. # # $v0 should have the integer result to be returned to main. #----------------------------------------------------------------# ... ... jr $ra