Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Porting to linux and inline assembly with gcc

Author: Russell Reagan

Date: 12:23:26 10/06/02

Go up one level in this thread


On October 06, 2002 at 07:05:04, Dieter Buerssner wrote:

>/* Untested code */
>int LowBit(unsigned long long a)
>{
>  int res;
>  __asm__ volatile("
>    movl -33, %0
>    bsfl %2, %0
>    addl 32, %0
>    bsfl %1, %0"
>    : "=q&" (res)
>    : "g" ((unsigned long)a), "g" ((unsigned long)(a>>32))
>    : "cc" /* condition code (flags register) clobbered */);
>  return res;
>}

Thanks for the code. At least I know I was on the right track. I was trying
something similar, but I was using eax explicitly. The problem is that I was
getting a segmentation fault with my code, and I get the same with yours. Any
idea what that could be a result of? I'm not even sure what a segmentation fault
is. Sounds like it was trying to read/write memory outside of it's process space
(?), but I don't know.

Russell



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.