foo: ld hl, data call bar ; Run routine once call bar ; .. twice call bar ; .. three times bar: ld a, (hl) ; .. fourth and final time inc l and $0F out (c), a ret