Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 15th, 2005, 10:04 AM   #1
LindaW567
Newbie
 
Join Date: Feb 2005
Location: Near London, England
Posts: 5
Rep Power: 0 LindaW567 is on a distinguished road
inline assembler in Linux

Hello

I have to provide a DLL for Windows and Linux using common code.
One of the routines has inline assembler. This is no problem in my Windows version, compiles and works with no errors.

However when I compile under Linux there are heaps of problems.
I realise that Linux expects the assembler in AT&T format, not Intel format.
But I read about a compiler option "-masm=intel" to allow GCC to output intel format, however it does not seem to work I get an error at the first "mov" statement.

This is a sample of the code:

#include <stdlib.h>

void __cdecl asmOffsetCorrection (WORD *pData, WORD *pDest, WORD *pOffsetCorrImage, int nCount)
{
__asm(
mov esi, pData
mov edi, pOffsetCorrImage
mov ecx, nCount
mov edx, pDest
)
}


compiled as:
gcc -c sample.c -masm=intel

Any help would be appreciated.

Linda
LindaW567 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:00 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC