Difference between revisions of "Assembler:Commands:DEC"
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
use a [[Assembler:Commands:SUB|SUB]] instruction with an immediate operand of 1.) | use a [[Assembler:Commands:SUB|SUB]] instruction with an immediate operand of 1.) | ||
− | |||
</div> | </div> | ||
Line 49: | Line 48: | ||
{{AssemblerCommandSeeAlso}} | {{AssemblerCommandSeeAlso}} | ||
− | + | {{Template:AssemblerCommandExternalLinks}} | |
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 15:16, 3 January 2018
command dec operand
Decreases the operand by one.
The CF flag is not affected. The OF, SF, ZF, AF,
and PF flags are set according to the result.
operand = operand - 1
Subtracts 1 from the operand, while preserving the state of the CF flag. The operand can be a register or a memory location. This instruction allows a loop counter to be updated without disturbing the CF flag. (To perform a decrement operation that updates the CF flag, use a SUB instruction with an immediate operand of 1.)
Command Parameters
Parameter | Description |
---|---|
operand | The destination operand |
Examples
dec al
dec ax
dec eax
dec rax
dec [00123ABC]
dec [rax]
dec [SomeSymbol]