LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Problem with variable in inline assembler (http://www.linuxquestions.org/questions/programming-9/problem-with-variable-in-inline-assembler-324403/)

DavidW567 05-17-2005 11:21 AM

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

David

[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" // keine Offsetkorrektur bei Rohdaten > 65530
" ja SetWhite1\n" // 28.08.00 Ar
" mov bx,[edi]\n" // Offset nach bx
" sub ax,bx\n" // Subtrahieren
" jc SetBlack1\n" // �erlauf ?
" mov [edx], ax\n" // Nein : neuen Wert speichern
" jmp SetCount1\n"
" SetWhite1:\n"
" mov word ptr [edx], 0xFFFF\n" // �erlauf Daten auf Wei�setzen
" 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 Z�ler
" inc esi\n" // justieren
" inc edi\n"
" inc edi\n"
" inc edx\n"
" inc edx\n"
" dec ecx\n"
" cmp ecx, 0\n"
" jg Start1\n"
" mov eax,0");

}

[CODE]


All times are GMT -5. The time now is 03:53 AM.