Z80 For Loop

Published 01-01-0001 00:00:00

WHILE – FOR:

We usually use B as counter.

LD C, 5
LD A, 0
LD B, 100

.NEXT2:
push BC
LD B, 10
  
.NEXT:
ADD A, C
DJNZ .NEXT
pop BC
      
DJNZ .NEXT2