Mail Archives: djgpp/2002/04/02/13:15:23
I wanted to convert my inner loop to assembly ,
it did compile but it doesn't do what the C-routine does.
I'm new to AT&T syntax , where is the mistake ?
C:
----------------------------------------------
j=0;
label1:j+=A[q+row];
row=D[row];
if(j<min && row!=x) goto label1;
-----------------------------------------------
assembly:
______________________________________________
__asm__ __volatile__ ("
pushal
xorl %%eax,%%eax
movl %%ebx,%1
movl %%ecx,%2
movl %%edx,%3
addl %%ecx,%4
movl %%edi,%5
movl %%ebp,%6
label1:
addl %%eax,(%%ecx,%%edx,1)
movl %%edx,(%%edi,%%edx,1)
cmpl %%eax,%%ebp
jae label2
cmp %%edx,%%ebx
jne label1
label2:
movl %0,%%eax
popal
"
:"=g"(j)
:"g"(x),"g"(q),"g"(row),"g"(A),"g"(D),"g"(min)
);
- Raw text -