Re: Inline assembley code to be moved to .asm file
- From: "Alex Blekhman" <xfkt@xxxxxxxxx>
- Date: Tue, 12 Sep 2006 14:16:20 +0300
"weebo" wrote:
I am trying to compile a C++ program to run in 64bit mode
using Visual Studio
.Net 2005. One of the header files contains the following
assembler code to
check if the debugger is attached (by interrogating the
Thread Information
Block)
__asm
{
push eax // Preserve the registers
push ecx
mov eax, fs:[0x18] // Get the TIB's linear address
mov eax, dword ptr [eax + 0x30]
mov ecx, dword ptr [eax] // Get the whole DWORD
mov dw, ecx // Save it
pop ecx // Restore the registers
pop eax
}
When I compile using the 64bit compiler, I have to move
this inline
assembler code to a .asm file. The problem I have is that
no matter what I
do, I cannot get the code to compile as a .asm file. This
leads me to a
couple of questions - 1) what changes do I need to do to
compile this as a
.asm file and 2) is the thread information block (TIB)
stioll available to be
used in this way? I am also wondering if the
IsDebuggerPresent function will
do the same thing?
MSDN says that inline assembly language is not supported for
64-bit builds. It suggests to use MASM for x64 (ml64.exe)
for that. Also many asm instructions were translated into
compiler intrinsics. Look here for complete list:
"Compiler Intrinsics"
http://msdn2.microsoft.com/en-us/library/ms301440.aspx
Considering your task, it is quite strange why inline
assebly was used while perfectly working API function
exists. IsDebuggerPresent should work with any platform.
.
- Prev by Date: Re: XML Editor using VC++ 2005
- Next by Date: Re: FFEF behaviour
- Previous by thread: FFEF behaviour
- Next by thread: Re: Inline assembley code to be moved to .asm file
- Index(es):
Relevant Pages
|