Difference between revisions of "Assembler:Commands:INC"
Jump to navigation
Jump to search
(Created page with ''''command''' inc ''operand'' Increases the operand by one. Adds 1 to the operand, while preserving the state of the '''CF''' flag. The operand can be a register or a memory l…') |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Assembler]] | ||
'''command''' inc ''operand'' | '''command''' inc ''operand'' | ||
Increases the operand by one. | Increases 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 | ||
+ | |||
+ | |||
+ | <div style="padding:2px;border:1px dashed #2f6fab;background-color:#f4f4f4;"> | ||
Adds 1 to the operand, while preserving the state of the '''CF''' flag. | Adds 1 to the operand, while preserving the state of the '''CF''' flag. | ||
The operand can be a register or a memory location. | The operand can be a register or a memory location. | ||
This instruction allows a loop counter to be updated without disturbing the '''CF''' flag. | This instruction allows a loop counter to be updated without disturbing the '''CF''' flag. | ||
− | (Use a ADD instruction with an immediate operand of 1 to perform an increment operation | + | (Use a [[Assembler:Commands:ADD|ADD]] instruction with an immediate operand of 1 to perform an increment operation |
that does updates the '''CF''' flag.) | that does updates the '''CF''' flag.) | ||
− | + | [http://c9x.me/x86/html/file_module_x86_id_140.html c9x.me/x86/html/file_module_x86_id_140.html] | |
− | + | </div> | |
− | |||
− | |||
Line 40: | Line 46: | ||
inc [SomeSymbol] | inc [SomeSymbol] | ||
+ | {{AssemblerCommandSeeAlso}} | ||
− | + | {{Template:AssemblerCommandExternalLinks}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 15:46, 3 January 2018
command inc operand
Increases 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
Adds 1 to 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. (Use a ADD instruction with an immediate operand of 1 to perform an increment operation that does updates the CF flag.)
Command Parameters[edit]
Parameter | Description |
---|---|
operand | The destination operand |
Examples[edit]
inc al
inc ax
inc eax
inc rax
inc [00123ABC]
inc [rax]
inc [SomeSymbol]