Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: inline __asm in MSVC

Author: Gerd Isenberg

Date: 07:48:43 01/21/02

Go up one level in this thread


Hi, i am not sure to really understand your problem. Is your inline function
(defined i h-File) not expanded in your cpp file?

Mine is similar, but i use __forceinline for this short one and i have no
problem.

__forceinline unsigned int BitSearch(BitBoard bb)
{
   __asm
  {
     bsf eax,[bb+4]
     add al, 32
     bsf eax,[bb]
  }
}


but you have an Option in Project Settings -> Tab <C/C++> -> Category
<Optimizations>. In MSC6 there is a ComboBox <Inline function expansion> - where
you choose "only __inline" or "any suitable".

You can inspect your release code. Simply insert an

 __asm int 3;

instruction (interrupt 3 is like an inbuild breakpoint) just before you call
your inline function. When you start your program it stops there and you should
see your inline code in the Disassembly-Window.

Gerd



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.