Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Elegance and truth are inversely related. -- Becker's Razor


devel / comp.lang.asm.x86 / Re: Rot13 for DOS

SubjectAuthor
* Rot13 for DOSKerr-Mudd, John
+- Rot13 for DOSKerr-Mudd, John
`- Rot13 for DOSKerr-Mudd, John

1
Re: Rot13 for DOS

<20231118111020.57b5f1750a20a70720a3534f@127.0.0.1>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=868&group=comp.lang.asm.x86#868

  copy link   Newsgroups: comp.os.msdos.programmer comp.lang.asm.x86 alt.lang.asm
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: admin@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: comp.os.msdos.programmer,comp.lang.asm.x86,alt.lang.asm
Subject: Re: Rot13 for DOS
Date: Sat, 18 Nov 2023 11:10:20 +0000
Organization: Dis
Lines: 115
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20231118111020.57b5f1750a20a70720a3534f@127.0.0.1>
References: <20221223155428.cffff42388521c7edcc7fc41@127.0.0.1>
<20221230102429.07cf00658a86b4eae37b2c85@127.0.0.1>
<20221230213612.5365d824afb3f42b710a0546@127.0.0.1>
<20221231205235.58f626ebf44ce26ca6e79486@127.0.0.1>
<toud45$643$1@gioia.aioe.org>
<20230102135156.db0fac04da64af648fca3100@127.0.0.1>
<20230107163402.1bf13219b41340752ae1108f@127.0.0.1>
<20230122092440.b241058f685971166ec134fc@127.0.0.1>
<tqrcrf$mk22$1@dont-email.me>
<20230125170243.57c2b027de6c4659e016d2f3@127.0.0.1>
<20230127095722.38d5e85865ae0016c99ba606@127.0.0.1>
<20230127133013.8e9266014408e7d1f765c77f@127.0.0.1>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="835f65c2a9d299a5a3fe1d62f5a030a3";
logging-data="3468050"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DEgrKuI0F5gOYmINPSok6EDJM6vYb+BI="
Cancel-Lock: sha1:6z9LKlRkXhX19+bAdJZtjCBOifM=
 by: Kerr-Mudd, John - Sat, 18 Nov 2023 11:10 UTC

On Fri, 27 Jan 2023 13:30:13 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

> On Fri, 27 Jan 2023 09:57:22 +0000
> "Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:
>
> > On Wed, 25 Jan 2023 17:02:43 +0000
> > "Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> 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
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..
-> q

And a version that allows the rot amount as a parameter in 64 bytes:
example usage:
rot 3<input.txt

->u 100 l40
16AD:0100 BA E6 0D mov dx,0DE6
16AD:0103 BE 82 00 mov si,0082
16AD:0106 AD lodsw
16AD:0107 2D 30 30 sub ax,3030
16AD:010A 72 04 jb 0110
16AD:010C 86 E0 xchg ah,al
16AD:010E D5 0A aad 0A
16AD:0110 3C 00 cmp al,00
16AD:0112 72 02 jb 0116
16AD:0114 88 C6 mov dh,al

16AD:0116 B4 3F mov ah,3F
16AD:0118 B5 C3 mov ch,C3
16AD:011A CD 21 int 21
16AD:011C 91 xchg ax,cx
16AD:011D E3 FA jcxzw 0119

16AD:011F 89 D6 mov si,dx
16AD:0121 51 push cx

16AD:0122 AC lodsb
16AD:0123 24 DF and al,DF
16AD:0125 2C 41 sub al,41
16AD:0127 2C 1A sub al,1A
16AD:0129 18 E4 sbb ah,ah
16AD:012B 00 F0 add al,dh
16AD:012D D6 salc
16AD:012E 21 D0 and ax,dx
16AD:0130 00 E0 add al,ah
16AD:0132 00 44 FF add [si-01],al
16AD:0135 E2 EB loopw 0122

16AD:0137 59 pop cx
16AD:0138 43 inc bx
16AD:0139 B4 40 mov ah,40
16AD:013B CD 21 int 21
16AD:013D 4B dec bx
16AD:013E EB D6 jmp 0116

-> d 100 l40
16AD:0100 BA E6 0D BE-82 00 AD 2D-30 30 72 04-86 E0 D5 0A .......-00r.....
16AD:0110 3C 00 72 02-88 C6 B4 3F-B5 C3 CD 21-91 E3 FA 89 <.r....?...!....
16AD:0120 D6 51 AC 24-DF 2C 41 2C-1A 18 E4 00-F0 D6 21 D0 .Q.$.,A,......!.
16AD:0130 00 E0 00 44-FF E2 EB 59-43 B4 40 CD-21 4B EB D6 ...D...YC.@.!K..
-> q

--
Bah, and indeed Humbug.

Re: Rot13 for DOS

<20231118161614.e39093a64c0be6c395447717@127.0.0.1>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=869&group=comp.lang.asm.x86#869

  copy link   Newsgroups: comp.os.msdos.programmer comp.lang.asm.x86 alt.lang.asm
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: admin@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: comp.os.msdos.programmer,comp.lang.asm.x86,alt.lang.asm
Subject: Re: Rot13 for DOS
Date: Sat, 18 Nov 2023 16:16:14 +0000
Organization: Dis
Lines: 77
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20231118161614.e39093a64c0be6c395447717@127.0.0.1>
References: <20221223155428.cffff42388521c7edcc7fc41@127.0.0.1>
<20221230102429.07cf00658a86b4eae37b2c85@127.0.0.1>
<20221230213612.5365d824afb3f42b710a0546@127.0.0.1>
<20221231205235.58f626ebf44ce26ca6e79486@127.0.0.1>
<toud45$643$1@gioia.aioe.org>
<20230102135156.db0fac04da64af648fca3100@127.0.0.1>
<20230107163402.1bf13219b41340752ae1108f@127.0.0.1>
<20230122092440.b241058f685971166ec134fc@127.0.0.1>
<tqrcrf$mk22$1@dont-email.me>
<20230125170243.57c2b027de6c4659e016d2f3@127.0.0.1>
<20230127095722.38d5e85865ae0016c99ba606@127.0.0.1>
<20230127133013.8e9266014408e7d1f765c77f@127.0.0.1>
<20231118111020.57b5f1750a20a70720a3534f@127.0.0.1>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="835f65c2a9d299a5a3fe1d62f5a030a3";
logging-data="3554256"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/XF416qT1NzBBt+Am1B+xBbEXJj7GJp9E="
Cancel-Lock: sha1:honZOVwNUslRSnviA1x7WnJOEEc=
 by: Kerr-Mudd, John - Sat, 18 Nov 2023 16:16 UTC

On Sat, 18 Nov 2023 11:10:20 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

>
>
> And a version that allows the rot amount as a parameter in 64 bytes:
> example usage:
> rot 3<input.txt
>
> ->u 100 l40

Bah, I knew I shouldn't have posted so soon:

> 16AD:0100 BA E6 0D mov dx,0DE6
Instead of

> 16AD:0103 BE 82 00 mov si,0082
> 16AD:0106 AD lodsw
use:
16AD:0103 A1 82 00 mov ax,[0082]

(and adjust everything else up 1)

> 16AD:0107 2D 30 30 sub ax,3030
> 16AD:010A 72 04 jb 0110
> 16AD:010C 86 E0 xchg ah,al
> 16AD:010E D5 0A aad 0A
> 16AD:0110 3C 00 cmp al,00
> 16AD:0112 72 02 jb 0116
> 16AD:0114 88 C6 mov dh,al
>
> 16AD:0116 B4 3F mov ah,3F
> 16AD:0118 B5 C3 mov ch,C3
> 16AD:011A CD 21 int 21
> 16AD:011C 91 xchg ax,cx
> 16AD:011D E3 FA jcxzw 0119
>
> 16AD:011F 89 D6 mov si,dx
> 16AD:0121 51 push cx
>
> 16AD:0122 AC lodsb
> 16AD:0123 24 DF and al,DF
> 16AD:0125 2C 41 sub al,41
> 16AD:0127 2C 1A sub al,1A
> 16AD:0129 18 E4 sbb ah,ah
> 16AD:012B 00 F0 add al,dh
> 16AD:012D D6 salc
> 16AD:012E 21 D0 and ax,dx
> 16AD:0130 00 E0 add al,ah
> 16AD:0132 00 44 FF add [si-01],al
> 16AD:0135 E2 EB loopw 0122
>
> 16AD:0137 59 pop cx
> 16AD:0138 43 inc bx
> 16AD:0139 B4 40 mov ah,40
> 16AD:013B CD 21 int 21
> 16AD:013D 4B dec bx
> 16AD:013E EB D6 jmp 0116
>
> -> d 100 l40
> 16AD:0100 BA E6 0D BE-82 00 AD 2D-30 30 72 04-86 E0 D5 0A .......-00r.....
> 16AD:0110 3C 00 72 02-88 C6 B4 3F-B5 C3 CD 21-91 E3 FA 89 <.r....?...!....
> 16AD:0120 D6 51 AC 24-DF 2C 41 2C-1A 18 E4 00-F0 D6 21 D0 .Q.$.,A,......!.
> 16AD:0130 00 E0 00 44-FF E2 EB 59-43 B4 40 CD-21 4B EB D6 ...D...YC.@.!K..
> -> q
>
>
>
> --
> Bah, and indeed Humbug.
>

--
Bah, and indeed Humbug.

Re: Rot13 for DOS

<20231118221955.2b2a7ee9784bc03d76e90f94@127.0.0.1>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=870&group=comp.lang.asm.x86#870

  copy link   Newsgroups: comp.os.msdos.programmer comp.lang.asm.x86 alt.lang.asm
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: admin@nospicedham.127.0.0.1 (Kerr-Mudd, John)
Newsgroups: comp.os.msdos.programmer,comp.lang.asm.x86,alt.lang.asm
Subject: Re: Rot13 for DOS
Date: Sat, 18 Nov 2023 22:19:55 +0000
Organization: Dis
Lines: 73
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20231118221955.2b2a7ee9784bc03d76e90f94@127.0.0.1>
References: <20221223155428.cffff42388521c7edcc7fc41@127.0.0.1>
<20221230102429.07cf00658a86b4eae37b2c85@127.0.0.1>
<20221230213612.5365d824afb3f42b710a0546@127.0.0.1>
<20221231205235.58f626ebf44ce26ca6e79486@127.0.0.1>
<toud45$643$1@gioia.aioe.org>
<20230102135156.db0fac04da64af648fca3100@127.0.0.1>
<20230107163402.1bf13219b41340752ae1108f@127.0.0.1>
<20230122092440.b241058f685971166ec134fc@127.0.0.1>
<tqrcrf$mk22$1@dont-email.me>
<20230125170243.57c2b027de6c4659e016d2f3@127.0.0.1>
<20230127095722.38d5e85865ae0016c99ba606@127.0.0.1>
<20230127133013.8e9266014408e7d1f765c77f@127.0.0.1>
<20231118111020.57b5f1750a20a70720a3534f@127.0.0.1>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="835f65c2a9d299a5a3fe1d62f5a030a3";
logging-data="3673240"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1905tkt3WDI7s+U/R007wWLqgdH8kz7Y8w="
Cancel-Lock: sha1:c/6royJeHXyV8b1fGTz1KM/8YaQ=
 by: Kerr-Mudd, John - Sat, 18 Nov 2023 22:19 UTC

On Sat, 18 Nov 2023 11:10:20 +0000
"Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:

> On Fri, 27 Jan 2023 13:30:13 +0000
> "Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:
>
> > On Fri, 27 Jan 2023 09:57:22 +0000
> > "Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> wrote:
> >
> > > On Wed, 25 Jan 2023 17:02:43 +0000
> > > "Kerr-Mudd, John" <admin@nospicedham.127.0.0.1> 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.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor