Question

In: Computer Science

(Make sure in Mips!!!) Use the correct “syscall” to create MIPS programs for the following. !!!...

(Make sure in Mips!!!) Use the correct “syscall” to create MIPS programs for the following.

!!! please use comments and ALWAYS use the correct syscall program code to end the program. !!!

1) Write a program in MIPS which asks 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.

ALSO: What annoying feature of syscall service 4 makes it impossible at this point to make the output appear on a single line???

(Make sure to comment and show screenshot if possible.)

Solutions

Expert Solution

Greetings!!

Code:

.data

prompt: .asciiz "Please enter your favourite type of pie\n"

mes1: .asciiz "So you like "

mes2: .asciiz "pie"

pie: .space 20

.text

#MAIN STARTS HERE

main:

#DISPLAY THE PROMPT MESSAGE

            la $a0,prompt #load the address of the prompt message

            li $v0,4            #parameter for display string

            syscall             #display

#READ STRING FROM THE USER

            la $a0,pie        #load the address of string

            li $a1,20          #number of characters to be read

            li $v0,8            #parameter for reading string

            syscall             #read

#DISPLAY THE MESSAGE SO YOU LIKE

            la $a0,mes1     #load the address of the prompt message

            li $v0,4            #parameter for display string

            syscall             #display

#DISPLAY THE STRING READ FROM THE USER

            la $a0,pie        #load the address of the prompt message

            li $v0,4            #parameter for display string

            syscall             #display

#DISPLAY THE MESSAGE PIE

            la $a0,mes2     #load the address of the prompt message

            li $v0,4            #parameter for display string

            syscall             #display

#END OF THE PROGRAM

            li $v0,10          #parameter for display string

            syscall             #display          

Output screenshot:

Hope this helps


Related Solutions

(Make sure in Mips!!!) Use the correct “syscall” to create MIPS programs for the following. !!!...
(Make sure in Mips!!!) Use the correct “syscall” to create MIPS programs for the following. !!! please use comments and ALWAYS use the correct syscall program code to end the program. !!! 1) Write a program to prompt, read, and then print a floating point number. ALSO NEEDED: What is strange about the registers used for this program???
(Make sure in Mips) Use the correct “syscall” to create MIPS programs for the following. !!!...
(Make sure in Mips) Use the correct “syscall” to create MIPS programs for the following. !!! please use comments and ALWAYS use the correct syscall program code to end the program. !!! 1) Explain the difference between an address and a value for data stored in memory. (this isn't a program just a basic question I also need.) 2) Write a program to print out a random number from 1..100. Hint: Use random int range syscall 42, be mindful on...
The following are to be completed using MIPS Assembly code. A.   Using syscall #4, display a...
The following are to be completed using MIPS Assembly code. A.   Using syscall #4, display a prompt for the user to enter a number. Then using syscall #5, get a decimal number from the user and save it to data memory (not into a register). After you have stored the number, display it back to the user as a 32-bit binary value. B.   Prompt the user to enter a decimal number and save it to data memory. Using addition and/or...
C++ CODE PLEASE MAKE SURE TO USE STRINGSTREAM AND THAT THE OUTPUT NUMBER ARE CORRECT 1....
C++ CODE PLEASE MAKE SURE TO USE STRINGSTREAM AND THAT THE OUTPUT NUMBER ARE CORRECT 1. You must call all of the defined functions above in your code. You may not change function names, parameters, or return types. 2. You must use a switch statement to check the user's menu option choice. 3. You may create additional functions in addition to the required functions listed above if you would like. 4. If user provides option which is not a choice...
Instructions: Please make sure everything is correct if not correct and give correct calculation pls. Absorption...
Instructions: Please make sure everything is correct if not correct and give correct calculation pls. Absorption and Variable Costing Income Statements for Two Months and Analysis During the first month of operations ended July 31, Head Gear Inc. manufactured 26,800 hats, of which 25,500 were sold. Operating data for the month are summarized as follows: Sales $183,600 Manufacturing costs: Direct materials $109,880 Direct labor 29,480 Variable manufacturing cost 13,400 Fixed manufacturing cost 10,720 163,480 Selling and administrative expenses: Variable $10,200...
I need to make sure that my answers are correct please review. The Case as following:...
I need to make sure that my answers are correct please review. The Case as following: Focus Drilling Supplies has been growing steadily over the last 20 years. With increased exploration in the mining sector, the company has decided to expand their facilities for supplies and custom drill bit production to meet the increased demand. The expansion will occur over 4 years and is expected to require $2.8 million. Management has developed a payment plan for carrying out this expansion....
use the business model canvas to create four canvases on different business concepts. Make sure to...
use the business model canvas to create four canvases on different business concepts. Make sure to include the following in the margins as per the video. 1)Key Trends 2) Industry Trends 3) Market Forces 4) Marco-economic forces
Create a generic Linked List that does NOT use the Java library linked list. Make sure...
Create a generic Linked List that does NOT use the Java library linked list. Make sure it contains or access a subclass named Node (also Generic). And has the methods: addFirst(), addLast(), add(), removeFirst(), removeLast() and getHead(). In a separate Java class provide a main that creates an instance of your LinkedList class that creates an instance of your LinkedList that contains String types. Add the five names (you pick them) to the list and then iterate through the list...
JAVA PROGRAM (Make sure that programs are running. Please discuss, if there is any compilation or...
JAVA PROGRAM (Make sure that programs are running. Please discuss, if there is any compilation or run error.) Q. 1 Calculate the expression a)         x= 7.0 + (12 %3)*5 – 3;                    b)         x= 7 + (11 / 2)*5 + 3;            Q 2: Write a program that prompts the user to enter five test scores and then prints the average test score. (Assume that the test scores are decimal numbers.) Q 3. Write a program that prompts the capacity, in gallons,...
Create your own confidence interval (you cannot use 80%, 95%, and 99%) and make sure to...
Create your own confidence interval (you cannot use 80%, 95%, and 99%) and make sure to show your work. using this sample data. 120, 124, 113, 97, 127, 96, 100, 121, 115, 109, 114, 109, 116, 110, 132, 104, 111, 104, 101, 107, 98, 135, 105, 109, 121, 107, 118, 109, 145, 98, 136, 117, 103, 118 126 129 121 105 100 120 107 120 121 99 106 109 127 114 105 102
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT