inc
Increment
Adds one to a register, register pair or the byte at (HL), leaving C unchanged.
Used in
- Registers, pairs and the shadow setZ80 assembly
- The 64 KB address spaceZ80 assembly
- org, db, dw and dsZ80 assembly
- Loops and djnzZ80 assembly
- Arrays, strings and ixZ80 assembly
- The stack, push and popZ80 assembly
- call, ret and passing valuesZ80 assembly
- Ports: in and outZ80 assembly
- The screen, keyboard and mouse through portsZ80 assembly
- Fill an array with the numbers from 1 to 10Z80 assembly
SZHP/VNC ●●●●0–
- ● set from the result
- 0 always 0
- – not changed
The rows that do otherwise show their own flags.
Forms
-
Adds one to
r. inc1 byte · 11 cyclesAdds one to (HL).
-
Adds one to the memory location pointed to by IX plus
dd. -
Adds one to
rr. -
Adds one to IX.
Undocumented 1 row
Left out of Zilog's manual, but the Z80 runs them, and so does this emulator.
-
Adds one to
ixh/l.
Operands
r- An 8-bit register:
a,b,c,d,e,horl. (hl)- The byte in memory at the address stored in
hl. More (ix+dd)- The byte in memory at
ix + dd, whereddis a signed displacement from-128to127, for example(ix+5)or(ix-3).(iy+dd)works the same way. More rr- A register pair:
bc,de,hlorsp. ix- The
ixindex register. You can also useiy, with the same instruction size and timing. More ixh/l- The high or low byte of
ix:ixhorixl. Foriy, useiyhoriyl. More
.org 0x8000
ld bc, 0x0234
inc bc
halt