here is my code:

mov ax, ;Load single word of data

fild eax ; word now becomes DWORD

Why doesn't it work? :)

As far as I know, this should work fine.
Posted on 2001-10-04 23:36:55 by Kenny
What about the stuff you have stored in the upper part of EAX? Use 'movzx eax, WORD PTR ' instead or put a 'xor eax,eax' before the whole thing. Wait a minute, can you load integers from registers into the FPU?
Posted on 2001-10-05 00:48:33 by gliptic
I found out looking at the Intel manual that I can't, and I can only use imm16(32,64), so lemme rephrase my question:

"How can I load a sequence of words or bytes into the FPU?"

What I have is a heightmap that is either 8 or 16 bits in height, and I need to somehow get that height from the heightmap, and place the height of that represented on a vertex
Posted on 2001-10-05 01:07:19 by Kenny
I see no problems doing that using LOCALS.


fild stuff
Posted on 2001-10-05 01:10:40 by gliptic
Kenny, you cannot put a register on FPU stack directly... you have to use a memory location.

So if want to load the content of eax do, for example:

.data ?
Value1 dword ?

mov Value1, eax
fild Value1

Bye, Saiwa
Posted on 2001-10-05 02:11:50 by Saiwa
How about just
fild word ptr
Posted on 2001-10-05 03:37:37 by Eóin
Thanks E?in, I'm going with that method :) I hope it works...
Posted on 2001-10-05 12:25:14 by Kenny
Sorry guys - no word ptr addressing mode is allowed there ! Only dword and quad-word pointers ! (Last for 64-bit integers !)

Greetings, CALEB
Posted on 2001-10-05 16:36:07 by Caleb
No Caleb, it works grand. 16, 32 & 64 bit integers are all allowed:)
Posted on 2001-10-05 18:24:32 by Eóin
Uups - sorry ! I didn't have remembered this !
Posted on 2001-10-05 19:07:33 by Caleb