Question

There are two programming questions for you to do. Please submit two .s or .asm files 1. (5 points) There is one twos comple

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the code below::::

.data
x : .word 2

.text
lw $t0,x #load value of x

div $t1,$t0,2 #divide by two
mfhi $t1 #load reminder in t1
beqz $t1,evenNumber
add $t0,$t0,2 #number is odd so adding two
j exit
evenNumber:
add $t0,$t0,1 #number is even so adding one
exit:

sw $t0,x #save value back to x

mips find bug.asm . data x : .word 2 check x and do even odd.asnm . text lw $t0 x #load value of x div $t1,$t0, 2 #di vi de

Add a comment
Know the answer?
Add Answer to:
There are two programming questions for you to do. Please submit two .s or .asm files 1. (5 point...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please answer questions #7-13 7. Use a direct proof to show every odd integer is the...

    please answer questions #7-13 7. Use a direct proof to show every odd integer is the difference of two squares. [Hint: Find the difference of squares ofk+1 and k where k is a positive integer. Prove or disprove that the products of two irrational numbers is irrational. Use proof by contraposition to show that ifx ty 22 where x and y are real numbers then x 21ory 21 8. 9. 10. Prove that if n is an integer and 3n...

  • lhere are two progang questions for yon ito do. Please submit two s oram les Tn...

    lhere are two progang questions for yon ito do. Please submit two s oram les Tn tho Settings menu of SPIM set Bare Machine OFF, Allow Pseudo Instructions ON, Exception Handler ON, Delayed Branches ON, Delayed Loads ON and Mapped IO OFF 1. (5 points) Sum of Integers Write a program to calculate 1 +2+3++n and then print the sum out. n is entered by the user. So if the user enters 10, your program will calculate 1+2+3+ +10 which...

  • Programming Assignment 1 Structures, arrays of structures, functions, header files, multiple code files Program description: Read...

    Programming Assignment 1 Structures, arrays of structures, functions, header files, multiple code files Program description: Read and process a file containing customer purchase data for books. The books available for purchase will be read from a separate data file. Process the customer sales and produce a report of the sales and the remaining book inventory. You are to read a data file (customerList.txt, provided) containing customer book purchasing data. Create a structure to contain the information. The structure will contain...

  • Please help me! For Problem 1, 2 and 3: You are required to submit three .c...

    Please help me! For Problem 1, 2 and 3: You are required to submit three .c files that contain the instructions that you have written to solve the following problems. Place the C source code to solve the first problem in a file called lab5a.c. Place the C source code to solve the second problem in a file called lab5b.c. And place the C source code to solve the third problem in a file called lab5c.c. Remember to include your...

  • Title: ER Operations Manager Used the files attached to answer the following Questions: o Use this Excel file C 3 and C 4 Excel file.xlsx o Use this file to submit your work C4 Part IIdocx Questi...

    Title: ER Operations Manager Used the files attached to answer the following Questions: o Use this Excel file C 3 and C 4 Excel file.xlsx o Use this file to submit your work C4 Part IIdocx Question 2: Multiple Regression: Effect of Age and General Health Status Score on Total ER Cost. 1. Purpose 2. Importance 3. Variables 4. Sample Size 5. Hypothesis 6. Methodology 7. Findings 8. Interpretations/Implications ting: Monthly Patient Volume. Question 3: Forec Scenario: You are the...

  • please tell me how to do (p), (s), (t). 85 Exercises EXERCISE 1 on for each...

    please tell me how to do (p), (s), (t). 85 Exercises EXERCISE 1 on for each of the following languages. Give a regular expression for each of the follow ke the machine from 0 back, a. label rip from 0 back co state 0 on an input b. {abc, xyz] c. a, b, d. {ax | x € {a,b]"} e axb | x € {a,b}} [ {(ab)"} assing through 0. bo a piece we already have a input string. So...

  • Python programming- Download the following two files you will need for this activity: customerData.csv This file...

    Python programming- Download the following two files you will need for this activity: customerData.csv This file contains randomly generated fictitious customer data. customer_regex.py This is a Python script that imports the customer data into a list of customer details. In your personal playground in Codio, upload the two files and investigate the contents before considering the task you will pose to your peers. Assume the position of a manager of an online retailer. Pose a question to your IT expert...

  • 1 Objective The rules for a new type of programming contest provides a list of problems,...

    1 Objective The rules for a new type of programming contest provides a list of problems, their respective score in integer points, and a statistically valid estimate of the time it takes to solve the problem. This duration or time is expressed in integer hours. To help with a solution strategy the contest organizers reveal there is a dynamic programming solution enabling all the contestants to maximize their score - and stay within the time limits for the contest. One...

  • C++ programming Submit assignment to Blackboard by the midnight on the due date listed above. (Verify...

    C++ programming Submit assignment to Blackboard by the midnight on the due date listed above. (Verify if your submission is completed.) The only people you are to discuss this project with are myself and the CS Department tutor. Duplicate code, if discovered, will result in a 0 grade. Your source file(s) should follow the Computer Science Coding Standards (available at the Computer Science Homepage) including proper indenting and spacing 1 Overview program, you will play a game of hangman. In...

  • Click Submit to complete this assessment Questions 10 points Design a digital circuit that reorders the...

    Click Submit to complete this assessment Questions 10 points Design a digital circuit that reorders the bits of a 4-bit binary number as follows: If the number is even, bits by bb bby become b, bobby. For example, 0110 becomes 1001 If the number is odd, bits bybb, b, bbecome bybob. For example, 1001 becomes 0110 Solve the following on paper, and then fill in the blanks below: NOTE: In parts 3 and 4, there is no need to draw...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT