Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-17-2005, 11:21 AM   #1
LQ Newbie
Registered: Nov 2004
Posts: 17

Rep: Reputation: 0
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:

./ 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


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");




Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Assembler samjkd General 7 03-14-2005 01:52 PM
Compiling inline assembler DavidW567 Programming 3 03-07-2005 08:59 AM
Assembler Firari Programming 9 12-10-2004 02:26 PM
assembler usr Programming 2 11-15-2003 05:15 PM
assembler tda Programming 4 08-21-2002 02:54 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration