|
From: Robert A. <e.a...@st...> - 2009-08-10 23:33:22
|
Hi,
How do I set or clear the overflow flag? I can save it easily enough, but I don't know how to set or clear it. This is for part of a handler for animation scripts for a Win32 game.
;-------------------------------------------------------------------------------
; void __declspec(naked) __stdcall SetCurrentUnitExFlags(void) {
SetCurrentUnitExFlags:
lahf
mov CL, AH
; Bit 1 is already set, so if OF is set, do nothing
jo .SetConditionFlags
; Clear bit 1
btr CL, 1
.SetConditionFlags
call GetCurrentUnitID
imul EAX, UnitEx.Size
mov byte [ExtendedUnitNode + EAX + UnitEx.ConditionFlags], CL
ret
; }
;-------------------------------------------------------------------------------
; void __declspec(naked) __stdcall GetCurrentUnitExFlags(void) {
GetCurrentUnitExFlags:
call GetCurrentUnitID
imul EAX, UnitEx.Size
mov AH, byte [ExtendedUnitNode + EAX + UnitEx.ConditionFlags]
bts AH, 1
jnc .BitNotSet
; How do I set OF?
lahf
ret
.BitNotSet:
; How do I clear OF?
lahf
ret
; }
Thank you for your time
Robert
--------------------------------------------------------------------------------
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
|