; ********************************************************* ; * ; * DELAY routine ; * ; * [EAX = iterations] ; * [EBX = delay offset (in samples)] ; * ECX = buffer size ; * ESI = source/target buffer ; * ; ********************************************************* section .text bits 32 global _KZG_delay@0 _KZG_delay@0: %ifdef DEBUG mov ebp,_KZG_delay_taps %endif mov ebx,[ebp+4] mov eax,[ebp+0] xchg ecx,eax _KZG_delay_iteration: pushad ;mov ecx,eax ;sub ecx,ebx ; ecx = size-offset (start) lea edi, [esi + eax*4] ; edi = edi + eax*4 (delay end) sub eax, ebx lea esi, [esi + eax*4] ; esi = esi + ecx*4 (delay start) dec eax dec eax xchg ecx, eax _KZG_delay_onesample: sub edi,byte 4 fld dword [esi] fmul dword [ebp+8] fadd dword [edi] fstp dword [edi] sub esi,byte 4 loop _KZG_delay_onesample popad loop _KZG_delay_iteration ret %ifdef DEBUG section .data bits 32 global _KZG_delay_taps _KZG_delay_taps dd 0 global _KZG_delay_offset _KZG_delay_offset dd 0 global _KZG_delay_amp _KZG_delay_amp dd 0 %endif