Simplify nibble handling in LZSA2 8088 depacker

This commit is contained in:
emmanuel-marty 2019-05-11 11:42:00 +02:00
parent 8b7b4a2b4f
commit d70830b525

View File

@ -35,7 +35,7 @@ lzsa2_decompress:
cld ; make string operations (lods, movs, stos..) move forward
xor cx,cx
xor bx,bx
mov bx,0100H
xor bp,bp
.decode_token:
@ -157,14 +157,12 @@ lzsa2_decompress:
ret ; done
.get_nibble:
dec bh ; nibble ready?
neg bh ; nibble ready?
jns .has_nibble
mov cx,ax
xchg bx,ax
lodsb ; load two nibbles
mov bl,al
mov bh,1
mov ax,cx
xchg ax,bx
.has_nibble:
mov cl,4 ; swap 4 high and low bits of nibble