Question: Write a MIPS program which prompts the user to enter their favorite type of pie. The program should then print out So you like _____

Write a MIPS program which prompts the user to enter their favorite type of pie. The program should then print out "So you like _____ pie", where the blank line is replaced by the pie type entered.

This is what I wrote but can't get so 'you like [apple] pie on the same line'

.data prompt: .asciiz "What is your favorite type of pie? " # our prompt output1: .asciiz "So you like " # the first part of the output output2: .asciiz " pie" # the second part input: .space 32 # the variable to store the user input .text main:

li $v0, 4 #print the prompt first la $a0, prompt syscall

li $v0, 8 # read the input string into the input variable la $a0, input li $a1, 32 li $a2, 1 syscall

li $v0, 4 # print the first part of the output la $a0, output1 syscall la $a0, input syscall la $a0, output2 syscall

li $v0, 10 #exit syscall

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!