INC (short for "INCrease") is the mnemonic for a machine language instruction which increases the numerical value of the contents of the address specified by one, and "wraps over" when the numerical limits of a byte are exceeded.
- If the byte in question is taken as an unsigned integer, INC "counts" from 0 thru 255/$0 thru $FF. If a byte already containing the value 255/$FF is INCremented, it "wraps over" to the value 0.
- If the byte is taken as a signed integer, INC will "count" from −128 thru +127, or −$80 thru +$7F. If a byte already holding the value 127/$7F is INCremented, it "wraps over" to the value −128/−$80.
Addressing modes[edit | edit source]
INC supports the four different addressing modes shown in the table at right. In the assembler formats listed, nn represents a single-byte (8-bit) figure, and nnnn is a two-byte (16-bit) address.
CPU flags[edit | edit source]
INC affects 2 of the CPU's status flags: