Question
Translate the following C++/Java Code snippets into MIPS. Assume readInt is some value already read from...

Translate the following C++/Java Code snippets into MIPS. Assume readInt is some value already read from the keybaord. if (readInt > 0 && readInt < 500) {y = readInt *10;} else {y = readInt *100;} # readInt $s0 # y $s1 1i $t0 500 # 500 for if condition 1i $t1 10 # 10 for multiplication 1i $t2 100 # 100 for multiplication
Answers
Code:-
.data ##data section where variables are declared and intialized
.text
main:
blez $s0,ELSE ##if conditon readInt > 0
bge $s0,$t0,ELSE ##if condition readInt < 500
##if the variable passes two of the conditions then only will read this part otherwise ELSE partmult $s0,$t1 ##multiplying of $s0 and $t1
mflo $s1 ## copying the result into $s1 i.e y
j END ##skipping the ELSE part
ELSE:
mult $s0,$t2 ##multiplying of $s0 and $t1
mflo $s1 ## copying the result into $s1 i.e yEND:
li $v0,10 ##close of the program
syscall ##system call
Similar Solved Questions
1 answers
I, for some reason, cannot pinpoint where exactly this pretax income (income before taxes) comes from....
I, for some reason, cannot pinpoint where exactly this pretax income (income before taxes) comes from. Been doing what my professor says word for word but I'm trapped. This comes from USAT's income statement on WSJ. If you need more information I will provide it. What I have is wrong Below ...
1 answers
Check My Work The figure below shows a long-run average cost curve. What part of the...
Check My Work The figure below shows a long-run average cost curve. What part of the long-run average cost curve exhibits economies of scale? Cost per unit 2 83% 929 a. Between 10 and 20 units per hour b. Between 20 and 40 units per hour c. Between 40 and 50 units per hour d. Along the entire curve...
1 answers
9. (8 pts) An exotic elementary particle omega minus ()has spin a) Calculate the magnitude of...
9. (8 pts) An exotic elementary particle omega minus ()has spin a) Calculate the magnitude of the spin angular momentum vector for his particle. b) Does the S2 obey the Pauli Exclusion Principle, why or why not?...
1 answers
Research the Flexner Report. How did this report transform medical school in the early 1900s, and...
Research the Flexner Report. How did this report transform medical school in the early 1900s, and how did existing medical schools respond? How did the change in curriculum requirements affect the profession of medicine?...
1 answers
How do I figure out what this bacteria is? What are the procedures in the laboratory...
How do I figure out what this bacteria is? What are the procedures in the laboratory to find this bacteria? What is the bacteria called? Rose Plate Negative Stain Gram Stain...
1 answers
Production department A use hydraulic valves as an input and can buy these valves at an...
Production department A use hydraulic valves as an input and can buy these valves at an external market price of $800 per unit. This department requires 10,000 valve per period. Production department B has capacity to 9,000 of Department A's valves. It produces these valve at a unit variable cos...
1 answers
2) Construct a table (or use the one below) with 9,w, AU, AH as the headings....
2) Construct a table (or use the one below) with 9,w, AU, AH as the headings. Determine whether each of these quantities is postive, negative, or zero for five (5) of the following nine processes. (If you choose more than five, only the first five answers will be graded, so decide which five you are...
1 answers
4. -/2 points SerPSE10 21.5.P.018. B My A gasoline engine has a compression ratio of 9.00...
4. -/2 points SerPSE10 21.5.P.018. B My A gasoline engine has a compression ratio of 9.00 and uses a gas for which y = 1.40. (a) What is the efficiency of the engine if it operates in an idealized Otto cycle? (b) If the actual efficiency is 17.0%, what fraction of the fuel is wasted as a result of f...
1 answers
Blogs with strict post length limits are called ___________. forums microblogs podcasts micromedia Which of the...
Blogs with strict post length limits are called ___________. forums microblogs podcasts micromedia Which of the following is the first stage in creating an effective social media plan? A. Identify the target audience. B. Set social media objectives. C. List...
1 answers
Fol variable and fixed costs!) w Method of cost analysis estimate a cost formula for maintenance...
Fol variable and fixed costs!) w Method of cost analysis estimate a cost formula for maintenance What total factory overhead costs would you expect the company to incur an operating level of 70,00 D Labour-hours? cur at an operating level of 70,000 direct PROBLEM 6-7 Applying the Hic ving the High-L...
1 answers
The text (The Art of Enterprise Information Architecture) introduces Business Performance Management and implicit to that...
The text (The Art of Enterprise Information Architecture) introduces Business Performance Management and implicit to that discussion are Key Performance Indicators (KPIs). Why are KPIs important in the context of enterprise architecture? What TWPs are likely to reflect or be impacted by KPIs?...
1 answers
Give notes to what each look like and description in text form Lab#1 –Learning Some Basics...
give notes to what each look like and description in text form Lab#1 –Learning Some Basics applied Skills We have completed our initial install of Ubuntu and begun to feel our way around our new system. The following assignment will help you familiarize yourself with your new environment. Plea...
1 answers
The figure below shows a plane electromagnetic sinusoidal wave propagating in the x direction. Suppose the...
The figure below shows a plane electromagnetic sinusoidal wave propagating in the x direction. Suppose the wavelength is 48.0 m and the e field vibrates in the xy plane with an amplitude of 18.0 V/m. (a) Calculate the frequency of the wave. 6.25 MHz (b) Calculate the magnetic field B when the electr...
1 answers
Hybrid cars are touted as a "green" alternative; however, the financial aspects of hybrid ownership are...
Hybrid cars are touted as a "green" alternative; however, the financial aspects of hybrid ownership are not as clear. Consider the 2014 Edsel 550h, which had a list price of $6,000 (including tax consequences) more than the comparable Edsel 550. Additionally, the annual ownership costs (othe...
1 answers
Questions 6-8: Phthalic anhydrides are used a lot in synthesis. In 2013 they were used to...
Questions 6-8: Phthalic anhydrides are used a lot in synthesis. In 2013 they were used to create potential anti-inflammatory agents by reacting with glycine to create Phthaloylglycine. The authors then carried out the following steps to create the final product. Fill in the necessary reagents or pro...
1 answers
Could you give a list of recommended temperature sensor that has a good figure of merit and at the same time small sized for Biomedical Temperature BLE wireless sensor development. The sensor has to b...
Could you give a list of recommended temperature sensor that has a good figure of merit and at the same time small sized for Biomedical Temperature BLE wireless sensor development. The sensor has to be tissue embeddable too....
1 answers
Joyce is a single, cash-method taxpayer. On April 11,2014, Joyce paid $120 in state income taxes...
Joyce is a single, cash-method taxpayer. On April 11,2014, Joyce paid $120 in state income taxes with her 2013 state income tax return. During 2014, Joyce had $1,600 in state income taxes withheld. On April 13,2015, Joyce paid $200 with her 2014 state tax return. During 2015, she had $2,100 in state...