69,368
社区成员
发帖
与我相关
我的任务
分享
printf("%f\n",ss);
004027D4 sub esp,8 //分配8个字节的空间,即double的空间,实质上相当于把参数push进堆栈
004027D7 fstp qword ptr [esp] //将ss存入新分配的8个字节的空间,完成给printf传入ss参数的任务
004027DA push offset string "%f\n" (00479078) //压入"%f\n"的地址,占用4个字节
004027DF call printf (00426ce0) //调用printf
004027E4 add esp,0Ch //回收空间,因为printf的参数共占用了12个字节。
004027E7 fld dword ptr [ebp-70h] //从内存[ebp-70h]中取数至FPU的寄存器,此时[ebp-70h]已经是损失了精度的值了
004027EA call __ftol (00426e8c) //调用__ftol
004027D1 fst dword ptr [ebp-70h] //将FPU的寄存器中取数存至内存ss
278: // printf("%f\n",ss);
279: sprintf(amt1, "%d", (int)ss);
004027D4 call __ftol (00426e7c) //直接调用__ftol,因为此时FPU寄存器中的数就是原始的最精确的ss,无需再从内存读入。
00448B0B fstp dword ptr [ebp-88h]
printf("%f\n",ss);
00448B11 fld dword ptr [ebp-88h]
00448B17 sub esp,8
00448B1A fstp qword ptr [esp]
00448B1D push offset string "%f\n" (4D02D4h)
00448B22 call @ILT+7435(_printf) (444D10h)
00448B27 add esp,0Ch
sprintf(amt1, "%d", (int)ss);
00448B2A fld dword ptr [ebp-88h] //从内存里取了数到FPU的寄存器中
00448B30 call @ILT+3480(__ftol2_sse) (443D9Dh)
00448B0B fstp dword ptr [ebp-88h]
// printf("%f\n",ss);
sprintf(amt1, "%d", (int)ss);
00448B11 fld dword ptr [ebp-88h] //从内存里取了数到FPU的寄存器中
00448B17 call @ILT+3485(__ftol2_sse) (443DA2h)
00448B1C push eax
004027D1 fst dword ptr [ebp-70h] //将FPU的寄存器中取数存至内存
278: printf("%f\n",ss);
004027D4 sub esp,8
004027D7 fstp qword ptr [esp]
004027DA push offset string "%f\n" (00479078)
004027DF call printf (00426ce0)
004027E4 add esp,0Ch
279: sprintf(amt1, "%d", (int)ss);
004027E7 fld dword ptr [ebp-70h] //从内存[ebp-70h]中取数至FPU的寄存器
004027EA call __ftol (00426e8c) //调用ftol
004027EF push eax
004027F0 push offset string "%d" (00479074)
004027F5 lea eax,[ebp-6Ch]
004027F8 push eax
004027F9 call sprintf (00426be0)
004027FE add esp,0Ch
004027D1 fst dword ptr [ebp-70h] //将FPU的寄存器中取数存至内存
278: // printf("%f\n",ss);
279: sprintf(amt1, "%d", (int)ss);
004027D4 call __ftol (00426e7c) //调用ftol
004027D9 push eax
004027DA push offset string "%d" (00479074)
004027DF lea eax,[ebp-6Ch]
004027E2 push eax
004027E3 call sprintf (00426c50)
004027E8 add esp,0Ch