INC
By Vesper Vei
1 minute read
Table of Contents
INC (inc)
Basic Function
The INC instruction performs a +1 operation on the operand:
dest = dest + 1
Instruction Execution Process
- Add 1 to the destination operand
- Update all flags except CF
Instruction Format
inc r/m8inc r/m16inc r/m32inc r/m64Behavioral Characteristics
- Does not modify CF (unlike ADD x,1)
- Modifies flags such as ZF, SF, PF, OF, and AF
- Very fast operation, but when used in arithmetic, pay attention to OF
Common Uses
- Incrementing loop counters
- Auto-incrementing stack variables and pointers
- Gradually accumulating when constructing numbers
- Constructing data byte-by-byte with offsets in certain encoders/decryptors