This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C and Assembly interworking

Hi,

i am working with c and assembly interworking. I am trying to pass the array from c to assembly, but i am getting the error. Please help me in finding the error. The code is as follows

#include <stdio.h> 

#include<lpc214x.h>            

#define size 5

void shift(int m, int arr[]);

main ()

{

    int arr[]={1, 2, 3, 4, 5 };

   shift(5, arr);

}

__inline void shift(int m, int arr[])

{

   int a[5];

__asm

{

  mov r2, #5

    mov r0, arr

loop LDR a, [r0], #4

   sub r2,#1

  cmp r2, #0

    BNE loop

    }

 

}

Thanks and Regards

PVJ

0