And the ASM decoder may be like this:
Code:
procedure decompress;
asm
pushad
cld
lea esi,src
lea edi,dst
mov ebp,siz
add ebp,edi
@@1:
movzx ecx,byte ptr[esi]
add esi,1
test ecx,128
jz @@3
@@2:
sub ecx,128 // or sub ecx,124, ICL does add ecx,-125
movzx eax,word ptr[esi]
add esi,2
not eax
add eax,edi
xchg eax,esi
movsb
movsb
movsb
movsb
rep movsb
xchg eax,esi // or mov esi,eax, if xchg is slower than mov
jmp @@4
@@3:
movsb // or add ecx,1
rep movsb
@@4:
cmp edi,ebp
jb @@1
popad
end;
Hm, why with
MOVSD
REP MOVSB
decompression is incorrect?