FDIV如何在nasm、汇编中使用
我有一个总和值存储在
fstp qword [ebx] ; Copy contents of st0 to space currently on top of the system stack
如何将其除以存储在寄存器 edi 中的整数值?
我以为这只是
fdiv edi
,但它说......等等无效的
洞察力组合?
i have a sum value stored in
fstp qword [ebx] ; Copy contents of st0 to space currently on top of the system stack
how do i divide it by an integer value that is stored in register edi?
i thought it was just
fdiv edi
but it says invalid combination of....blah blah blha
insight?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不能。 FPU 无法访问整数寄存器。
You can't. The FPU does not have access to the integer registers.
正如 Jens 在他的回答中所说,FPU 无法直接访问整数寄存器。您将需要使用暂存存储器来进行传输。这是 x87 FPU 的主要缺点之一。示例代码可能看起来像这样:
...
(注意上面的代码:显然,它还没有经过测试,而且我对我的程序集有点生疏,所以它可能有问题,尽管它很好而且很短.)
As Jens says in his answer, the FPU does not have any direct access to the integer registers. You will need to use scratch memory to make the transfer. This is one of the major disadvantages of the x87 FPU. Example code might look something like:
...
(Note on the above code: it has not been tested, obviously, and I'm a little rusty on my assembly so there is probably something wrong with it, even though it's nice and short.)