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,815 of 4,675   
   Kerr Mudd-John to wolfgang kern   
   Re: BASE64 again   
   15 Jul 17 13:48:10   
   
   From: notsaying@nospicedham.invalid.org   
      
   "wolfgang kern"  wrote in news:okb4sk$nj7$1   
   @gioia.aioe.org:   
      
   > I answered Kerr Mudd-John:   
   > ...   
   >>>>  could cmp al,0 or cmp cl,8 here & put the "and" at top but this   
   >>>>  costs 4 in 2:1 v 3 to clear cx.   
   >   
   >> if it works: cmp al,00 instead of and cl,06 sound good to me,   
   >> push bp/pop cx are only 2 bytes for me.   
   >   
   > unfortunately it wont work with cmp al,0 (it could be an "A")   
   >   
   Drat!   
      
   >>> think of adopting your much shorter decoder and direct SMC it. :)   
   >> You can reduce the fixup count further for 1 byte extra:   
   >   
   > btw: Congrats to your improvement!   
   >   
   > let me check on what can be paired and what need a single yet:   
   >   
   > putnum:                   ; need cl=*0* on 1st run   
   > 41          inc cx   
   > 41          inc cx        ; need cl=8 for last; 'and' later   
   > 4F          dec di   
   > 98          cbw           ;clr ah reqd   
   > D3 E0       shl ax,cl     ;2,4,6,8   
   > 08 25       or  [di],ah   
   > 47          inc di   
   > 80 E1 06    and cl,0x06   ; 8->0. 2,4,6 ok   
   aren't you missing:   
      
   75 01          jnz nosave   
   AA             stosb   
   nosave:   
      
   > AC          lodsb   
   > EB d5       jmp top+2     ; may change a bit   
   > ;3C 3D       cmp al,3D    ;done ahead with jnz+1 RET (C301)   
   > ;75 D5       jnz  0d5   
   >   
   > 98,E0D3,08,80,06e1,ac,d5EB seem to fit well, so even only three pairs   
   > we have only seven modify points in this part yet. That's good!   
   >   
   > I could pair E180 with a two bytes addon SUB and perhaps also D398   
   > and AC06 anyway, so with 2 bytes more in the modifier chain it may   
   > become: d398,08e0,e180,ac06,d5eb (five instead of seven = -6 byte).   
   >   
   > I think it's now time to go for it :)   
      
   An alternative (I don't know if it's better or worse for your fixups)   
   2C 06          sub          al,06   
   98             cbw   
   41             inc          cx   
   41             inc          cx   
   D3 E0          shl          ax,cl   
   08 25          or           [di],ah   
   47             inc          di   
   83 E1 06       and          cx,0006   
   88 05          mov          [di],al   
   75 01          jnz          0137   
   4F             dec          di   
   AC             lodsb   
   EB d5       jmp top+2   
      
   9806 e0d3 08 e183 8806 05 01 AC D5EB   
   9 maybe not.   
      
   --- 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