I am trying to experiment with an inline assembly, and I am trying to add decimal numbers (no, NOT integers) in an inline assembly. The problem occurs when I call the following function:
inline double ADD(double num1, double num2) { double res; _asm{ push eax; push the former state of eax onto stack mov eax, num1; add eax, num2; mov res, eax; pop eax; restore the former state of eax now that we are done } return res;}
The compiler complains about the wrong operand size on the built-in assembly (ALL assembly lines, excluding push and pop lines). So I need to switch to an integer type like unsigned long, and then it works, but of course it only supports integer types; decimal results are rounded.
Is there a way to add to an assembly that allows decimal results, like 8.4?
source share