home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,804 of 4,675   
   wolfgang kern to Kerr Mudd-John   
   Re: BASE64 again   
   13 Jul 17 10:57:21   
   
   From: nowhere@never.at   
      
    Kerr Mudd-John wrote:   
   ...   
   > ll64 bytes 246 (sadly need to set cl=0 cost 3)   
      
   push bp, pop cx ?   
      
   > ZRPRhp0XPR5p1PRRjL4hPa5LU1GJ1GLRX+G=1GeRSVG8+r6238wbt083t+RU=rY=   
   > 66Z2202Zffffff0222F6====MJ=20=17===eeee+++slOBI9UnEdoAasbaANE9E7   
   > jelperHQE9sAjesuH8lpssMIG7asA9babaaGv7h8A7IdH9RKi8A9EGI8sCoAlpin   
   > MIT9lpadITt7YoH9f7=tAm6CAHNIcNIZWxsbyB3b3JsZCEk=   
      
   > 1622:0100 AC             lodsb   
   > 1622:0101 3C 2B          cmp          al,2B   
   > 1622:0103 72 25          jb           012A   
   >   
   > (getnum)   
   > 1622:0105 2C 41          sub          al,41   
   > 1622:0107 73 0A          jnb          0113   
   > 1622:0109 04 45          add          al,45   
   > 1622:010B 3C 33          cmp          al,33   
   > 1622:010D 77 0A          ja           0119   
   > 1622:010F B0 86          mov          al,86   
   > 1622:0111 1C 00          sbb          al,00   
   > 1622:0113 3C 1A          cmp          al,1A   
   > 1622:0115 72 02          jb           0119   
   > 1622:0117 2C 06          sub          al,06   
   >   
   > (put3)   
   > 1622:0119 41             inc          cx   
   > 1622:011A 41             inc          cx   
   > 1622:011B 83 E1 06       and          cx,0006   
   > 1622:011E D2 EC          shr          ah,cl   
   > 1622:0120 C0 E0 02       shl          al,02   
   > 1622:0123 D3 E0          shl          ax,cl   
   > 1622:0125 86 E0          xchg         ah,al   
   > 1622:0127 E3 01          jcxzw        012A   
   > 1622:0129 AA             stosb   
      
   > Improved store part:   
   >    ;put3:                 ; need cl=*0* on 1st run   
   > 41          inc cx   
   > 41          inc cx        ; req cl=8 for last shift, then 0   
   > 98          cbw           ; clr ah   
   > D3E0        shl ax,cl     ; 2,4,6,8   
   > 0865FF      or [di-1],ah  ; or on top bits to prev char   
   > 80E106      and cl,0x06   ; 8->0. 2,4,6 ok   
   > 7401        jz nosave     ; jz not jcxz   
   > AA          stosb         ; store these bits   
   > nosave:   
   > (gnc)   
      
   good, I see   
      
   0fb  AC      lodsb   
   0fc  3C 3D   cmp al,3D   
   0FE  75 D5   jnz  0d5   
      
   you saved three (six 2:1) bytes in the decoder part.   
      
   9 instead of 11 modify needs: d3,98,08e0,80,ff,06e1,aa01,ac,d5   
   this are only 16 total instead of the 18 previous, and it make me   
   think of adopting your much shorter decoder and direct SMC it. :)   
      
   Using the command-line instead of 042 would save me on push_bx/ret and   
   one 3 byte modifier, but needs some more bytes to modify 0c0..0ff.   
   Not all fit my current DX=0x7862 paired modify, but I'll check.   
   __   
   wolfgang   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca