Skip to main content
added 7 characters in body
Source Link
davey
  • 421
  • 2
  • 7

x86_32 machine code, 2 bytes

08048540 <add7>:
 8048540:   01 c8                   add    %ecx,%eax

Assuming the two values are already in the ecx and eax registers, performing the add instruction will add the values of the two registers and store the result in the destination register.

You can see the full program written in C and inline assembly herehere. Writing the wrapper in C makes it easier to provide inputs and do testing, but the actual add function can be reduced down to these two bytes.

x86_32 machine code, 2 bytes

08048540 <add7>:
 8048540:   01 c8                   add    %ecx,%eax

Assuming the two values are already in the ecx and eax registers, performing the add instruction will add the values of the two registers and store the result in the destination register.

You can see the full program written in C and inline assembly here. Writing the wrapper in C makes it easier to provide inputs and do testing, but the actual add function can be reduced down to these two bytes.

x86_32 machine code, 2 bytes

08048540 <add7>:
 8048540:   01 c8                   add    %ecx,%eax

Assuming the two values are already in the ecx and eax registers, performing the add instruction will add the values of the two registers and store the result in the destination register.

You can see the full program written in C and inline assembly here. Writing the wrapper in C makes it easier to provide inputs and do testing, but the actual add function can be reduced down to these two bytes.

Source Link
davey
  • 421
  • 2
  • 7

x86_32 machine code, 2 bytes

08048540 <add7>:
 8048540:   01 c8                   add    %ecx,%eax

Assuming the two values are already in the ecx and eax registers, performing the add instruction will add the values of the two registers and store the result in the destination register.

You can see the full program written in C and inline assembly here. Writing the wrapper in C makes it easier to provide inputs and do testing, but the actual add function can be reduced down to these two bytes.