use of FFREE and FDECSTP

狂风中的少年 提交于 2019-12-11 05:56:59

问题


I cannot understand this things: what is the use of such commands (FFREE, FDECSTP)? Can it ve used to pop value out of the fpu stack, or this is for some another purpose? I dont get it :/ Could someone explain that, tnx


回答1:


Yes, using FFREE, FINCSTP and FDECSTP you can manage the FPU stack manually. Note that FPU stack grows down similar to the CPU stack, so to remove (pop) something you mark the register as free and increment the stack pointer.

You won't see these instructions in typical code, especially since they can only operate one register at a time. In case of CPU stack using ADD ESP, x you can discard multiple items in one go, you can't do that with the FPU stack. As such, typically you use FSTP st(0) to discard one item, instead of the equivalent FFREE + FINCSTP pair. When allocating an item, you normally want to initialize too, so use some FLD variant.



来源:https://stackoverflow.com/questions/13335395/use-of-ffree-and-fdecstp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!