.macro Reading Number li $v0, 5 # Code to read integer syscall .end_macro Macro to Print...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
.macro Reading Number li $v0, 5 # Code to read integer syscall .end_macro Macro to Print in Integer- .macro PrintNumber(%format, %NoInReg) li $v0, %format # Code to read integer move $20, %NoInReg syscall .end_macro Macro to Print Text Message. # .macro PrintTextMessage(%Mess) .data Text: .asciiz %Mess space 120 .text li $v0, 4 # Code to print text message la $a0, Text syscall .end macro .data x: .byte 0 y: byte 0 ************** Main Program here .text Main: PrintText Message("\n Welcome to Assembly Language Programming... !") Repeat: PrintText Message("\n Enter value for x =") ReadingNumber # Reading integer #x is updated with integer #x is loaded into $t1 # Multiplying St1 by 2 sb $v0, x lb St1, x sll St1, St1, 1 PrintTextMessage("\n Value of 2x=") *** PrintNumber(1, St1) addi $t1, St1, 10 # 2x + 10 sb St1, y # Update value of y PrintTextMessage("\n Value of y=(2x+10)= ") PrintNumber(1, St1) j Repeat # Goto Label "Repeat' Statement: Statement: Recode the above program to compute the area of a circular disk: A = πr². Here, r is radius of the circular disk. Code: .macro Reading Number li $v0, 5 # Code to read integer syscall .end_macro Macro to Print in Integer- .macro PrintNumber(%format, %NoInReg) li $v0, %format # Code to read integer move $20, %NoInReg syscall .end_macro Macro to Print Text Message. # .macro PrintTextMessage(%Mess) .data Text: .asciiz %Mess space 120 .text li $v0, 4 # Code to print text message la $a0, Text syscall .end macro .data x: .byte 0 y: byte 0 ************** Main Program here .text Main: PrintText Message("\n Welcome to Assembly Language Programming... !") Repeat: PrintText Message("\n Enter value for x =") ReadingNumber # Reading integer #x is updated with integer #x is loaded into $t1 # Multiplying St1 by 2 sb $v0, x lb St1, x sll St1, St1, 1 PrintTextMessage("\n Value of 2x=") *** PrintNumber(1, St1) addi $t1, St1, 10 # 2x + 10 sb St1, y # Update value of y PrintTextMessage("\n Value of y=(2x+10)= ") PrintNumber(1, St1) j Repeat # Goto Label "Repeat' Statement: Statement: Recode the above program to compute the area of a circular disk: A = πr². Here, r is radius of the circular disk. Code:
Expert Answer:
Answer rating: 100% (QA)
The provided code is a basic MIPS assembly language program that reads an integer performs some calculations and prints messages and numbers To recode ... 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
-
A multi-year lease agreement for commercial office space requires annual beginning of-year lease payments of $120,000 for each of the next five years. If the cost of capital is 10%, what is the value...
-
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...
-
Kara just graduated from college and has never had a credit card. Having a convenience user credit philosophy, what factors are most important to Kara in acquiring a credit card?
-
Measure each amount given in Problems 1721. a. Container C in ounces b. Container C in milliliters mL 500- 400- 300 200- 100 cups 2 1 -16-ez -14 oz -12 oz -110 oz 8 oz -16 oz -4 oz 2 oz Container C...
-
A and B are events such that P(A) = 0.4, P(B) = 0.5, and P(A& B) = 0.2. Answer each question and explain your reasoning. a. Are A and B mutually exclusive? b. Are A and B independent?
-
Two identical firms save money from polluting. A firm's marginal savings from emitting an amount \(e\) are given by 10-2e. The two firms differ in their impact on ambient pollution concentrations....
-
7. Claus Scherer worked for Rockwell International and was paid over $300,000 per year. Rockwell fired Scherer for alleged sexual harassment of several workers, including his secretary, Terry Pendy....
-
During 2014, the Town of Falmouth had a number of transactions that affected net position of its town skating rink, which is operated as an enterprise fund. You are provided with the following...
-
Cash book balance how it's work???. 6 Bank Statement Balance $ 1.584.00 Add: Outstanding Deposit 3. 250.00 4. 834.00 Less: Outstanding Cheques 10 #231 $ 1.660.00 1 #232 1.940.00 12 #233 926.00...
-
Carl Kay is the vice-president of KM Ltd., a Canadian-controlled private corporation located in Halifax, Nova Scotia. KM operates a real estate development business constructing and selling...
-
QUESTION FIVE INFORMATION The following information relates to the only product made by Fabby Limited for the year ended 31 December 2021: Opening Inventory Number of units manufactured Number of...
-
The company considers its equity investment in foreign affiliates capital which is at risk, subject to hedging depending on the individual country, currency, and market. McDonald's Corporation has...
-
This will be in python using visual studio. if you need more information just let me know Thank you so much Task 1: Rectangle and Ellipse Learning Objectives This task is focused on the following 1...
-
Sunland Lake Boat Company's bank statement for the month of September 2024 showed a balance per bank of $6,500. The company's Cash account in the general ledger had a balance of $5,800 at September...
-
Review a published journal article of your choosing that was written within the last 5 years from one of the online EKU library data bases . Select an article that is on a topic that is close to your...
-
What is the fair price for a bond with a 6% annual coupon and 8 years left until maturity that yields 7%?
-
Return to question The Swanson Corporation's common stock has a beta of 1.11. Assume the risk-free rate is 4.6 percent and the expected return on the market is 12.1 percent. What is the company's...
-
The Ferris wheel in the figure has a radius of 68 feet. The clearance between the wheel and the ground is 14 feet. The rectangular coordinate system shown has its origin on the ground directly below...
-
Kathy Kennedy (age 44) is a single taxpayer and she lives at 212 North Pine Way, Payson, AZ 85541. Her Social Security number is 467-98-9784. Kathy's earnings and income tax withholding as the...
-
Professor Patricia (Patty) Pate is retired from the PalmSprings Culinary Arts Academy (PSCAA). She is a single taxpayer and is 68 years old. Patty lives at 98 Colander Street, Henderson, NV 89052....
-
Deborah purchases a new $30,000 car in 2012 to use exclusively in her business. If Deborah does not elect to expense or take bonus depreciation in 2012 and holds the car until it is fully...
-
Calculate \(\frac{23}{42}+\frac{9}{56}\) using Desmos.
-
Express the following rational numbers in lowest terms: 1. \(\frac{36}{48}\) 2. \(\frac{100}{250}\) 3. \(\frac{51}{136}\)
-
Determine if \(\frac{12}{30}\) and \(\frac{14}{35}\) are equivalent fractions.
Study smarter with the SolutionInn App