RosettaCodeData/Task/Repeat/Z80-Assembly/repeat-3.z80

11 lines
191 B
Z80 Assembly

LD HL,myFunc
LD (repeatproc+1),HL
LD B,5 ;repeat count
CALL repeatProc
;somewhere far away from here:
repeatProc:
call &0000 ;gets overwritten with the address of MyFunc
djnz repeatProc
ret