NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: stressful on November 04, 2014, 08:53:44 PM
-
Hi. Could somebody explain to me why I can't push a qword precision constant into a stack?
push qword 34.5 ;fail
call something
But this one works...
mov rax,34.5
push rax
call something
Why do I have to put them into a register first? Similarly, I can push a qword integer constant directly without any problem.
Thanks.
-
I'm not very familiar with 64-bit code, but I consider it decidedly "weird". I suspect that your "qword integer constant" actually fits into a dword, and that's why it works(?). If putting your "double" into a register works, I'd just "go along with it" for now...
Best,
Frank
-
If putting your "double" into a register works, I'd just "go along with it" for now...
Best,
Frank
ok ;D
-
Why do I have to put them into a register first? Similarly, I can push a qword integer constant directly without any problem.
There are no opcodes in x64 that enable direct qword constant to memory, thus you can neither push, nor mov, an immediate qword. I personally don't understand the reasoning for the inability to do this by the chip makers, maybe someone from Intel or AMD can chime in here, but it is what it is.