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 to prompt, read, and then print a floating point number. ALSO NEEDED: What is strange about the registers used for this program???

Solutions

Expert Solution

CODE:

.data
   #Defining the variable to store messages and default value of float.
   message1: .asciiz "Enter the value of PI: "
   message2: .asciiz "Value of PI entered: "
   zeroAsFloat: .float 0.0
.text
   lwc1 $f4, zeroAsFloat #Load the value in variable zeroAsFloat in $f4.
  
   #Display message1
   li $v0,4
   la $a0,message1
   syscall
  
   #Read user's input in $f0 by default.
   li $v0,6
   syscall
  
   #Display message1
   li $v0,4
   la $a0,message2
   syscall
  
   #Display value.
   li $v0,2
   add.s $f12, $f0, $f4 #$f12 = $f0 + $f4 and in $f4 value is 0.0 therefore $f12 = $f0.
   syscall #Print the value in $f12.

CODE SCREENSHOT:

CODE OUTPUT:

Strange about the register used for this program is that float are stored by
the coprocessor1 registers instead of general purpose register present in
Registers section


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 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...
(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...
Write a simple MIPS Assembly program to average 3 integers. Make sure to read in three...
Write a simple MIPS Assembly program to average 3 integers. Make sure to read in three numbers from the user instead of hard coding them. To divide the sum by 3 you may use div $t0, $t0, 3 where register $t0 conatins the sum of the 3 integers. .data prompt1: .asciiz " Please enter an integer: " prompt2: .asciiz " Please enter an integer: " prompt3: .asciiz " Please enter an integer: " result: .asciiz "The average of three number...
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,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT