Data Types
Files used -> 3-data-type.c, 3-data-type.exe
Last updated
Files used -> 3-data-type.c, 3-data-type.exe
Last updated
Before diving in, a quick revision that intel introduced a separate unit for floating data types, called Floating Point Unit (SSE)(Streaming SIMD Extensions). There are 8 register from XMM0 to XMM7 for float data type. And 70 new instructions were also introduced with them. Such as movss, movaps, addss etc.
Here a few things worth noting.
Integer data is stored normally, as we saw earlier too.
Floating data is stored at memory address, and then moved using movss instruction and xmm0 register. If we check that specific memory location, dword_412168 (by double clicking). We will see →
We see 40BFAE14h (h specifies hex form). This needs to be in floating point data, so lets convert hex to float.
And we get our value in actual form, 5.99.
Next we see, from xmm0 data is placed in stack.
Then single char (44h is D) is stored
Lastly, double data is stored the way floating data was stored.
Next, data is being pushed on stack for being printed.
While working with a larger executable, we can rename the variables and functions for better understanding. (selecting variable/function and pressing N on keyboard)
After renaming the variables in above as per our understanding→
Now if we see the disassembly, its more understanding. This helps in understanding large number of disassembly