eflags Questions

6

Solved

Some CPUs (notably x86 CPUs) feature a parity flag on their status register. This flag indicates whether the number of bits of the result of an operation is odd or even. What actual practical purp...
Mining asked 7/9, 2014 at 4:41

1

Solved

NOT on a register holding binary 11111111 will produce 00000000, but ZF will still have its old value, so it might not be 1 even though the output value is all zero. XOR reg, -1 would do the same t...
Operant asked 7/11, 2022 at 3:47

5

Solved

Using inline assembler [gcc, intel, c], how to check if the carry flag is set after an operation?
Spinthariscope asked 29/6, 2010 at 10:24

1

Solved

As I understand it, on a modern out of order CPU, one of the most expensive things is state, because that state has to be tracked in multiple versions, kept up-to-date across many instructions etc....

2

Solved

I'm currently studying assembly language. In Microsoft visual studio 2017, I wanted to check the current status of the register flags. I wanted to know what each register flag abbreviation stan...
Gooch asked 23/8, 2017 at 6:32

3

Solved

I want to write a simple code (or algorithm) to set/clear overflow flag. For setting OF, I know that I can use signed values. But how can I clear that?
Lucey asked 22/4, 2016 at 16:5

2

Solved

Since −x = not(x)+1 which then implies a-b = a+not(b)+1, would then sub rax, rcx be equivalent to mov temp, rcx not temp add rax, temp add rax, 1 where temp is some register considered to be ...
Profluent asked 5/6, 2020 at 15:29

1

When debugging x86 assembly code in VS2013, I needed to check the contents of the FLAGS register. However, when I've enabled "Flags" in Register Window, I got: OV = 0 UP = 0 EI = 1 PL = 1 ZR = 0 A...
Scheming asked 8/11, 2019 at 6:41

2

Solved

I want to know how setting or clearing the direction EFLAG changes how the SCAS and MOV instructions decrement or increment registers. I read some webpages and made the following assumptions I will...
Callous asked 1/8, 2019 at 5:53

4

Solved

I don't understand the JG/JNLE/JL/JNGE instructions, which come after CMP. for example, If I have: CMP al,dl jg label1 When al=101; dl =200. On what we ask the jg? Is it on al>dl? or al-dl>0...
Erdda asked 8/3, 2012 at 12:46

6

Solved

From what I've read, seems like there are 9 different flags. Is it possible to read/change them directly? I know I can know for example if the zero flag is set after doing a cmp/jmp instruction, bu...
Donnadonnamarie asked 10/9, 2009 at 17:58

4

What is meant by "Applying the NEG instruction to a nonzero operand always sets the Carry flag." Why does substracting 2 from 1 set the carry flag? 00000001 (1) + 11111110 (-2) [in 2-co...
Allsopp asked 21/7, 2013 at 19:22

2

Solved

I am analyzing a sequence of x86 instructions, and become confused with the following code: 135328495: sbb edx, edx 135328497: neg edx 135328499: test edx, edx 135328503: jz 0x810f31c I understa...
Amylum asked 8/12, 2016 at 4:41

1

Solved

Here is what I see in the documentation of Intel x86-64 for neg and many other instructions (including sub, so understanding FLAGS for neg x as 0 - x depends on this). The OF, SF, ZF, AF, and PF f...
Rating asked 8/11, 2016 at 3:20

2

Solved

The whole flag thing is confusing the heck out of me. The definitions on the web seem really plain. I can't seem to get a really good applicable explanation to all this. According to their defini...
Gristmill asked 12/4, 2016 at 20:29

3

Solved

In Kip Irvine's book he talks about the mechanism to set the overflow flag, he writes: The CPU uses an interesting mechanism to determine the state of the Overflow flag after an addition or subtra...
Schnapps asked 6/11, 2015 at 18:13

2

Solved

In a disassembled code: movsx eax,[address1] # a few fpu computations dec eax # so many fpu computations jz label2 If fpu computations do not influence zero flag, then we can assume that it is e...
Staid asked 16/8, 2015 at 4:1

1

Solved

The documentation for imul states that: SF is updated according to the most significant bit of the operand-size-truncated result in the destination. For a 64-bit operation, then, my understand...
Inadequate asked 27/4, 2015 at 16:51

2

Solved

I Cannot seem to tell the difference between the Carry Flag, Auxiliary Flag and Overflow Flag in Assembly. I'm currently studying it in school and the teacher didn't go into any details. Please hel...
Tripletail asked 10/10, 2013 at 16:39

3

.data val1 BYTE 10h val2 WORD 8000h val3 DWORD 0FFFFh val4 WORD 7FFFh If val2 is incremented by 1 using the ADD instruction, what will be the values of the Carry and Sign flags? If val4 is incr...
Kopeck asked 2/6, 2014 at 8:16

1

I'm using the Win32 API to stop/start/inspect/change thread state. Generally works pretty well. Sometimes it fails, and I'm trying to track down the cause. I have one thread that is forcing context...
Juliajulian asked 1/4, 2014 at 5:44

2

Solved

I am struggling to understand the following code snippet in assembler: if ( EAX >= 5 ) EBX = 1; else EBX = 2;" In assembler this can be written as follows (according to my book), emulati...
Stinking asked 31/12, 2012 at 11:36

2

Solved

I have the next code: mov al, -5 add al, 132 add al, 1 As I check it, the overflow flag and the carry flag will set in the first operation, and in the second, only the overflow will set. But I...
Baldric asked 13/12, 2011 at 21:8

2

Solved

I am unable to understand how does the direction flag work in x86. The text in my lectures say that it increments or decrements the source or destination register but that does not make sense with ...
Kinnikinnick asked 30/4, 2012 at 7:36

1

Solved

I've been playing with assembly for a while and looking at some code. in which AL is first set to 0x84 then cmp AL, 0x30 is used. This instruction then triggers the Overflow flag. From what I read...
Timbered asked 31/8, 2011 at 18:19

© 2022 - 2024 — McMap. All rights reserved.