Volume 3: General-Purpose and System Instructions - Stanford ...
Volume 3: General-Purpose and System Instructions - Stanford ... Volume 3: General-Purpose and System Instructions - Stanford ...
AMD64 Technology 24594 Rev. 3.10 February 2005A.2.3 rFLAGSCondition Codes forTwo-Byte OpcodesTable A-5 shows the rFLAGS condition codes specified by thelow nibble in the second opcode byte of the CMOVcc, Jcc, andSETcc instructions.Table A-5.rFLAGS Condition Codes for CMOVcc, Jcc, and SETccLow Nibble ofSecond OpcodeByte (hex)rFLAGS Valuecc MnemonicArithmeticTypeCondition(s)0 OF= 1 OOverflowSigned1 OF= 0 NO No Overflow2 CF= 1 B, C, NAEBelow, Carry, Not Above or Equal3 CF = 0 NB, NC, AE Not Below, No Carry, Above or Equal4 ZF = 1 Z, E Zero, EqualUnsigned5 ZF = 0 NZ, NE Not Zero, Not Equal6 CF = 1 or ZF = 1 BE, NA Below or Equal, Not Above7 CF = 0 and ZF = 0 NBE, A Not Below or Equal, Above8 SF =1 SSignSigned9 SF = 0 NS Not SignA PF= 1 P, PEParity, Parity Evenn/aB PF = 0 NP, PO Not Parity, Parity OddC (SF xor OF) =1 L, NGESignedLess than, Not Greater than or Equal toD (SF xor OF) = 0 NL, GE Not Less than, Greater than or Equal toEF(SF xor OF) = 1or ZF = 1(SF xor OF) = 0and ZF = 0LE, NGNLE, GLess than or Equal to, Not Greater thanNot Less than or Equal to, Greater than386 Appendix A: Opcode and Operand Encodings
24594 Rev. 3.10 February 2005 AMD64 TechnologyA.2.4 ModRMExtensions to One-Byte and Two-ByteOpcodesThe ModRM byte, which immediately follows the last opcodebyte, is used in certain instruction encodings to provideadditional opcode bits with which to define the function of theinstruction. ModRM bytes have three fields—mod, reg, and r/m,as shown in Figure A-1.Bits:7 6 5 4 3 2 1 0mod reg r/m ModRM513-325.epsFigure A-1.ModRM-Byte FieldsIn most cases, the reg field (bits 5–3) provides the additionalbits with which to extend the encodings of the first one or twoopcode bytes. In the case of the x87 floating-point instructions,the entire ModRM byte is used to extend the opcode encodings.Table A-6 on page 388 shows how the ModRM reg field is used toextend the range of one-byte and two-byte opcodes. The opcoderanges are organized into groups of opcode extensions. Thegroup number is shown in the left-most column of Table A-6.These groups are referenced in the opcodes shown in Table A-1on page 378 through Table A-4 on page 383. An entry of “n.a.”in the Prefix column means that prefixes are not applicable tothe opcodes in that row. Prefixes only apply to certain 128-bitmedia, 64-bit media, and a few other instructions introducedwith the SSE or SSE2 technologies.The /0 through /7 notation for the ModRM reg field (bits 5–3)means that the three-bit field contains a value from zero (binary000) to 7 (binary 111).Appendix A: Opcode and Operand Encodings 387
- Page 366 and 367: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 368 and 369: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 370 and 371: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 372 and 373: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 374 and 375: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 376 and 377: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 378 and 379: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 380 and 381: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 382 and 383: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 384 and 385: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 386 and 387: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 388 and 389: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 390 and 391: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 392 and 393: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 394 and 395: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 396 and 397: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 398 and 399: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 400 and 401: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 402 and 403: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 404 and 405: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 406 and 407: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 408 and 409: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 410 and 411: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 412 and 413: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 414 and 415: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 418 and 419: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 420 and 421: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 422 and 423: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 424 and 425: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 426 and 427: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 428 and 429: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 430 and 431: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 432 and 433: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 434 and 435: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 436 and 437: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 438 and 439: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 440 and 441: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 442 and 443: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 444 and 445: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 446 and 447: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 448 and 449: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 450 and 451: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 452 and 453: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 454 and 455: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 456 and 457: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 458 and 459: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 460 and 461: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 462 and 463: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 464 and 465: AMD64 Technology 24594 Rev. 3.10 Fe
AMD64 Technology 24594 Rev. 3.10 February 2005A.2.3 rFLAGSCondition Codes forTwo-Byte OpcodesTable A-5 shows the rFLAGS condition codes specified by thelow nibble in the second opcode byte of the CMOVcc, Jcc, <strong>and</strong>SETcc instructions.Table A-5.rFLAGS Condition Codes for CMOVcc, Jcc, <strong>and</strong> SETccLow Nibble ofSecond OpcodeByte (hex)rFLAGS Valuecc MnemonicArithmeticTypeCondition(s)0 OF= 1 OOverflowSigned1 OF= 0 NO No Overflow2 CF= 1 B, C, NAEBelow, Carry, Not Above or Equal3 CF = 0 NB, NC, AE Not Below, No Carry, Above or Equal4 ZF = 1 Z, E Zero, EqualUnsigned5 ZF = 0 NZ, NE Not Zero, Not Equal6 CF = 1 or ZF = 1 BE, NA Below or Equal, Not Above7 CF = 0 <strong>and</strong> ZF = 0 NBE, A Not Below or Equal, Above8 SF =1 SSignSigned9 SF = 0 NS Not SignA PF= 1 P, PEParity, Parity Evenn/aB PF = 0 NP, PO Not Parity, Parity OddC (SF xor OF) =1 L, NGESignedLess than, Not Greater than or Equal toD (SF xor OF) = 0 NL, GE Not Less than, Greater than or Equal toEF(SF xor OF) = 1or ZF = 1(SF xor OF) = 0<strong>and</strong> ZF = 0LE, NGNLE, GLess than or Equal to, Not Greater thanNot Less than or Equal to, Greater than386 Appendix A: Opcode <strong>and</strong> Oper<strong>and</strong> Encodings