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) 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 how to get a result that is between 1…100 and not 0...99

Solutions

Expert Solution

Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate the question. Thank You So Much.

An address will be the memory address in .data segment at which the actual value is stored. while the value is stored in register.
For example consider the below example.

In the above example. Address lable is memory address and having value 10 in it.

It will be like below in .data segment.

Hence here Address is memory address -x1001001 and value is 0x000000a.

2)

li $a1, 100 #Here you set $a1 to the max bound.
li $v0, 42 #generates the random number.
syscall #generate random number from 0-99
add $a0,$a0,1 #generate random number from 1-100

#no a0 will be having random number
li $v0,1
syscall #print the random number


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) 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???
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