Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: FirstBit() in assembler

Author: Koundinya Veluri

Date: 19:13:32 01/13/02

Go up one level in this thread


On January 13, 2002 at 16:32:01, David Rasmussen wrote:

>On January 13, 2002 at 13:20:52, Dan Newman wrote:
>
>>On January 13, 2002 at 08:48:13, David Rasmussen wrote:
>>
>>
>>I do something like this (Dann Corbit's trick):
>>
>>        bsf eax dword ptr bitboard+4
>>        add eax 32
>>        bsf eax dword ptr bitboard
>>
>
>I get it now... Is there a similar trick for a "LastBit()" function?

I'm using this for LastBit() for a8 = 0, b8 = 1, h1 = 63 orientation:

	bsr		eax, [bb + 4]
	jz		L10
	add		eax, 32
	jmp		L11
L10:
	bsr		eax, [bb]
L11:

This should work, but I'm relatively new to assembly and I wonder if this can
get any better...?

Regards,
Koundinya

>
>/David



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.