views:

56

answers:

1

I need to multiply an integer (two's compliment) by a floating point constant. Here is what I have:

.data
pi  dd 3.14
int dd 0ah


.code
fld pi

???

fmul ST(1), ST

How can I convert int to a floating point value for multiplying against pi?

+4  A: 

You need the fild instruction. Here's one reference: http://www.website.masmforum.com/tutorials/fptute/fpuchap5.htm

Mark Ransom
Great! And when were these instructions added to the x86 instruction set? (like with the 386/7, the 486/7...?)
George Edison
With the 8087 (http://en.wikipedia.org/wiki/X86_instruction_listings)
Artelius
@Art: Ah, I see. Thanks!
George Edison