gpt4 book ai didi

assembly - 将寄存器值加载到 FPU 堆栈

转载 作者:行者123 更新时间:2023-12-02 04:19:09 24 4
gpt4 key购买 nike

我目前正在开发一个同时使用 CPU 和 FPU 寄存器的汇编程序。我的问题涉及如何将寄存器值加载到 FPU 堆栈(即 ecx)。

mov    ecx, 10d    ; Load 10 into ECX
fldpi ; Load Pi
fild ecx ; This does not work, it does however for .data variables
fmul ; Multiply

任何帮助将不胜感激。我正在使用 Visual Studio 2015/MASM 进行开发,使用 .386 和 .model flat、STDCALL。

最诚挚的问候,Z

最佳答案

你可以这样做:

mov [temp_mem],ecx
fild dword ptr [temp_mem]

push ecx
fild dword ptr [esp]
pop ecx

或者您可以在数据部分中只包含常量 10:

.data
ten dd 10
.code
fild dword ptr [ten]

关于assembly - 将寄存器值加载到 FPU 堆栈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31746253/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com