cpi
Compare and increment
Compares A with the byte at (HL), then increments HL and decrements BC, setting P/V while BC is not zero.
2 bytes · 16 cycles
SZHP/VNC ●●●●1–
- ● set from the result
- 1 always 1
- – not changed
Forms
cpiCompares the value of the memory location pointed to by HL with A. Then HL is incremented and BC is decremented. p/v is reset if BC becomes zero and set otherwise.
.org 0x8000
ld a, 3
ld hl, source
ld bc, 4
cpi
halt
source: .byte 1, 2, 3, 4