With FPU commands, the
DWORD
and
QWORD
indicate the type of the number stored in memory (single or double precision). In your case the compiler decided to store the number 2644 in single precision.
The
FLD
command will load the number from memory, convert it to the internally used 80 bit double extended precision format, and push it onto the FPU stack. The
FSTP
command will convert the value on top of the stack to the type specified by the memory size, store it to memory, and pop the stack.
You may now wonder why the compiler uses FPU commands rather than coyping memory content. Using the FPU commands here reduces data memory (storing one value using 4 bytes instead of 8 bytes) and also program memory for 32 bit applications (using two FPU commands requires less code than copying two 64 bit values). It is also faster because FPU commands are executed independently of normal CPU instructions (as long as no synchronization between FPU and CPU is required which is performed by the
FWAIT
instruction). If you enable usage of SSE/SIMD extensions, the compiler may also use these to copy floating point values.
To compare numbers in memory reading the the raw hex data, you must know the format and convert numbers yourself if they did not have the same precision.
Some good readings are:
Wikipedia IEEE floating point[
^] article.
Intel® 64 and IA-32 Architectures Software Developer Manuals[
^]:
Volume 1, Chapter 4, Section 4.2.2: Floating-Point Data Types
Volume 1, Chapter 8: PROGRAMMING WITH THE X87 FPU.
Volume 2 contains the instruction set reference including the FPU commands.