From: H. P. A. <hp...@zy...> - 2009-08-11 07:55:52
|
On 08/10/2009 10:54 PM, Frank Kotler wrote: > > "lahf" is only going to get the low 8 bits of the flags register, and OF > is bit 11, so you'll have to resort to pushf, manipulate the dword on > stack, and popf, I think. Something like this... (intended to be > "portable")... > Another option is to perform an operation on the arithmetic flags that affects OF, and then use LAHF/SAHF to preserve the *other* AFs: ; Trashes AX clear_of: lahf xor al,al ; OF <- 0 sahf ret set_of: lahf mov al,127 inc al ; OF <- 1 sahf ret -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf. |