title: ARM - Load and Store assembly instructions
body: <p>I am trying to <code>load</code> and <code>store</code> data from two different <code>arm</code> registers. </p>
  
  <pre><code>int testing[64*1024]  __attribute__ ((aligned (8192)));
  __asm__("MOV r0, %0" :: "r" (testing) : "r0");
  __asm__("STR R5,[R0];");
  </code></pre>
  
  <p>In my initial attempt I tried to store some data pointed to by the register <code>r0</code> to register <code>r5</code>. There are absolutely <em>no</em> compilation problems but the data in the register <code>cannot be accessed.</code></p>
  
  <p>It is the same case for <code>Load</code> as well.</p>
  
  <pre><code>LDR R1,[R0]
  
  
  
  (gdb) info registers
  r0             0xb6000  745472
  r1             0x1      1
  r2             0x0      0
  r3             0xb6000  745472
  r4             0x8961   35169
  r5             0x0      0
  r6             0x0      0
  r7             0xbeba9664       3199899236
  r8             0x0      0
  r9             0xefb9   61369
  r10            0xf02d   61485
  r11            0x0      0
  r12            0x0      0
  sp             0xbeba9664       0xbeba9664
  lr             0x89cb   35275
  pc             0xeace   0xeace &lt;test48+14&gt;
  cpsr           0x60000030       1610612784
  (gdb) bt
  #0  0x0000eace in test48 ()
  #1  0x000089ca in main ()
  (gdb) x/x $r5
  0x0:    Cannot access memory at address 0x0
  (gdb) x/x $r0
  0xb6000 &lt;testing&gt;: 0x00000000
  </code></pre>
  
  <p>Essentially I am trying to achieve some memory inline addressing using ldr and str.</p>
  
  <p>I took  help of <a href="http://www.davespace.co.uk/arm/introduction-to-arm/addressing.html" rel="nofollow">this</a> guide while I was building my example</p>
  
  <p>Any idea where I am going wrong</p>