flat assembler
Message board for the users of flat assembler.
Index
> Windows > Error on a perfectly valid FLD |
Author |
|
revolution 14 Oct 2006, 03:19
The problem is not a because of a stack overflow during that instruction you highlight. Note that you enable all exception. What can happen is that there is a stack overflow previously before all exceptions are enabled, then exceptions are enabled and you subsequently get another fault (precision or operation error). Ollydbg cannot determine what the exact reason for the fault is because the SF bit is still set.
IA-32 Intel® Architecture
Software Developer’s Manual, Volume 1: Basic Architecture: 8.5.1 Invalid Operation Exception wrote: The flag for this exception (IE) is bit 0 of the x87 FPU status word, and the mask bit (IM) is bit 0 of the x87 FPU control word. The stack fault flag (SF) of the x87 FPU status word indicates the type of operation that caused the exception. When the SF flag is set to 1, a stack operation has resulted in stack overflow or underflow; when the flag is cleared to 0, an arithmetic instruction has encountered an invalid operand. Note that the x87 FPU explicitly sets the SF flag when it detects a stack overflow or underflow condition, but it does not explicitly clear the flag when it detects an invalid-arithmetic-operand condition. As a result, the state of the SF flag can be 1 following an invalid-arithmetic-operation exception, if it was not cleared from the last time a stack overflow or underflow condition occurred. See Section 8.1.3.4, “Stack Fault Flag,” for more information about the SF flag. |
|||
14 Oct 2006, 03:19 |
|
revolution 14 Oct 2006, 03:28
I forgot to mention that previous faults are not detected until the attempted execution of the next FPU instruction. You can see this happening here:
Code: finit fstp st0 ;<-- stack overflow here fstcw [var] and [var],0xffc0 fldcw [var] fld1 ;<-- exception generated here |
|||
14 Oct 2006, 03:28 |
|
Vasilev Vjacheslav 14 Oct 2006, 12:52
imho, it's problems in ollydbg
|
|||
14 Oct 2006, 12:52 |
|
UCM 15 Oct 2006, 00:11
Thanks for the help, I have tracked down the problem now (a few FXCH's with non-existent values.)
|
|||
15 Oct 2006, 00:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.