Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You must do this assignment using one of the Linux machines in our lab to make sure that everyone is using the same version of
You must do this assignment using one of the Linux machines in our lab to make sure that everyone is using the same version of the compiler In this assignment you are asked to annotate assembly language code to illustrate that you Look at the examples in the lecture notes for section 3.4, especially Example 3, and all of Examples 4, 5, and 6. Your comments should indicate what the purpose of the code is in the context of the problem being solved, not just what an individual assembly language instruction does. As an example, in Example 6 from the notes, the line: should not be annotated as: movl 12 (8ebp),Sedx /7 move i into Sedx movi 12 (tebp), \edx // more 4 bytes from memory address %(ebp+12) into %edx Part 1: Create a file called calc.c that contains the following: int calc (int x, int y, int z) return 3*x 2'y +15z; Compile the program to produce assembly code. Use: cc -01-S calc.c to produce calc.s. Copy cale.s into calc.s.txt and annotate calc.s.txt with comments to illustrate that you understand how the calculation is implemented. Make sure you identify each parameter Print out the annotated code and turn it in. Part 2: Write a main p The main program should declare three int variables, x, y, and z, and initialize them to 2, 6, and 11, respectively rogram, testcalc.c, that will test calc .c
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started