Yeah, on closer look, your code should achieve what you intended. May be something more has to be done in "asm ...." to get the correct code generated or may be gcc (v 3.2.3 on i386) is not generating correct code. I tried slightly modified version of your code (attached file 1.c) also attaching the output of "gcc -S 1.c" (file 1.s - modified) original assembly code generated for the "asm(...)" in the code was #APP movq (%eax), %mm0 movq %mm0, (%eax) #NO_APP this code is not going to change things, as it is doing like "x=x". On modifying the code to below (based on how variables were allocated for the test) #APP movq (%eax), %mm0 leal -16(%ebp), %eax movq %mm0, (%eax) #NO_APP "gcc 1.s" generates a.out that works the you expect. Ankit Jain wrote: > thanks. well i know it is effectively working for > m1[i] but my question was why it is not working for > b[i] when pointer points to that location or the > reality could be pointer dont points to that > location...but if so then why? > > ankit > --- sandeep wrote: > >>Ankit Jain wrote: >> >>> 4 int main() >>> 5 { >>> 6 uint8_t >>>a[8]={1,2,3,4,5,6,7,8},b[8]={0,0,0,0,0,0},i; >>> 7 uint8_t *m,*m1; >>> 8 >>> 9 m=a; >>> 10 m1=b; //i have pointed m1 to b >>> 11 for(i=0;i<8;i++) >>> 12 printf("%d ",a[i]); >>> 13 printf("\n"); >> >>> 14 asm("movq (%1), %%mm0 \n" >>> 15 "movq %%mm0, (%0) \n" >>> 16 :"=r"(m1) >>> 17 :"r"(m) >>> 18 ); >> >>this asm(...) is effectively achieving "m1=m;" you >>can verify this by printing >>m1[i] instead of a[i] and b[i] >> >>> 19 >>> 20 for(i=0;i<8;i++) >>> 21 printf("%d ",b[i]); >>> 22 return 0; >>> 23 } >>>well this problem is not solved yet. because when i >>>display b array then it prints all 0's. according to >>>me since i have initialised this m1 pointer then by b >>>then b whould have all the values which i have moved >>>some have advised me to use arrays here as constraint >>>but i want to use pointers. i am using r constraint >>>and it says it says that m1 will use a register (i >>>guess there is no problem in that) -- regards sandeep -------------------------------------------------------------------------- A lack of leadership is no substitute for inaction. --------------------------------------------------------------------------