Log in

View Full Version : ... a bit of asm


stealthFIGHTER
January 11th, 2002, 18:44
Hello,

I have troubles with the following opcodes:

Code:

FLD REAL10 PTR [00426D30]
FMULP ST(1),ST
FSTP REAL10 PTR [EBP-008C]

:
:
:

MOV [EBP-0090],EAX
FILD DWORD PTR [EBP-0090]
FLD REAL10 PTR [EBP-008C]
FCOMPP
FSTSW AX
SAHF
JNZ 00426AF7


Please, can somebody explain them? (I only know It is something with real numbers).

Thanks,
sF

ZaiRoN
January 11th, 2002, 21:00
hi,
i don't know the fpu very well but:

- FLD REAL10 PTR [00426D30]: load a real pointed by [426D30] and store it in the ST(0) register
- FMULP: multiply real: ST(1) * ST(0)
- FSTP: store real in ST(0) to [ebp-8C] and then pop the value in ST(0)

the next instructions execute a comparison between floating point numbers:
-FILD DWORD PTR [EBP-0090]: similar to fld but load integer number pointed by [ebp-90]
- FLD REAL10 PTR [EBP-008C]: ...
- FCOMPP: compare real values
- FSTSW AX: store the status word in ax
- SAHF: copy the upper 8 bits of ax into the lower 8 bits of the EFLAGS register
- JNZ 00426AF: ...

this is a very little and poor explanation but if you use softice with the floating point stack window enabled (type "wf" in sice) you should be able to understand these simple passages.
btw, it's better that you download a complete fpu documentation for seeing how actually works; use google or go directly to the developer-intel site...

bye
ZaiRoN

riPPadoGG
January 12th, 2002, 07:56
ZaiRon..
To view the floating point stack, type in wf in S-Ice..
And press Shift-F3 till the mode of display float..
regds
doGG

Snatch
January 12th, 2002, 11:56
Um. Intel has a web site. Use it. Adobe has a web site use it. If you have acrobat reader and the current manual you should be set. h**p://developer.intel.com/design/pentium4/manuals/245471.htm

Read it. Makes the floating point instructions a little less garbage like. Oh ya the MMX instructions too. They are just plain garbage anyway though ehhe.

Snatch

GodsJiva
January 12th, 2002, 18:21
hey, if u want to try some funky fpu code... (not *too* hard to reverse)...

...why not look at my keygenme in the mini project area ;-)

/me wants some comments