|
Intel assembly in Linux
Hello
I have 2 new questions.
I am assembing with gcc in Linux.
With this code I get 2 errors.
void asm128Sort( short *pSource, short *pDest, UINT Rows, UINT Cols, UINT nPxlPitch)
{
int nOffset = Cols * 4 +4;
asm(".intel_syntax noprefix\n"
" mov esi, pSource\n"
" add edi, nOffset\n"
" mov ecx, Cols\n"
" dec ecx \n"
....
" dec nRows\n"
....);
}
Error 1
asmsort.c:67: warning: unused variable `nOffset'
It seems I have to declare it as a global outside of my function. Is that right? Any way I can declare it within my function.
Error 2
asmsort.s:71: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
The line dec nRows causes the problem. It does not seem to know that nRows is declared as a UINT.
This code compiles ok in Visual C
Please help I am stuck.
Linda
|