NASM: why must __float32__(1.5) be used for floating point literals instead of just 1.5?

做~自己de王妃 提交于 2019-12-12 06:37:19

问题


What is the rationale for:

mov eax, 1.5

not working with:

expression syntax error

and requiring you to do:

mov eax, __float32__(1.5)

instead? The fact that it works for the dd family:

dd 1.5

makes me even more curious.

Would there be a syntax ambiguity with some other language feature in that case?

Couldn't the size just be inferred from the register size as when we do:

mov eax, 1

I have also posted on their bugtracker, but no reply so far: http://bugzilla.nasm.us/show_bug.cgi?id=3392309


回答1:


Cyrill Gorcunov replied that:

That's because @dd is a directive handled separately from mov (we have two tokenizers inside). We really hope to unify them one day but due to lack of manpower it still has not been implemented.

So basically, there is no conflict, it's just historical inconsistency which may get fixed some day.



来源:https://stackoverflow.com/questions/29925432/nasm-why-must-float32-1-5-be-used-for-floating-point-literals-instead-of-j

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