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
-
Suppose our Sun is about to explode. In an effort to escape, we depart in a spacecraft at v = 0.800c and head toward the star Tau Ceti, 12.0 ly away. When we reach the midpoint of our journey from...
-
At 25°C, the standard enthalpy of formation of HF(aq) is given by -320.1 kJ/mol; of OH-2(aq), it is -229.6 kJ/mol; of F-(aq), it is -329.1 kJ/mol; and of H2O(l), it is -285.8 kJ/mol. (a)...
-
True or False. The analyst should provide at least one plot from their instrumentation in the report that substantiates their findings.
-
Walter Campbell was a very giving person all of his life. His surviving children speak frequently of his generosity not only toward his deceased wife but also too many beyond his immediate family....
-
Creation of money by chartered banks Hypothesis: The desired (mandatory) reserve rate is 10% and the bank's initial balance sheet is: Active Loans: $900 Total reserve at the central bank:$100...
-
You are an Examiner for the Refund Integrity Program in the GST/HST Audit Division of the Canada Revenue Agency (CRA). Using sophisticated analytical tools, you are able to identify GST/HST returns...
-
Using 2021 tax law, indicate: the taxpayers' correct and most favorable filing status; whether the taxpayer is eligible to claim either the Child Tax Credit and/or the Other Dependent Credit; and...
-
Psychology Professional and Ethical Issues: Please show ethical decision model on how to effectively manage boundaries and technology.
-
John read a book on effective teamwork and reorganized his department into teams. He assigned each of his eight people to at least one project team and assigned each one of them to head up at least...
-
Southern Alliance Company needs to raise $24 million to start a new project and will raise the money by selling new bonds. The company will generate no internal equity for the foreseeable future. The...
-
A government fund owns equipment worth $100,000 that is depreciated on a straight line basis for its useful life of 10 years. Each year the government spends $4,000 to maintain the equipment. What...
-
Instructions: Pick a phobia to design a paper on and turn it in. Read the information and summarize it .Phobias: Have students choose a phobia and then search on the Internet for information...
-
Bellingham Company produced 5,300 units of product that required 5.5 standard direct labor hours per unit. The standard variable overhead cost per unit is $4.40 per direct labor hour. The actual...
-
Imagine you are the HR manager at a company, and a female employee came to you upset because she felt a male coworker was creating a hostile work environment by repeatedly asking her out on dates...
-
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...
-
You are setting up a chatbot agency to service marketing, sales and customer services teams. Discuss the advantages and disadvantages of setting up the business as a sole trader or company and the...
-
Principles for Responsible Management Education (PRME) is a not-for-profit entity. It engages business schools to ensure they provide future leaders with the skills needed to balance economic and...
-
Entities are expected to perform in environmental, governance and social areas as well as profit (unless a not-for-profit entity). List some key performance indicators applicable to each sphere.
Study smarter with the SolutionInn App