Fiat Pax
Fiat Pax

Reputation: 417

Assembly - Moving Floating Point Number

I am new in Assembly, I did a lot of searches before asking this but I quite could not understand/find anything I am looking for.

fstp dword ptr [eax+00000124]

I have this line, so how do I edit it to store any floating number on [eax+00000124],

e.g. storing number 6 on that address.

mov instruction won't work good for this nor I couldn't understand/find needed fpu instruction.

Upvotes: 0

Views: 1569

Answers (1)

user555045
user555045

Reputation: 64904

To store 6.0 with fstp, you first need 6.0 in a floating point register. The easiest way to get it there is to load it from memory.. I think that sort of misses the point in this case.

Anyway you can use a normal integer mov to store it, just convert 6.0 to its bit pattern and store that,

mov dword ptr [eax+124], 0x40c00000

Upvotes: 1

Related Questions