13.07.2015 Views

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

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

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

AMD64 Technology 24594 Rev. 3.10 February 2005SUBSubtractSubtracts an immediate value or the value in a register or memory location (secondoper<strong>and</strong>) from a register or a memory location (first oper<strong>and</strong>) <strong>and</strong> stores the result inthe first oper<strong>and</strong> location. An immediate value is sign-extended to the length of thefirst oper<strong>and</strong>.This instruction evaluates the result for both signed <strong>and</strong> unsigned data types <strong>and</strong> setsthe OF <strong>and</strong> CF flags to indicate a borrow in a signed or unsigned result, respectively. Itsets the SF flag to indicate the sign of a signed result.The forms of the SUB instruction that write to memory support the LOCK prefix. Fordetails about the LOCK prefix, see “Lock Prefix” on page 10.Mnemonic Opcode DescriptionSUB AL, imm8SUB AX, imm16SUB EAX, imm32SUB RAX, imm32SUB reg/mem8, imm8SUB reg/mem16, imm16SUB reg/mem32, imm32SUB reg/mem64, imm32SUB reg/mem16, imm8SUB reg/mem32, imm8SUB reg/mem64, imm82C ib2D iw2D id2D id80 /5 ib81 /5 iw81 /5 id81 /5 id83 /5 ib83 /5 ib83 /5 ibSubtract an immediate 8-bit value from the AL register <strong>and</strong> storethe result in AL.Subtract an immediate 16-bit value from the AX register <strong>and</strong> storethe result in AX.Subtract an immediate 32-bit value from the EAX register <strong>and</strong>store the result in EAX.Subtract a sign-extended immediate 32-bit value from the RAXregister <strong>and</strong> store the result in RAX.Subtract an immediate 8-bit value from an 8-bit destinationregister or memory location.Subtract an immediate 16-bit value from a 16-bit destinationregister or memory location.Subtract an immediate 32-bit value from a 32-bit destinationregister or memory location.Subtract a sign-extended immediate 32-bit value from a 64-bitdestination register or memory location.Subtract a sign-extended immediate 8-bit value from a 16-bitregister or memory location.Subtract a sign-extended immediate 8-bit value from a 32-bitregister or memory location.Subtract a sign-extended immediate 8-bit value from a 64-bitregister or memory location.282 SUB

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

Saved successfully!

Ooh no, something went wrong!