Your print statements MUST match the print statements in this skeleton code: Write an ARM program that
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write an ARM program that takes two integers as input, x and y, and calculates x*y using only addition. Convert the following C code into ARM: int main() { } int x, y, result=0; //read x printf("Please enter x: "); scanf("%d",&x); //read y printf("Please enter y: "); scanf("%d", &y); if (y<0) { x=0-x; y=0-y; } for (int counter=0; counter<y; counter++) { } result+=x; printf("x*y = %d\n", result); return 0; Write an ARM program that takes two integers as input, x and y, and calculates x*y using only addition. Convert the following C code into ARM: int main() { } int x, y, result=0; //read x printf("Please enter x: "); scanf("%d",&x); //read y printf("Please enter y: "); scanf("%d", &y); if (y<0) { x=0-x; y=0-y; } for (int counter=0; counter<y; counter++) { } result+=x; printf("x*y = %d\n", result); return 0;
Expert Answer:
Answer rating: 100% (QA)
section data inputxprompt asciz Please enter x inputyprompt asciz Please enter y inputspec asciz d resultspec asciz xy d section text global main main read x adrp x0 inputxprompt add x0 x0 lo12inputxp... 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
-
1. The figure below is a section of a decision tree. Calculate the expected value (EV). +12 A 0.7 B EV = 0.3 +3 2. The figure below is a section of a decision tree. Calculate the expected value (EV)....
-
I've been having issues with the programmers in this service providing a working python code that works in Idle Shell 3.11.5 when executing the run button and not getting a error message. I now have...
-
A retired couple is moved from their home to an assisted living facility, but realize this might be difficult because assisted living facilities typically involve payments coming from: Group of...
-
Table 2-5 Estonia Finland One Cell Phone 40 hours 16 hours Lumber (per board foot) 8 hours 4 hours Table 2-5 shows the number of labor hours required to produce a cell phone and a board foot of...
-
A transverse wave on a string is described by the equation y(x, t) = (0.350 m) sin (1.25 rad/m)x + (99.6 rad/s)t] Consider the element of the string at x ! 0. (a) What is the time interval between...
-
Refer to scenario in Problem 4 using the le BlueOrRed. Create a standard partition of the data with all the tracked variables and 50% of observations in the training set, 30% in the validation set,...
-
A 1.2-lb kite with an area of \(6 \mathrm{ft}^{2}\) flies in a \(20-\mathrm{ft} / \mathrm{s}\) wind such that the weightless string makes an angle of \(55^{\circ}\) relative to the horizontal. If the...
-
A company like Kicker performs warranty repair work on speakers in a manufacturing cell. The typical warranty repair involves taking the defective speaker apart, testing the components, and replacing...
-
Under what circumstances do you think a company would seek private debt ( soliciting from a single party ) rather than public debt ( an open - to - the - public issuance, like a bond ) ?
-
Write a query to display the customer code, balance, and total purchases for each customer. Total purchase is calculated by summing the line subtotals (as calculated in Problem 12) for each customer....
-
A planet has been discovered orbiting the sun - like star HD 2 0 9 4 5 8 . From the period and velocity measured by the Doppler method, its mass was calculated to be 0 . 6 9 times that of Jupiter....
-
Considering the following table of pK, values. PK values of organic and inorganic acids pKa Acid pK 51 38 CH3 CH3 NH3 H 35 CH3 CHOH 15.9 HO Acid HS HCO3 CH3COOH 4.76 C6H5COOH 4.19 15. HO+ 15.50 HSO4...
-
How is Strengths-Based Leadership theory similar to Auntehtic leadership theory? How is Strengths-Based Leadership theory different from Auntehtic leadership theory?
-
How do quality assurance professionals collaborate with cross-functional teams to develop and implement risk management strategies, ensuring the resilience and reliability of products and services in...
-
How do organizations leverage emerging technologies such as Internet of Things (IoT) sensors, blockchain, and augmented reality to enhance real-time monitoring, quality control, and product...
-
Identify prominent leadership traits Explain how to recognize and develop leadership traits Identify their own leadership traits Identify which leadership traits they prefer in other leaders Explain...
-
2. The linear transformation A is from R2R such that 0 4-8 0 A B- = Y/1 Y/2 Y3 Y4 1 2 3 4 aids on noong sdt sol doitchequ Find the 4 x 2 matrix that represents the linear transformation A when using...
-
Assessing simultaneous changes in CVP relationships Braun Corporation sells hammocks; variable costs are $75 each, and the hammocks are sold for $125 each. Braun incurs $240,000 of fixed operating...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-4. Ivan and Irene paid the following in 2012 (all by check or can otherwise be...
-
Jason and Mary are married taxpayers in 2012. They are both under age 65 and in good health. For this tax year, they have a total of $41,000 in wages and $500 in interest income. Jason and Mary's...
-
Ken paid the following amounts for interest during 2012: Qualified interest on home mortgage...........................................$4,700 Auto loan...
-
(a) Show that the variancecovariance matrix of the disturbances in (9.1) is given by (9.2). (b) Show that the two nonzero block matrices in (9.2) can be written as in (9.3). (c) Show that...
-
Using the Harrison and Rubinfeld (1978) data published in Belsley, Kuh and Welsch (1980) and provided on the Springer website as Hedonic.xls, reproduce Table 9.1. Perform the Hausman test based on...
-
Using the Monte Carlo setup for the unbalanced one-way error component model considered by Baltagi and Chang (1994), compare the various estimators of the variance components and the regression...
Study smarter with the SolutionInn App