1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dvinal [7]
3 years ago
15

Write a function (subroutine) that inputs a data value in register r0 and returns value in r0. The function returns y 5 a 1 bx 1

cx2, where a, b, and c are parameters built into the function (i.e., they are not passed to it). The subroutine also performs clipping. If the output is greater than a value d, it is constrained to d (clipped). The input in r0 is a positive binary value in the range 0 to 0xFF. Apart from r0, no other registers may be modified by this subroutine. Write ARM code to implement the following C operation.
Int s=0;
for ( i = 0; i < 10; i++) { s = s + i*i;)
Computers and Technology
1 answer:
umka2103 [35]3 years ago
5 0

Solution :

  int f(int x){

      \text{return a + b*x +c*x*x};

  }*/

  int f(\text{int R0}){

      int stack[2] = {\text{R1,R2}};

      \text{R1 = R0};

      \text{R1 = R1}\times \text{ R1};

      \text{R2 = C};

      R1 = R1 * C; /*R1 = cx^2*/

      \text{R2 = B};

      \text{R0 = R0} * R2; /* R0 = bx */

      \text{R0 = R0 + R1}; /*R0 = bx + cx^2 */

      \text{R2 = C};

      \text{R0 = R0 + R2}; /*R0 = a+bx+cx^2 */

      \text{R1 = stack[0];}

     \text{ R2 = stack[1];}

     \text{ return R0;}

  }

  /*\text{ARM code to implement the following C operation}

  int s=0;

  \text{for ( i = 0; i < 10; i++)}

  { \text{s = s + i } \times i;)

  */

          AREA SumSquares, code, readWrite

          ENTRY

          \text{MOV r0, #0}        ;loop \text{ counter i present at 0}

          MOV r1, #0       ; s = 0

  Loop   \text{MUL r2, r0, r0}   ;calculate i*i

          \text{ADD r1, r1, r2}   ;s = s+ i*i

          \text{ADDS r0, r0}, #1   ; i = i+1

          \text{CMP r0},#10       ; test for end

          \text{BNE} Loop        ; \text{continue until all added}

          END

You might be interested in
What is a bitmap ???
leva [86]
<span>a representation in which each item corresponds to one or more bits of information, especially the information used to control the display of a computer screen.
</span><span>represent (an item) as a bitmap.
</span>
4 0
4 years ago
Read 2 more answers
I can't find the errors! Could anyone help me please?!
enot [183]
The only syntax error I saw was that the re pattern should have been double quoted.

Other non-syntax errors are: the import statement doesn't have a valid module name. It should be "import re" . Since tutorGroup is double quoted in the re.match(), it becomes a string, not the variable from the input() function.

4 0
3 years ago
A series of events that gets the computer ready for work is known as what?
DedPeter [7]
I think the answer is the third one...
7 0
4 years ago
Read 2 more answers
What can be used to help diagnose and fix computer hardware problems?
Klio2033 [76]

the answer is D which is system utilities

hope this helps and hope it isn't wrong

8 0
2 years ago
Who is the first computer programmer​
enot [183]

Answer:

Ada Lovelace was the first computer programmer

8 0
2 years ago
Read 2 more answers
Other questions:
  • List any four routes of transmission of computer virus. <br>please give me answer​
    8·1 answer
  • ​_______ consists of the analysis​ tools, technologies, and processes by which marketers dig out meaningful patterns in big data
    7·1 answer
  • A _____ is the useful part of a transmission through a network.
    15·1 answer
  • As the demand for goods and services decreases, job growth.
    14·2 answers
  • What was the original motivation for developing the internet?
    7·1 answer
  • The Loanable Funds Market is built very similar to the Supply &amp; Demand Model. The Loanable Funds Market relates ____________
    14·1 answer
  • Choose the accurate answer from the drop-down choices.
    11·1 answer
  • Add me as a friend on Real pool 3D so we can play a round of pool!!!
    10·1 answer
  • What is the difference between an html opening tag and a closing tag?.
    7·1 answer
  • the graph at left in the tctct, c-plane models the global wind power capacity, ccc, in gigawatts, ttt years since 199619961996.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!