12.07.2015 Views

Intel® Extended Memory 64 Technology Software Developer's Guide

Intel® Extended Memory 64 Technology Software Developer's Guide

Intel® Extended Memory 64 Technology Software Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CMPXCHG—Compare and ExchangeOpcode Instruction <strong>64</strong>-Bit Mode Compat/Leg DescriptionMode0F B0/r CMPXCHG r/m8,r8 Valid Valid Compare AL with r/m8. If equal, ZF is setand r8 is loaded into r/m8. Else, clear ZF andload r/m8 into AL.REX + 0F B0/r CMPXCHG r/m8*,r8* Valid N.E. Compare AL with r/m8. If equal, ZF is setand r8 is loaded into r/m8. Else, clear ZF andload r/m8 into AL.0F B1/r CMPXCHG r/m16,r16 Valid Valid Compare AX with r/m16. If equal, ZF is setand r16 is loaded into r/m16. Else, clear ZFand load r/m16 into AX0F B1/r CMPXCHG r/m32,r32 Valid Valid Compare EAX with r/m32. If equal, ZF is setand r32 is loaded into r/m32. Else, clear ZFand load r/m32 into EAXREX.W + 0F B1/r CMPXCHG r/m<strong>64</strong>,r<strong>64</strong> Valid N.E. Compare RAX with r/m<strong>64</strong>. If equal, ZF is setand r<strong>64</strong> is loaded into r/m<strong>64</strong>. Else, clear ZFand load r/m<strong>64</strong> into AL* In <strong>64</strong>-bit mode, r/m8 can not be encoded to access the following byte registers if an REX prefix is used: AH, BH, CH, DH. Alsorefer to Section 1.4.2.2.Flags AffectedThe ZF flag is set if the values in the destination operand and register AL, AX, or EAX are equal; otherwise it iscleared. The CF, PF, AF, SF, and OF flags are set according to the results of the comparison operation.IA-32e Mode OperationPromoted to <strong>64</strong>-bitsDefault Operation Size is 32-bits.Protected Mode Exceptions#GP(0)#SS(0)#PF(fault-code)#AC(0)If the destination is located in a nonwritable segment.If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.If the DS, ES, FS, or GS register contains a null segment selector.If a memory operand effective address is outside the SS segment limit.If a page fault occurs.If alignment checking is enabled and an unaligned memory reference is made while thecurrent privilege level is 3.Real-Address Mode Exceptions#GP#SSIf a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.If a memory operand effective address is outside the SS segment limit.Virtual-8086 Mode Exceptions#GP(0)#SS(0)#PF(fault-code)#AC(0)If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.If a memory operand effective address is outside the SS segment limit.If a page fault occurs.If alignment checking is enabled and an unaligned memory reference is made.Vol. 1 2-81

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!