In trying to assign a NaN to a variable on an x64 processor
*dest = *(float*)&sourceNaN;
where
unsigned char sourceNaN[] = {00,00, 0xa0, 0x7f};
The floating point instructions fld and fstp (seen in the disassembly) change the 0xa0 byte to an 0xe0. Thus the destination has an extra bit set. Can someone explain why this is happening? This is a Windows application.
The assembly language code:
005C9B9C mov eax,dword ptr [ebp+10h]
005C9B9F fld dword ptr [ebp-80h]
005C9BA2 fstp dword ptr [eax]