I have an issue with my ARM asm, on Cortex A53 (64bits). I have to write 128 instruction like this one :
#define MACRO1() \
__asm__ volatile ("str %0,[%1], #4\n\t" \
"str %0,[%1], #4\n\t" \
: "=r"(here) \
: "r"(here) \
: );
Therefore, I created a Macro called MACRO1 and I duplicate it 128 times. The variable here is declared in previous part of code like this :
P4_uint32_t * buffer;
... code
P4_uint32_t *here = buffer;
My issue is that the compiler do something like that :
8014b40: f8008400 str x0, [x0],#4
8014b44: f8008400 str x0, [x0],#4
8014b48: f8008413 str x19, [x0],#4
8014b4c: f8008413 str x19, [x0],#4
8014b50: f8008673 str x19, [x19],#4
8014b54: f8008673 str x19, [x19],#4
I have an issue with these registers because the variable here is declared in the x19 register and so why is it using the x0 register. The issue is :
access to unmapped memory during write at address 0x802e000
And this address point on this part of the code...
Thank you for your help :)
output? While it's legal to use the same c variable for both an input and an output, be advised that the compiler may use different registers for %0 and %1. And since you don't seem to be assigning a value to %0, the contents ofherewould be undefined after executing this statement. - David Wohlferd