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