Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the OF to equal 1

Status
Not open for further replies.

Netherbeast

Programmer
Jun 4, 2002
89
US
How can I get the OF to equal 1 by adding 2 32bit integers?
This is what I tried:

.data
var5 DWORD 0ffffffffh
var6 DWORD 0ffffffffh

.code
mov eax, var5
add eax, var6
call DumpRegs
 

Adding -1 to -1 to get -2, this does not produce a carry with overflow.

try adding 1 to 07Fh (127) or 07FFFFFFFh

07FFFFFFFh is the largest positive value a signed 32 bit register can hold.

on the other hand if you just want to set the OF flag try:

(32bit)

pushf
pop eax
or eax,0800h ;set OF in eflags
push eax
popf
"There are 10 types of people in this world, those who know binary and those who don't!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top