#include <stdio.h>
int main() {
int number1, number2, sum;
printf("Enter two integers: ");
scanf("%d %d", &number1, &number2);
sum = number1 + number2;
printf("%d + %d = %d", number1, number2, sum);
return 0;
}
So this is my simple C code and it has only three variables only but when I'm debugging it in disassembly the value of eax
is also copying in other 'variable looked' like r/m32 addresses, I can't figure out why it is doing this. It can't be compiler generated code because I've switched off those options.
Here's the starting disassembly see the value of eax
is going to variables (sum
, number2
, number1
) but why it is going to [ebp-18h]
and so on. Also these [ebp-18h]
is not used in any other place in disassembly. It's just shown here.
And other question is why 0CCCCCCCCC
is moved into eax
.
Thanks in advance.