arm gcc help in programming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello...i'm abhilash..i've typed a code to add 2 64bit numbers.the
code iis not successfully compiled..errors are not shown in the .c
file but in a .s file whose location cant be traced out.
my code is given below...
........................................................
#include<stdio.h>

unsigned long value1[2]={0x12a2e670,0xa2435649};
unsigned long value2[2]={0x12a2e670,0xa2435649};
unsigned long result[2];

unsigned long *a=&value1;
unsigned long *b=&value2;
unsigned long *c=&result;


main()
{
asm("ldr r0,%[v]\n\t"
                "ldr r1,[r0]\n\t"
                "ldr r2,[r0,#4]\n\t"
                ::[v] "r" (a));
asm volatile( "ldr r0,%0\n\t"
                "ldr r3,[r0]\n\t"
                "ldr r4,[r0,#4]\n\t"
                ::"r" (b):"memory");
asm volatile( "adds r6,r2,r4\n\t"
                "adc r5,r1,r3\n\t"
                "ldr r0,%0\n\t"
                "str r5,[r0]\n\t"
                "str r6,[r0,#4]\n\t"
                ::"r" (c):"memory");
asm volatile("mrs r7,cpsr\n\t"
                "swi &11");
}

.........................................................

after this i did "gcc filename" and errors came...please help me sort
the issue...

Abhilash

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux