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 4,635 of 4,675   
   Kerr-Mudd, John to John"   
   Re: Rot13 for DOS   
   18 Nov 23 22:19:55   
   
   XPost: comp.os.msdos.programmer, alt.lang.asm   
   From: admin@nospicedham.127.0.0.1   
      
   On Sat, 18 Nov 2023 11:10:20 +0000   
   "Kerr-Mudd, John"  wrote:   
      
   > On Fri, 27 Jan 2023 13:30:13 +0000   
   > "Kerr-Mudd, John"  wrote:   
   >   
   > > On Fri, 27 Jan 2023 09:57:22 +0000   
   > > "Kerr-Mudd, John"  wrote:   
   > >   
   > > > On Wed, 25 Jan 2023 17:02:43 +0000   
   > > > "Kerr-Mudd, John"  wrote:   
   > > >   
   > > []   
   > > > > > Kerr-Mudd, John wrote:   
   > > > > > > Finally, a rot13 program for DOS that's smaller than the standard   
   version   
   > > > > > > with jumps:   
   > > > > > >   
   > []   
   > > 'Better' still use C3 (embedded 'ret') to reduce prog to 45 bytes.   
   > []   
   >   
   > One that works even if the rot amount isn't 13 (ie the older version   
   > didn't!) also 45 bytes:   
   >   
   > ->u 100 l2D   
   > 16AD:0100 BA E6 0D       mov          dx,0DE6   
   > 16AD:0103 B4 3F          mov          ah,3F   
   > 16AD:0105 B5 C3          mov          ch,C3   
   > 16AD:0107 CD 21          int          21   
   > 16AD:0109 91             xchg         ax,cx   
   > 16AD:010A E3 FA          jcxzw        0106   
   >   
   > 16AD:010C 89 D6          mov          si,dx   
   > 16AD:010E 51             push         cx   
   >   
   > 16AD:010F AC             lodsb   
   > 16AD:0110 24 DF          and          al,DF   
   > 16AD:0112 2C 41          sub          al,41   
   > 16AD:0114 2C 1A          sub          al,1A   
   > 16AD:0116 18 E4          sbb          ah,ah   
   > 16AD:0118 00 F0          add          al,dh   
   > 16AD:011A D6             salc   
   > 16AD:011B 21 D0          and          ax,dx   
   > 16AD:011D 00 E0          add          al,ah   
      
   > 16AD:011F 00 64 FF       add          [si-01],ah   
   Oh bother, make that al:   
   16AD:011F 00 44 FF       add          [si-01],al   
      
   > 16AD:0122 E2 EB          loopw        010F   
   >   
   > 16AD:0124 59             pop          cx   
   > 16AD:0125 43             inc          bx   
   > 16AD:0126 B4 40          mov          ah,40   
   > 16AD:0128 CD 21          int          21   
   > 16AD:012A 4B             dec          bx   
   > 16AD:012B EB D6          jmp          0103   
   >   
   > ->          d 100 l2D   
   > 16AD:0100 BA E6 0D B4-3F B5 C3 CD-21 91 E3 FA-89 D6 51 AC  ....?...!.....Q.   
   > 16AD:0110 24 DF 2C 41-2C 1A 18 E4-00 F0 D6 21-D0 00 E0 00  $.,A,......!....   
   > 16AD:0120 64-FF E2 EB 59-43 B4 40 CD-21 4B EB D6           d...YC.@.!K..   
   -----------^44   
      
   > ->          q   
   >   
   >   
      
   (It happens to work, so passes my test but iff rot13)   
      
   --   
   Bah, and indeed Humbug.   
      
   --- 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