Difference between “or eax,eax” and “test eax,eax” [duplicate]
This question already has an answer here: Test whether a register is zero with CMP reg,0 vs OR reg,reg? 2 answers What's the difference between or eax,eax and test eax,eax ? I've seen different compilers produce both for the same comparison and as far as documentation goes they do exactly the same thing, so I'm wondering why they don't all use test eax,eax . Thinking about it and eax,eax would set the flags in an identical fashion as either but I haven't seen it in either freepascal, delphi, or msVC++. I did compile some asm blocks in delphi and checked out the assembler source and all 3 forms