Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- skompr dd 0
- .code
- _kompresja_tekstu PROC
- push ebp
- mov ebp, esp
- mov edx, 1
- mov eax, [esp+16]
- mov ebx, OFFSET skompr
- mov [ebx], eax
- start:
- mov eax, esp
- add eax, 12
- add eax, ecx
- mov eax, [eax]; eax=ebp+12+ecx
- mov bl, byte PTR [eax]
- cmp bl, 0
- je koniec
- mov bh, byte PTR [eax+1]
- cmp bl,bh
- je rowne
- inc ecx
- mov eax, OFFSET skompr
- dec edx
- je raz
- inc edx
- mov [eax], bl
- add edx, 128
- mov [eax+1], edx
- mov ebx,[eax]
- add ebx, 2
- mov [eax], ebx
- mov edx, 1
- //inc eax
- jmp start
- raz:
- mov [eax], bl
- push ebx
- mov ebx,[eax]
- inc ebx
- mov [eax], ebx
- pop ebx
- jmp start
- rowne:
- inc edx;ilosc powtorzen
- cmp edx, 127
- je powtorz
- jmp start
- powtorz:
- mov [eax], bl
- add edx, 128
- mov [eax+1], edx
- mov ebx,[eax]
- add ebx, 2
- mov [eax], ebx
- mov edx, 1
- jmp start
- koniec:
- mov eax, ebx
- pop ebp
- RET
- push ebp
- mov ebp, esp
- jc jeden
- mov eax, OFFSET TMP
- mov eax, [eax]
- sal eax, 1
- jmp dalej
- jeden:
- mov eax, OFFSET TMP
- mov eax, [eax]
- sal eax, 1
- inc eax
- jmp dalej
- sal eax, 3
- sar eax, 3
- cmp eax, 00011011b
- je rowne
- jmp koniec
- rowne:
- mov eax, OFFSET CIAG
- mov ebx, [eax]
- inc ebx
- mov [eax], ebx
- koniec:
- pop ebp
- RET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement