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,790 of 4,675   
   wolfgang kern to Kerr Mudd-John   
   Re: BASE64 again   
   05 Jul 17 12:19:59   
   
   From: nowhere@never.at   
      
   Kerr Mudd-John wrote (within thread):   
   > ...   
   > 146 sub ax,6d3b    ;92c5 xor 3636 = A4F3   
   > 149 xor [bx+24],ax ;create REP MOVS   
      
   > I presume al=c5 here   
      
   > ; 14c sub al,21      ;c5-21=a4   
   > ; 14d inc ax  dup2   ;a6 xor 65 = c3   
   > shorter:   
   >     xor al,63 ; c5->a6   
   > 14f xor [bx+7e],al ;create a RET in a field of 65 nops   
      
   Yeah thanks, this saves two bytes. But because of the unmodified branch   
   to 0161 there isn't much we can do with it before REP MOVS took place,   
   except you can push dx there and pop cx at 044 (so save one byte).   
      
   > setting cx for my b64 decoder:   
   > shorter to set dl earlier (where you set dh) (;it's not used elsewhere)   
   > to x6 where x is one of {3,4,5,6,7}   
   > then push dx, pop cx before the entering; the "and cx,6" will scrap   
   > the other values.   
      
   Yes, this saves you on the MOV CL modifier, but I still count 18 modify   
   needs with your (shorter by only 3(4) bytes yet) SHR ah,cl version.   
   And for now I see only 17 available. My version need 16 incl. MOV CL.   
   __   
   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