XPost: comp.os.msdos.programmer, alt.lang.asm   
   From: admin@nospicedham.127.0.0.1   
      
   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:   
   > > > >   
   > >   
   > > simpler? version; hardcoded IOAREA, rotamt in dl   
   > > ->u 100 l2E   
   > > 1637:0100 BA 0D 1A mov dx,1A0D   
   > > 1637:0103 B4 3F mov ah,3F   
   > > 1637:0105 89 C1 mov cx,ax   
   >   
   > Nasty hack gave poor use of seg for R/W buffer; replace with   
   > mov ch,E4 ; (ie. FF-1A-1)   
   > []   
   []   
   'Better' still use C3 (embedded 'ret') to reduce prog to 45 bytes.   
      
   ->u 100 l2D   
   1637:0100 BA 0D 1A mov dx,1A0D   
   1637:0103 B4 3F mov ah,3F   
   1637:0105 B5 C3 mov ch,C3   
   1637:0107 CD 21 int 21   
   1637:0109 89 D6 mov si,dx   
   1637:010B 91 xchg ax,cx   
   1637:010C E3 F8 jcxzw 0106   
   1637:010E 51 push cx   
   1637:010F AC lodsb   
   1637:0110 24 DF and al,DF   
   1637:0112 2C 41 sub al,41   
   1637:0114 38 D0 cmp al,dl   
   1637:0116 18 E4 sbb ah,ah   
   1637:0118 38 F0 cmp al,dh   
   1637:011A D6 salc   
   1637:011B 21 D0 and ax,dx   
   1637:011D 28 C4 sub ah,al   
   1637:011F 00 64 FF add [si-01],ah   
   1637:0122 E2 EB loopw 010F   
   1637:0124 59 pop cx   
   1637:0125 43 inc bx   
   1637:0126 B4 40 mov ah,40   
   1637:0128 CD 21 int 21   
   1637:012A 4B dec bx   
   1637:012B EB D6 jmp 0103   
   -> d 100 l2D   
   1637:0100 BA 0D 1A B4-3F B5 C3 CD-21 89 D6 91-E3 F8 51 AC ....?...!.....Q.   
   1637:0110 24 DF 2C 41-38 D0 18 E4-38 F0 D6 21-D0 28 C4 00 $.,A8...8..!.(..   
   1637:0120 64-FF E2 EB 59-43 B4 40 CD-21 4B EB D6 d...YC.@.!K..   
   -> q   
      
   --   
   Bah, and indeed Humbug.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|