try this: delay: ld bc,$0000 dloop: dec bc ld a,d or e jr nz,loop ret that takes as long as possible because the first time you dec bc it wraps over to $FFFF. that means it loops approx 64,000 times.