From d70830b525684718cd2b8861b95bf9d6bfa3e21f Mon Sep 17 00:00:00 2001 From: emmanuel-marty Date: Sat, 11 May 2019 11:42:00 +0200 Subject: [PATCH] Simplify nibble handling in LZSA2 8088 depacker --- asm/8088/decompress_small_v2.S | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/asm/8088/decompress_small_v2.S b/asm/8088/decompress_small_v2.S index 61e99f7..1c2e65d 100755 --- a/asm/8088/decompress_small_v2.S +++ b/asm/8088/decompress_small_v2.S @@ -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