Take a moment to guess what it accomplishes? To help you with guessing the answer, here is the truth table of XOR.Īnswer: It zeroes out the register! The Visual C++ optimizer generates this code because this operation is faster than moving a literal zero to the register. Intel instruction set requires that one operand be a register type, so we cannot have both memory operands. Since this article is based on Visual C++, which uses MASM, you can assume MASM/Intel format. In our case, it does not matter which format we use because the operand is the same register. For the MASM and Intel format, the left operand is the destination operand while the right is the source operand. XOR EAX, EAXįor our first question, the instruction is bitwise exclusive OR operation with both operands and assigning the result to the destination operand. For the purpose of the quiz, assume they are 32-bit (x86) instructions. In this article, let me tell you upfront that you will not learn something useful or be a better assembly coder. I came across these instructions in the code listing while learning windows debugger. These are the assembly instructions generated by the Visual C++ compiler. Today’s article is a fun quiz guessing what these 3 Intel x86 assembly instructions below actually do.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |