;
; Up to 19% faster alternative for large LDIRs (break-even at 21 loops)
; hl = source (“home location”)
; de = destination
; bc = byte count
;
FastLDIR:
xor a
sub c
and 16 - 1
add a,a
di
ld (FastLDIR_jumpOffset),a
ei
jr nz,$ ; self modifying code
FastLDIR_jumpOffset: equ $ - 1
FastLDIR_Loop:
ldi ; 16x LDI
ldi
ldi
ldi
ldi
ldi
ldi
ldi
ldi
ldi
ldi
ldi
ldi
ldi
ldi
ldi
jp pe,FastLDIR_Loop
ret
I think it is commonly usedOh, I must be 30 years out of date :oops: sorry to show my age! :smt087