calls to int 3d corrupt the stack

admiral coeyman admiral at
Sun Aug 17 01:14:52 CDT 2003

Sylvain Petreolle,
> Actual implementation of the int 3d call (Standalone FWAIT)
> is to patch the code to an fwait(9b) and a noop(90).
	This is what emmulators do when a real FPU is present in the system.  With
wine, it is safe to assume that an FPU of some kind will always be present so
replacing the code in the program with the direct FPU calls is the correct
	The problem is most likely that I miscalculated the offsets on the stack.  On
the return, I have to either back up or increment the instruction pointer so
that the FPU instructions are either executed from the program or skipped,
respectively.  Since there is no wine function for converting flat to
segment:offset addresses, I just did my best to hit the right point on program
return and execute FPU instructions.
> It seems that it corrupts the stack in FPU_ModifyCode and prevents vb3
> programs
> to start. (tests made with current CVS)
	Can you tell me the addresses in the IP register at the time of call and
return to the program?  I must have either miscalculated the backup or failed
to account to movement between memory segments.  Skipping the code works with
the fwait, however, the other FPU instructions will not be that easy to handle.
	God Bless You,
		--Robert 'Admiral' Coeyman

May you live as long as you wish and age but a single day.                 admiral at
Webmaster/ Linux Administrator         Computer Co-Op/CornerNet

More information about the wine-devel mailing list