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,384 of 4,675   
   Jan Bruns to All   
   Re: Hex 2 Bin   
   01 May 18 07:09:28   
   
   From: ebay@nospicedham.abnuto.de   
      
   Kerr-Mudd,John:   
      
   > My googlefu is awful; I can't get any decent (i.e. short fast) hex2bin   
   > asm source code. Just some learners with naive code such as (top of   
   > head) ------------   
   > cmp al,'0'   
   > jb gnc cmp al,'9'   
   > jb isnum and al,0xDF ; scrap lowercase sub al,'A'   
   > jb gnc add al,0x0A jmp havehex isnum:   
   > sub al,0x30 havehex:   
   > ------------   
      
   What about   
      
   ((byte((ascii and $1f)-16)*133) shr 7) and 15   
      
   also works with mul 266 and shift by 8, of course.   
      
      
   Gruss   
      
   Jan Bruns   
      
   --- 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