wok diff memtest64/stuff/unzx0.S @ rev 25811

Up rsync (3.4.1)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jan 17 16:05:26 2025 +0000 (5 months ago)
parents be3de88419e0
children
line diff
     1.1 --- a/memtest64/stuff/unzx0.S	Wed Aug 02 09:46:03 2023 +0000
     1.2 +++ b/memtest64/stuff/unzx0.S	Fri Jan 17 16:05:26 2025 +0000
     1.3 @@ -43,14 +43,15 @@
     1.4          cld                     // make string operations go forward
     1.5          movb    $0x80, %al      // initialize empty bit queue
     1.6                                  // plus bit to roll into carry
     1.7 -	stc
     1.8 +        stc
     1.9          sbb     BX, BX          // initialize rep-offset to 1
    1.10  
    1.11  .literals:
    1.12  #if !defined(FLAT16) && !defined(FLAT32)
    1.13 -        cmpw    $32768, %si     // assume 32767 literals max
    1.14 +        movw    $32768, %dx
    1.15 +        cmpw    %dx, %si        // assume 32767 literals max
    1.16          jb      .si_ok
    1.17 -        subw    $32768, %si
    1.18 +        subw    %dx, %si
    1.19          movw    %ds, %dx
    1.20          addb    $8, %dh
    1.21          movw    %dx, %ds
    1.22 @@ -79,7 +80,13 @@
    1.23  #endif
    1.24          push    SI              // save si (current pointer to compressed data)
    1.25          lea     (BX,DI), SI     // point to destination in es:di + offset in bx
    1.26 -	rep movsb %es:(SI), %es:(DI)  // copy matched bytes
    1.27 +#ifdef ONLY8086
    1.28 +.copy_loop:
    1.29 +        movsb %es:(SI), %es:(DI) // copy matched bytes using NMOS 8088/8086 workaround.
    1.30 +        loop    .copy_loop
    1.31 +#else
    1.32 +        rep movsb %es:(SI), %es:(DI)  // copy matched bytes
    1.33 +#endif
    1.34          pop     SI              // restore si
    1.35  
    1.36          addb    %al, %al        // read 'literal or match' bit