Author: Dann Corbit
Date: 17:32:19 09/24/02
Go up one level in this thread
On September 24, 2002 at 19:10:18, Arshad Syed wrote:
>I am planning to write my own engine soon. Preferably I would like to code the
>search engine in Assembly Language since nodes/sec is a very important factor
>for me. Is it easy to interface Winboard with Assembly language code?
Sure. Put C wrappers around everything.
For instance, from Crafty's vcinline.h:
#if _MSC_VER >= 1200
#define FORCEINLINE __forceinline
#else
#define FORCEINLINE __inline
#endif
FORCEINLINE int PopCnt(BITBOARD a) {
/* Because Crafty bitboards are typically sparsely populated, we use a
streamlined version of the boolean.c algorithm instead of the one in x86.s
__asm {
mov ecx, dword ptr a
xor eax, eax
test ecx, ecx
jz l1
l0: lea edx, [ecx-1]
inc eax
and ecx, edx
jnz l0
l1: mov ecx, dword ptr a+4
test ecx, ecx
jz l3
l2: lea edx, [ecx-1]
inc eax
and ecx, edx
jnz l2
l3:
}
}
This page took 0.01 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.