![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Feb 2005
Location: Near London, England
Posts: 5
Rep Power: 0
![]() |
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 |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|