Computer Chess Club Archives


Search

Terms

Messages

Subject: Code.

Author: Dan Andersson

Date: 09:41:30 05/21/02

Go up one level in this thread


Links to code:
http://www.df.lth.se/~john_e/fr_gems.html
http://www.df.lth.se/~john_e/gems/gem0018.html
The code by  Vesa Karvonen:

bswap   eax             ; Data in EAX
mov     edx,eax         ; Trashes EDX
and     eax,00F0F0F0Fh  ; "AND eax,0F0F0F0Fh" < "AND edx,0F0F0F0Fh"
xor     edx,eax         ; Smaller than "AND edx,0F0F0F0F0h"!
rol     eax,8           ; Rotate instead of 2 shifts!
or      eax,edx
mov     edx,eax
and     eax,033333333h
xor     edx,eax
rol     eax,4
or      eax,edx         ; Shift version could use LEAs,
mov     edx,eax         ; but it may not be faster.
and     eax,055555555h
xor     edx,eax
rol     eax,2
or      eax,edx
ror     eax,7           ; Rotate back...

Or find the e-book Art of Assembly and implement it yourself.

MvH Dan Andersson



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.