i have some question about float :
if i do some fld, would i have to pop them later ?
if yes, how do i do that without using a var ?
why is that forbidden ?
fstp var
i think it's because of eax, but how can i do that an other way ?
If your wondering how to retrieve a floak back out of the fpu it's easy:
fld F$myvar ; or fild
fadd F$myvar2 ; or any other operation you want to do to it.
fstp F$myfar3 ; this creates the product of myvar and myvar2
if you wanting to compare then I think you can do this.
fcom F$64.0
jl L1 ; Jump if less then 64
jmp L2 ; otherwise jump to L1
Hope that helped
Kenny
thanx, here is some other question :
why can't i do : fild ecx
where can i find a list of opcodes and what they do ?
thanx
(s)
I think there is only one floating point instructions that communicates directly from fp to cpu - fstsw ax - store status word to ax. This instruction is required after fp comparisons - the relevant bits in ax may then be inspected or - more simply, because the flags are in identical positions - use sahf (store ah to flags) from where conditional jumps may be made (don't depend on the overflow flag, though)
One relatively easy way to transfer (32-bit) values from cpu to fpu is to use the stack:
push ecx
fild dword ptr
obviously the cpu stack must be adjusted after the fp manipulations but this can often be done by getting the result back in a cpu register:
fistp dword ptr
fwait ;recommended (or mandatory?)
pop ecx ;the result
I believe a list of fp instructions are included somewhere at (or near):
http://developer.intel.com/design/PentiumIII/manuals/
eGo