From: Robert A. <e.a...@st...> - 2009-08-14 07:15:20
|
> Date: Tue, 11 Aug 2009 00:54:37 -0700 > From: hp...@zy... > To: fbk...@zy... > CC: e.a...@st...; nas...@li... > Subject: Re: [Nasm-users] Setting/Clearing OF > > 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. > > > Hi, Thanks for the responses. I'll try both ways out to see which one works out the best for me. Thanks again for your time, Robert Alegrid ------------------------------------------------------------------------------ Robert Alegrid RMIT University Student #3164658 BP-079 Physics BP-083 Mathematics _________________________________________________________________ View photos of singles in your area Click Here http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fdating%2Eninemsn%2Ecom%2Eau%2Fsearch%2Fsearch%2Easpx%3Fexec%3Dgo%26tp%3Dq%26gc%3D2%26tr%3D1%26lage%3D18%26uage%3D55%26cl%3D14%26sl%3D0%26dist%3D50%26po%3D1%26do%3D2%26trackingid%3D1046138%26r2s%3D1&_t=773166090&_r=Hotmail_Endtext&_m=EXT |