Skip to main content
Became Hot Network Question
deleted 23 characters in body
Source Link
0xC0000022L
  • 10.9k
  • 9
  • 41
  • 79
#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.

#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.

#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.

a bit of reformatting
Source Link

value of Why eax is going to variables, that's ok but why the value is goingassigned to other 'variable looked' like addresses

#include <stdio.h> int main() {

#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 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 eaxeax 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

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 0CCCCCCCCC0CCCCCCCCC is movingmoved into eaxeax. Thanks in advance. :)**

value of eax is going to variables, that's ok but why the value is going to other 'variable looked' like addresses

#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 moving into eax. Thanks in advance. :)**

Why eax is assigned to 'variable looked' like addresses

#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.

Source Link
Ramesses II
  • 323
  • 3
  • 10

value of eax is going to variables, that's ok but why the value is going to other 'variable looked' like addresses

#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 moving into eax. Thanks in advance. :)**