Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

<liiwi> udp - universal dropping of an pigeon


programming / alt.lang.asm / Re: rot13 revisited

SubjectAuthor
* rot13 revisitedKerr-Mudd,John
`- Re: rot13 revisitedPeter Cheung

1
Subject: rot13 revisited
From: Kerr-Mudd,John
Newsgroups: alt.lang.asm
Organization: dis
Date: Mon, 9 Sep 2019 10:37 UTC
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: notsay...@invalid.org (Kerr-Mudd,John)
Newsgroups: alt.lang.asm
Subject: rot13 revisited
Date: Mon, 9 Sep 2019 10:37:51 -0000 (UTC)
Organization: dis
Lines: 25
Message-ID: <XnsAAC5765E68EEadmin127001@144.76.35.198>
Injection-Date: Mon, 9 Sep 2019 10:37:51 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="f5cfa822ce8c9f98b203edc0cd20f31e";
logging-data="16371"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189yi7Ynne7SeBNqg8GHksXa80aEkxh33s="
User-Agent: Xnews/2006.08.24
Cancel-Lock: sha1:7EZCDuFQkJzpzUBsZKOkIdcfzww=
View all headers



Non-jump version; smallest I can manage;

           mov  al,[si]      ;   <A    A-M   N-Z   >Z

      ;;isalpha:      ;; ah=0 out, ah=FF in alpha range
           and  al,0xFF-0x20 ;   0-40 41-4D 4E-5A 5B-5F
           cmp  al,'Z'+1     ;    c     c     c     0
           sbb  ah,ah        ;ah -1    -1    -1     0
           sub  al,'A'       ;    c     +     +     +  ;req sub, not cmp
           adc  ah,0         ;ah  0    -1    -1     0  ; [3]
       ;; if GT rot sub rot then if LT rot add back 26   
           cmp  al,rot       ;    +?    c     +     +  ; for this to work
           sbb  al,al        ;    0    -1     0     0
           and  ax,0x100*rot +(0x100-26)               ; [3]
           add  al,ah        ;    0   rot-26 rot    0  

           sub  [si],al      ;  rot it!



--
Bah, and indeed, Humbug.


Subject: Re: rot13 revisited
From: Peter Cheung
Newsgroups: alt.lang.asm
Date: Sun, 22 Sep 2019 14:29 UTC
References: 1
X-Received: by 2002:aed:3b62:: with SMTP id q31mr13192805qte.246.1569162561678;
Sun, 22 Sep 2019 07:29:21 -0700 (PDT)
X-Received: by 2002:a81:280b:: with SMTP id o11mr19679116ywo.251.1569162561208;
Sun, 22 Sep 2019 07:29:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder7.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!o24no9739550qtl.0!news-out.google.com!q23ni102qtl.1!nntp.google.com!o24no9739547qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: alt.lang.asm
Date: Sun, 22 Sep 2019 07:29:20 -0700 (PDT)
In-Reply-To: <XnsAAC5765E68EEadmin127001@144.76.35.198>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=123.202.209.162;
posting-account=bv9fUwoAAAALZPMyH_uNDx4MtNzAsvy6
NNTP-Posting-Host: 123.202.209.162
References: <XnsAAC5765E68EEadmin127001@144.76.35.198>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4a11173f-b2d6-47dd-80d6-f1cc913d1b93@googlegroups.com>
Subject: Re: rot13 revisited
From: mcheun...@gmail.com (Peter Cheung)
Injection-Date: Sun, 22 Sep 2019 14:29:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
View all headers
Kerr-Mudd,John於 2019年9月9日星期一 UTC+8下午6時37分52秒寫道:
Non-jump version; smallest I can manage;

           mov  al,[si]      ;   <A    A-M   N-Z   >Z

      ;;isalpha:      ;; ah=0 out, ah=FF in alpha range
           and  al,0xFF-0x20 ;   0-40 41-4D 4E-5A 5B-5F
           cmp  al,'Z'+1     ;    c     c     c     0
           sbb  ah,ah        ;ah -1    -1    -1     0
           sub  al,'A'       ;    c     +     +     +  ;req sub, not cmp
           adc  ah,0         ;ah  0    -1    -1     0  ; [3]
       ;; if GT rot sub rot then if LT rot add back 26   
           cmp  al,rot       ;    +?    c     +     +  ; for this to work
           sbb  al,al        ;    0    -1     0     0
           and  ax,0x100*rot +(0x100-26)               ; [3]
           add  al,ah        ;    0   rot-26 rot    0  

           sub  [si],al      ;  rot it!



--
Bah, and indeed, Humbug.

May I ask what is it?


1
rocksolid light 0.7.2
clearneti2ptor