For the following questions show all of your work It is not
For the following questions, show all of your work. It is not sufficient to provide the answers. For programming questions, please generate screenshots of your code execution, assembly codes, and your analysis/explanation, and submit with your assembly and C code.
Write a C code to compute two integers summation, and give the result to a global variable called accum. You have to use 2 functions (include main function). Compile the codes into assembly files and object files. Use objdump do disassemble them. Compare assembly codes from gcc and disassembler. You need to focus on function calls.
Solution
Here i am just providing C code
#include<iostream.h>
#include<conio.h>
int sum(int a,int b)
{int sum;
sum = a+ b;
return sum;
}
void main()
{
printf(\"Enter the first number\");
scanf(&d,num1);
printf(\"Enter the second number\");
scanf(&d,num2);
accum = sum(num1+num2);
printf(\"Sum of entered number is %d\", &accum);
}
