![]() |
Problem with variable in inline assembler
I am calling this routine in a shared library (DLL) of mine which contains inline assembler.
This compiles and links ok. When I build a program which calls this routine, when linking I get: ./libxis.so: undefined reference to `pSource' this is talking about the variable in the second line of the assembler code as if it cannot see it in the function declaration. I get this line for all of the passed variables. Any ideas Linda [code] void asmOffsetCorrection (WORD *pData, WORD *pDest, WORD *pOffsetCorrImage1, int nCount) { asm(".intel_syntax noprefix\n" " mov esi, pData\n" " mov edi, pOffsetCorrImage1\n" " mov ecx, nCount\n" " mov edx, pDest\n" " Start1:\n" " mov eax, 0\n" " mov ax,[esi]\n" // Grauwert nach ax " cmp ax,0xFFFA\n" " ja SetWhite1\n" // 28.08.00 Ar " mov bx,[edi]\n" // Offset nach " sub ax,bx\n" // hieren " jc SetBlack1\n" // " mov [edx], ax\n" // Nein : " jmp SetCount1\n" " SetWhite1:\n" " mov word ptr [edx], 0xFFFF\n" // " jmp SetCount1\n" // 28.8.00 Ar " SetBlack1:\n" // Ja: auf schwarz setzen " mov word ptr [edx], 0x0\n" " SetCount1:\n" " inc esi\n" // Zeiger und " inc esi\n" // n " inc di\n" " inc edi\n" " inc edx\n" " inc edx\n" " dec x\n" " cmp ecx,0" " jg \n" " mov eax,0"); } [code] |
| All times are GMT -5. The time now is 12:58 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC