I am currently working on a small Assembler project in University. Now my question is, is it possible to get a skalar for a multiplication (int), which is given by the user, from my EAX/RAX Register to one of my FPU register like st0? I am using NASM Syntax.
Thank you
There is no way to directly transfer the content of an integer register to an x87 floating point register, you have to go through the memory. Typical code looks like this:
PUSH RAX ; push RAX on the stack
FILD QWORD [RSP] ; load eight byte integer onto FP stack
ADD RSP,8 ; release storage from stack
You can usually avoid having to fiddle around with the stack pointer by allocating some storage for this sort of transfer in your stack frame at the beginning of your function.