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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started