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 3,393 of 4,675   
   Kerr-Mudd,John to notsaying@nospicedham.invalid.org   
   Re: Hex 2 Bin   
   06 May 18 20:18:00   
   
   From: notsaying@nospicedham.invalid.org   
      
   On Sun, 06 May 2018 10:10:13 GMT, "Kerr-Mudd,John"   
    wrote:   
      
   > On Thu, 03 May 2018 17:39:13 GMT, "Kerr-Mudd,John"   
   >  wrote:   
   >   
   >> On Tue, 01 May 2018 16:16:40 GMT, "Kerr-Mudd,John"   
   >>  wrote:   
   >>   
   >>> On Tue, 01 May 2018 11:01:28 GMT, "Kerr-Mudd,John"   
   >>>  wrote:   
   >>>   
   > []   
   >    ;; 8   
   >>>>          cmp al,'0'          ;       ah/al   
   >>>>          jb gnc              ;    3x   4x   6x   
   >>>   
   >>>>          and al,0x4F         ;     x   4x   4x   
   >>>>          aam 0x37            ;     x     x+9   
   >>>>          ; if hex letter ah=1, else (number) ah=0   
   > []   
   >  avoiding AAM:   
   >>   
   >> ;; 14   
   >>          cmp al,'0'          ;      ah/al   
   >>          jb gnc              ;    3x   4x   6x   
   >>          shl al,1            ;  0/6x    0/8x ; hibit on iff char   
   >            cbw                 ;  0/6x   FF/8x ; ah=FF   
   >>          shr al,1            ;  0/3n   FF/4x FF/6x   
   >>          and ax,0x090F       ;  0/0n   09/01-06   
   >>          add al,ah           ;  0/0n   09/0A-0F   
   >>   
   >>   
   >   
   > ;; 13   
   >          cmp al,'0'          ;      ah/al   
   >          jb gnc              ;    3x   4x   6x   
   >          add al,0xC0         ;  cy iff char   
   >          sbb ah,ah           ;  ah=FF iff al >= 40   
   >          and ax,0x090F       ;  0/0n   09/01-06   
   >          add al,ah           ;  0/0n   09/0A-0F   
   >          ; if hex letter: ah=9, if digit ah=0   
   >   
   >   
   Slow, but progress:   
   ; 12   
            cmp al,'0'          ;      ah/al   
            jb gnc              ;    3x   4x   6x   
            add al,0x40         ;  hibit iff char   
            cbw                 ;  ah=0/FF   
            and ax,0x090F       ;  0/0n  09/01-06   
            add al,ah           ;  0/0n  09/0A-0F   
            ; if hex letter: ah=9, if digit ah=0   
      
      
   --   
   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