Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
99 views

Does GCC, when compiling for x86 or x86_64, make sure that the Direction Flag has some specific value before it starts executing an Extended Asm block? I couldn't find any information on that in the ...
bindiff's user avatar
  • 284
3 votes
1 answer
111 views

When you perform an arithmetic operation in x86 or x86-64 and say, it results in an overflow flag being set (or any other flag), can the bits being set affect in which register the resulting value ...
19216811's user avatar
1 vote
1 answer
107 views

To be clear, I am certain that the derivation below is incorrect, but I am hoping someone can point out where in my "proof" I am wrong. I am trying to prove that the x86 instruction setb ...
EE18's user avatar
  • 201
0 votes
1 answer
153 views

I want to change flag UP to one, now it is UP = 0. I am using Visual Studio 64-bit assembly. (Intel calls this the "direction flag", DF). I tried this: .data source DB 'Hello, world!', 0 ...
Jessica Pawłowska's user avatar
1 vote
2 answers
2k views

I want to move the zero flag set as the result of a comparison, e.g. "cmp rax,rbx", into a register. I know I can use one of PUSHF/PUSHFD/PUSHFQ to push the flags onto the stack, but now I ...
RTC222's user avatar
  • 2,353
0 votes
0 answers
29 views

I understand the purpose of the pf flag, which is to indicate whether there are an even or odd number of ones in the resulting data after certain instructions manipulate the register. However, It is ...
Michael Coleman's user avatar
4 votes
2 answers
357 views

I'm building an x86 emulator, and I'm using this online x86 sandbox to check my work. In my emulator, running this code: mov AX, 0xFFFF add AX, AX ...sets AX to 0xFFFE and sets the overflow flag to 0....
Peter Malamud Smith's user avatar
7 votes
1 answer
283 views

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 ...
C7E's user avatar
  • 73
0 votes
2 answers
204 views

I'm learning 8086 assembly using emu8086, I was playing around with some rotate instructions, and as for my question I know that for more than 1 bit shifts/rotations, the behaviour of the overflow ...
blake 's user avatar
  • 107
0 votes
0 answers
54 views

I am currently learning about arithmetic operations for Intel 8086 assembly language. I was trying to figure out manually after the below code what would the status of flat bits specially overflow ...
ABIR HASSAN 's user avatar
0 votes
0 answers
302 views

i want to use single step interrupt and i understand that for make this interrupt work for every instruction the TF flag should be 1 (TF=1). and in my code i see single step interrupt work but after ...
Kaka10's user avatar
  • 9
2 votes
1 answer
752 views

In the x86 intel reference manual it says: "The overflow flag is set only if the single-shift forms of the instruction are used. [...]" But when I have the following scenario: xor eax, eax ...
stht55 's user avatar
  • 410
0 votes
2 answers
911 views

In MASM64, if I write the instruction push 0, it will push a 64-bit immediate on the stack (i.e. RSP = RSP - 8). So if I just want to push a 16-bit immediate to set FLAGS, I have no idea but write the ...
Kozue Mukai's user avatar
0 votes
0 answers
323 views

I'm currently learning about the FLAGS register in x86 based processors. I understand that the DF(Direction Flag) is used for deciding if string operation should occur backwards or forwards. Either ...
Daniel Catalano's user avatar
2 votes
1 answer
940 views

After executing the following two instructions: MOV BX, 0FD51H DEC BX I get parity flag = 1 (indicating an even number of ones) However, the binary ...
Youssef13's user avatar
  • 5,342
0 votes
1 answer
1k views

For example if I have the following piece of code: L1: cmp WORD PTR[ebx],0 jnz found add ebx,2 loop L1 jmp notFound Is the zero flag undefined for its default ...
tagog97383's user avatar
0 votes
0 answers
225 views

Let's say I have the number 0xFFFFFFFFFFFFFFFF in %rdi, and 0x7FFFFFFFFFFFFFFF in %rsi. Let's say I perform a subl %esi, %edi. Would the zero flag be set as 1, or 0? Or what if I perform an addl on ...
In Doing It's user avatar
0 votes
2 answers
620 views

I'm writing a program in NASM for Intel 80386 processor and i need to set the value of carry flag in a specific bit in GPR (general purpose register) without changing other bits in register. Are there ...
MaxiMaxi's user avatar
5 votes
1 answer
306 views

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. ...
rwallace's user avatar
  • 34.1k
1 vote
1 answer
1k views

mov al, -1 add al, 130 I am attempting to answer a question from the textbook for my x86-assembly class. One of the examples asks to explain why the over flag would help you determine if, in ...
user3322166's user avatar
2 votes
0 answers
1k views

What is the reason why adding a value into a register doesn't alter the zero flag? For example, let's say I have: mov array(,%rdi,8), %eax I would need to also do a second operation to check to see ...
samuelbrody1249's user avatar
1 vote
2 answers
564 views

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 ...
user avatar
0 votes
0 answers
65 views

Hello so I have a question about the flag register in x86. How do I know when the CF/OF is 1 or 0. AX: FFE4 decimal: -28 DX: 0002 decimal: 2 -56 = -28 x 2 DX:FFFF AX:FFC8 OF/CF: ...
thefriendlyperson's user avatar
0 votes
2 answers
3k views

My book and most sources show that when the carry flag is changed from 0 to 1, but i dont understand why the EFL register changes values in much bigger increments as show below: i put comments showing ...
user avatar
0 votes
1 answer
2k views

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 AC = ...
CDM's user avatar
  • 516