Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ... Volume 3: General-Purpose and System Instructions - Stanford ...

scs.stanford.edu
from scs.stanford.edu More from this publisher
13.07.2015 Views

AMD64 Technology 24594 Rev. 3.10 February 2005DEC Decrement by 1Subtracts 1 from the specified register or memory location. The CF flag is notaffected.The one-byte forms of this instruction (opcodes 48 through 4F) are used as REXprefixes in 64-bit mode. See “REX Prefixes” on page 14.The forms of the DEC instruction that write to memory support the LOCK prefix. Fordetails about the LOCK prefix, see “Lock Prefix” on page 10.To perform a decrement operation that updates the CF flag, use a SUB instructionwith an immediate operand of 1.Mnemonic Opcode DescriptionDEC reg/mem8 FE /1DEC reg/mem16 FF /1DEC reg/mem32 FF /1DEC reg/mem64 FF /1Decrement the contents of an 8-bit register or memory locationby 1.Decrement the contents of a 16-bit register or memory locationby 1.Decrement the contents of a 32-bit register or memory locationby 1.Decrement the contents of a 64-bit register or memory locationby 1.DEC reg16DEC reg3248 +rw48 +rdDecrement the contents of a 16-bit register by 1.(See “REX Prefixes” on page 14.)Decrement the contents of a 32-bit register by 1.(See “REX Prefixes” on page 14.)Related InstructionsINC, SUB138 DEC

24594 Rev. 3.10 February 2005 AMD64 TechnologyrFLAGS AffectedID VIP VIF AC VM RF NT IOPL OF DF IF TF SF ZF AF PF CFExceptionsM M M M M21 20 19 18 17 16 14 13–12 11 10 9 8 7 6 4 2 0Note: Bits 31–22, 15, 5, 3, and 1 are reserved. A flag set to 1 or cleared to 0 is M (modified). Unaffected flags are blank. Undefinedflags are U.Exception RealVirtual8086 Protected Cause of ExceptionStack, #SS X X X A memory address exceeded the stack segment limit or was noncanonical.General protection,#GPX X XA memory address exceeded the data segment limit or was noncanonical.XThe destination operand was in a non-writable segment.X A null data segment was used to reference memory.Page fault, #PF X X A page fault resulted from the execution of the instruction.Alignment check, #AC X X An unaligned memory reference was performed while alignmentchecking was enabled.DEC 139

24594 Rev. 3.10 February 2005 AMD64 TechnologyrFLAGS AffectedID VIP VIF AC VM RF NT IOPL OF DF IF TF SF ZF AF PF CFExceptionsM M M M M21 20 19 18 17 16 14 13–12 11 10 9 8 7 6 4 2 0Note: Bits 31–22, 15, 5, 3, <strong>and</strong> 1 are reserved. A flag set to 1 or cleared to 0 is M (modified). Unaffected flags are blank. Undefinedflags are U.Exception RealVirtual8086 Protected Cause of ExceptionStack, #SS X X X A memory address exceeded the stack segment limit or was noncanonical.<strong>General</strong> protection,#GPX X XA memory address exceeded the data segment limit or was noncanonical.XThe destination oper<strong>and</strong> was in a non-writable segment.X A null data segment was used to reference memory.Page fault, #PF X X A page fault resulted from the execution of the instruction.Alignment check, #AC X X An unaligned memory reference was performed while alignmentchecking was enabled.DEC 139

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

Saved successfully!

Ooh no, something went wrong!