jumptable: prompt: top: casel: case2: case3: output: .data align 2 .word top, casel, case2, case3 -asciiz...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
jumptable: prompt: top: casel: case2: case3: output: .data align 2 .word top, casel, case2, case3 -asciiz "\n\n Input a value from 1 to 3: " .text li la syscall li syscall blez li bgt la sll add lw it s!! b sll b sll $v0, 4 $a0, prompt $v0, 5 output $s0, $s0, 2 $v0, top St3, 3 $v0, $t3, top # Default for greater than 3 $al, jumptable# Load address of jumptable $t0, $v0, 2 $t1,$al, $t0 $t2, 0($t1) $12 $s0, $s0, 1 output $s0, $s0, 3 # Code to print a string li $v0, 1 move $a0, $s0 syscall # Code to read an integer # Default for less than one # Compute word offset (multiply by 4) # Form a pointer into jumptable # Load an address from jumptable # Jump to specific case "switch" # Shift left logical one bit # Shift left logical two bits # Shift left logical three bits # Code to print an integer is 1 # Pass argument to system in $a0 # Output result What is the function/purpose of the code? How does the code work? Run the program. It is supposed to not be able to show the anticipated answer. How do you change the code so that it can output something as it is expected to do? Paste your code and screenshot here (highlight the changes you made in different colors). jumptable: prompt: top: casel: case2: case3: output: .data align 2 .word top, casel, case2, case3 -asciiz "\n\n Input a value from 1 to 3: " .text li la syscall li syscall blez li bgt la sll add lw it s!! b sll b sll $v0, 4 $a0, prompt $v0, 5 output $s0, $s0, 2 $v0, top St3, 3 $v0, $t3, top # Default for greater than 3 $al, jumptable# Load address of jumptable $t0, $v0, 2 $t1,$al, $t0 $t2, 0($t1) $12 $s0, $s0, 1 output $s0, $s0, 3 # Code to print a string li $v0, 1 move $a0, $s0 syscall # Code to read an integer # Default for less than one # Compute word offset (multiply by 4) # Form a pointer into jumptable # Load an address from jumptable # Jump to specific case "switch" # Shift left logical one bit # Shift left logical two bits # Shift left logical three bits # Code to print an integer is 1 # Pass argument to system in $a0 # Output result What is the function/purpose of the code? How does the code work? Run the program. It is supposed to not be able to show the anticipated answer. How do you change the code so that it can output something as it is expected to do? Paste your code and screenshot here (highlight the changes you made in different colors).
Expert Answer:
Answer rating: 100% (QA)
The provided code appears to be an assembly code snippet written for the MIPS architecture It seems ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
An endowment pays $20,000 every year forever with the first payment beginning today. If the discount rate is 5.53%, what is the present value of the endowment?
-
File to edit sprintf ~~~~~~~~~~~~~~~~~ #sprintf! #$a0 has the pointer to the buffer to be printed to #$a1 has the pointer to the format string #$a2 and $a3 have (possibly) the first two substitutions...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-6. On December 12, Irene purchased the building where her store is located. She paid...
-
Verify each identity by comparing the graph of the left side with the graph of the right side on a calculator. sin 4x(cos 2x - sin2x) sin 8x 2
-
A data set with whole numbers has a low value of 10 and high value of 120. Find the class width and class limits for a frequency table with 5 classes.
-
Identify three companies with shares of stock that are publicly traded on an organized stock exchange. Obtain their most recent annual reports. For USA companies, those reports are required to be...
-
How is the likelihood of the outcome of a contingency measured? In general, how does this affect the accounting for and reporting of contingencies?
-
Relative Sales Value Method During 2011, Crawford Furniture Company purchases a carload of wicker chairs. The manufacturer sells the chairs to Crawford for a lump sum of $60,000, because it is...
-
Timesensitive, will thumbs up right away \( P W T=5 \) \( [-10.45 \) Points] \( 0 / 8 \) Submissions Used Determine the periodic payments PfT on the given loan or mortgage. (Aound your answer to the...
-
Mr. Spencer has always dreamed of starting his own company specializing in parts for industrial machinery. This dream was fueled two years back when he attended a trade show that gave him an...
-
Discuss about the importance of cost accounting in assisting and supporting management decision making using only the textbook.
-
1.Krissy operates its factory 300 days per year. Its annual used of Material Y is 300,000 gallons. It carries a 2,500 gallon safety stock of material and its lead time is 3 business days. What is the...
-
(1) Consider the abstract data structures: stack, FIFO queue, priority queue, and dynamic dictionary. Answer the following questions: (a) Give the functionality and operations for each abstract data...
-
How does new costing techniques help to reduce the cost of goods sold as compared to the traditional techniques? elaborate with giving examples.
-
On January 1, 2018 Karen Company acquired a 4-year bond with a face value of Php 1,200,000 and a stated interest rate of 10% per year payable annually on December 31. The bonds were acquired to yield...
-
explain these points Increasing regulation and scrutiny from government and other bodies. regarding ethical behaviour in purchasing department The challenge of ensuring that suppliers adhere to...
-
Hardin Services Co. experienced the following events in 2016: 1. Provided services on account. 2. Collected cash for accounts receivable. 3. Attempted to collect an account and, when unsuccessful,...
-
During 2012, Tom sold Sears stock for $10,000. The stock was purchased 4 years ago for $13,000. Tom also sold Ford Motor Company bonds for $35,000. The bonds were purchased 2 months ago for $30,000....
-
In the 2012 tax year, Michelle paid the following amounts relating to her 2010 tax return: Tax deficiency..........................................$5,000 Negligence...
-
Ray and Maria Gomez have been married 3 years. They live at 1610 Quince Ave., McAllen, TX 78701. Ray works for Palm Oil Corporation and Maria works for the City of McAllen. Maria's Social Security...
-
Paymore Shoes acquired 80 percent of the voting stock of Spire Footwear on February 1, 2014, for \($21\) million. The fair value of the noncontrolling interest at the acquisition date was \($3\)...
-
Pacific Athletic Corporation owns all of the voting stock of Solovair Apparel. Acquisition cost was \($10\) million in excess of Solovairs book value of \($2\) million, and the excess was attributed...
-
Peninsula Industries and Seaport Company, a 90 percent owned subsidiary, engage in extensive intercompany transactions involving raw materials, component parts, and completed products. Peninsula...
Study smarter with the SolutionInn App