Question

CE T A20 spring 201 Final Estam cussew ert haing C code Into ARM Garkx -M3 long int a ,c; unsign if C ar 200) F (a 20 else
0 0
Add a comment Improve this question Transcribed image text
Answer #1

ARM cortex- M3 assembly code for the given C code is as follows,

Code:-

main:
push rbp
mov rbp, rsp
cmp QWORD PTR [rbp-8], 199
ja .L2
cmp QWORD PTR [rbp-8], 20
jbe .L3
mov rax, QWORD PTR [rbp-24]
mov QWORD PTR [rbp-16], rax
jmp .L2
.L3:
mov rax, QWORD PTR [rbp-16]
mov QWORD PTR [rbp-24], rax
.L2:
mov eax, 0
pop rbp
ret

Add a comment
Know the answer?
Add Answer to:
CE T A20 spring 201 Final Estam cussew ert haing C code Into ARM Garkx -M3...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Convert the following C code into ARM int foo(int a, int b) { int result =...

    Convert the following C code into ARM int foo(int a, int b) { int result = 0; int i; for (i = 20; i <= 30; i++) { if (i == 24) result += 20; else if (i == 27) result = result * 2; else result = result + a + 3*b; } return result; }

  • (d) (20 points) Convert the following C code to ARM assembly. And indicate the HEX values of the ...

    (d) (20 points) Convert the following C code to ARM assembly. And indicate the HEX values of the Stack and Data sections in the table below. Note: you do not necessary have to fill in each blank space in the table. Address Value ーC Code int Arr [ ]= {2, 13, 5); int main (void) 0xFFFFFFFC StackOxFFFFFFF8 int Sum; Sum-Ar[0]+A+2*Arr[2] return 0 OxFFFFFFF4 0XFFFFFFFO | 0x0001000C Data Ox00010008 0x00010004 000010000 5 point (d) (20 points) Convert the following C code...

  • 3) What are the final values of a, b, c in the following code fragment (1.5...

    3) What are the final values of a, b, c in the following code fragment (1.5 point): int a = 6 , b = 127 , c; c = ( ++a ) + ( b -- ); Answer: 4) What are the final values of a, b, c in the following code fragment (1.5 point): int a = 6 , b = 127 , c; c = (a++) + ( -- b); Answer: 5) What is displayed by this poorly...

  • This is my code for a final GPA calculator. For this assignment, I'm not supposed to...

    This is my code for a final GPA calculator. For this assignment, I'm not supposed to use global variables. My question is: does my code contain a global variable/ global function, and if so how can I re-write it to not contain one? /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * Title: Final GPA Calculator * Course Computational Problem Solving CPET-121 * Developer: Elliot Tindall * Date: Feb 3, 2020 * Description: This code takes grades that are input by the student and displays * their...

  • 2) Write an assembly program that is algorithmically equivalent to the following C+t code Consider the variables to be 8-bit unsigned integers; you may initialize them to any values 0-255 if you like...

    2) Write an assembly program that is algorithmically equivalent to the following C+t code Consider the variables to be 8-bit unsigned integers; you may initialize them to any values 0-255 if you like for testing purposes 13 int speed, lower, a, b; 14 15 if (speed < 98) { 16 17 if (speed <80) t 18 lower++; 19 20 21 else f 23 24 25 26 else t 27 28 2) Write an assembly program that is algorithmically equivalent to...

  • ndicate the correct answers bases on the following code: public class IdentifyMyParts { public static final...

    ndicate the correct answers bases on the following code: public class IdentifyMyParts { public static final int X = 7; public int y ; public void display(){.......} } public static void main(){string [] args){ IdentifyMyParts Obj1; Obj1.X=8; Obj1.y=20; } a. IdentifyMyParts is a class b. X is a instance method c. y is an instance variable d. Obj1.X=100; e. Obj1.y=200; f. display() is a member function

  • //Can you write algorithm and comment for the fllowing C++ code. The form of algorithm and...

    //Can you write algorithm and comment for the fllowing C++ code. The form of algorithm and comment show in the picture. void cocktailSort(int pData[], int Count) { int iTemp; int ant = 0; int ans = 0; int left = 1; int right = Count - 1; int k=0; if(Count==5&&pData[0]==1&&pData[4]==0) k = 9; int t; do { int i; for (i = right; i >= left; i--) { ant++; if (pData[i]<pData[i - 1]) { iTemp = pData[i]; pData[i] = pData[i...

  • Please Update my C++ code: Implement array to replace for vector: Example --> input: 100 output:...

    Please Update my C++ code: Implement array to replace for vector: Example --> input: 100 output: A 1000Pairs.txt looks like this: {100, A } {200, A } {300, B } {400, C } {500, D } {600, E } {700, F } {800, G } {900, H } {1000, I } {1100, J } {1200, K } {1300, L } {1400, M } {1500, N } {1600, O } {1700, P } {1800, Q } {1900, R } {2000, S...

  • Calculus 1 MAT 201 Final Exam, Spring 1 2019, LAGCC Evaluate the following limits, you may...

    Calculus 1 MAT 201 Final Exam, Spring 1 2019, LAGCC Evaluate the following limits, you may use L'Hospital's rule, if it applies. -V31+4 lim 4-1 -4 a. b. Evaluate the following limit. lim xIn x x-0 2. Evaluate and explain your answer -xsin(x)+cos (x) x+1 130 dx (a.) 130 Differentiate each of the following below using the fundamental theorem of calc part 1 X cos? (1- 51) dt ) g (x) = S_ e (2c) g(t)= J x2t+1 3 Use...

  • This is my Final Multiple Choice section of my Final Exam Please answer ABCD and neatly...

    This is my Final Multiple Choice section of my Final Exam Please answer ABCD and neatly please and thank you and all questions are with microsoft visual studio c++. MULTIPLE CHOICE. Choose ONLY ONE alternative that best completes the statement or answers the question. 1) Which of the following statements are correct? 1) _______ A) char charArray[2][] = {{'a', 'b'}, {'c', 'd'}}; B) char charArray[2][2] = {{'a', 'b'}, {'c', 'd'}}; C) char charArray[][] = {{'a', 'b'}, {'c', 'd'}};D) char charArray[][]...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT