mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-25 08:06:49 +03:00
100 lines
2.3 KiB
PHP
100 lines
2.3 KiB
PHP
|
Color db 0
|
|||
|
Counter db 0
|
|||
|
LastColor db 0
|
|||
|
SizeFile dd 0
|
|||
|
;LitlCounter db 0
|
|||
|
;LitlColor db 0
|
|||
|
save_image:
|
|||
|
;mov esi,addres_of_file_which_need_compress
|
|||
|
;mov edi,addres_where_need_to_save_compressed_file
|
|||
|
;mov ecx,size_of_file_which_need_compress
|
|||
|
mov dl,byte [esi]
|
|||
|
and dl,0xff
|
|||
|
mov [LastColor],dl
|
|||
|
mov [Counter],byte 1
|
|||
|
mov [SizeFile],0
|
|||
|
xor edx,edx
|
|||
|
inc esi
|
|||
|
NextColor:;<EFBFBD><EFBFBD>⠥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<EFBFBD> <EFBFBD><EFBFBD> ⠡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov dl,byte [esi]
|
|||
|
and dl,0xf
|
|||
|
mov [Color],dl
|
|||
|
cmp dl,[LastColor]
|
|||
|
jne Different
|
|||
|
;㢥<EFBFBD><EFBFBD>稢<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD> 1 <EFBFBD> ᬮ<EFBFBD>ਬ <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD>
|
|||
|
inc [Counter]
|
|||
|
cmp [Counter],16
|
|||
|
jl total
|
|||
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 ࠢ<EFBFBD><EFBFBD> 16,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㦭<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫쭮<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dec [Counter]
|
|||
|
jmp Different
|
|||
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<EFBFBD>騩 梥<EFBFBD> <EFBFBD>⠫ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<EFBFBD><EFBFBD><EFBFBD>⮬<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
;<EFBFBD><EFBFBD><EFBFBD>㫨<EFBFBD> (ᤥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠢ<EFBFBD><EFBFBD><EFBFBD> 1) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> 梥<EFBFBD><EFBFBD>(counter)
|
|||
|
xor eax,eax
|
|||
|
and [Counter],0
|
|||
|
mov al,[Color]
|
|||
|
mov [LastColor],al
|
|||
|
xor eax,eax
|
|||
|
jmp total
|
|||
|
Different:;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD> 梥<EFBFBD> <EFBFBD><EFBFBD> ᮢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㦭<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;
|
|||
|
;<EFBFBD><EFBFBD><EFBFBD>࠭塞 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<EFBFBD>
|
|||
|
dec [Counter]
|
|||
|
call SaveinByte
|
|||
|
;add [SizeFile],1
|
|||
|
inc edi
|
|||
|
;<EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> ⥪<EFBFBD>饣<EFBFBD> 梥<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>ண<EFBFBD>
|
|||
|
mov dl,[Color]
|
|||
|
mov [LastColor],dl
|
|||
|
mov [Counter],1
|
|||
|
total:
|
|||
|
xor edx,edx
|
|||
|
mov dl,[Color]
|
|||
|
mov [LastColor],dl
|
|||
|
inc esi
|
|||
|
dec ecx
|
|||
|
cmp ecx,0
|
|||
|
jne NextColor
|
|||
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮩,<EFBFBD><EFBFBD><EFBFBD>⮬<EFBFBD> <EFBFBD>⮡<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>⮢
|
|||
|
;<EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪<EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD>
|
|||
|
call SaveinByte
|
|||
|
ret
|
|||
|
SaveinByte:xor eax,eax
|
|||
|
xor ebx,ebx
|
|||
|
mov al,[Counter]
|
|||
|
shl al,4
|
|||
|
mov bl,[LastColor]
|
|||
|
or al,bl
|
|||
|
mov [edi],al
|
|||
|
inc [SizeFile]
|
|||
|
ret
|
|||
|
;-----------------------------------------------------------------------
|
|||
|
LitlCounter db 0
|
|||
|
LitlColor db 0
|
|||
|
unpakin:
|
|||
|
xor edx,edx
|
|||
|
NextLitlColor:xor edx,edx
|
|||
|
mov dl,byte[esi]
|
|||
|
xor eax,eax
|
|||
|
xor ebx,ebx
|
|||
|
mov al,dl
|
|||
|
mov bl,al
|
|||
|
shr al,4
|
|||
|
and al,0xf
|
|||
|
mov [LitlCounter],al
|
|||
|
and bl,0xf
|
|||
|
mov [LitlColor],bl
|
|||
|
xor eax,eax
|
|||
|
xor ebx,ebx
|
|||
|
;-------------------------------
|
|||
|
mov al,[LitlColor]
|
|||
|
beg:mov [edi],al
|
|||
|
add edi,1
|
|||
|
dec [LitlCounter]
|
|||
|
cmp [LitlCounter],-1
|
|||
|
jne beg
|
|||
|
inc esi
|
|||
|
dec ecx
|
|||
|
jnz NextLitlColor
|
|||
|
ret
|