Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 0.76 KB | None | 0 0
  1. .data          /* the .data section is dynamically created and its addresses cannot be easily predicted */
  2. var1: .word 3  /* variable 1 in memory */
  3. var2: .word 4  /* variable 2 in memory */
  4.  
  5. .text          /* start of the text (code) section */
  6. .global _start
  7.  
  8. _start:
  9.     ldr r0, adr_var1  @ load the memory address of var1 via label adr_var1 into R0
  10.     ldr r1, adr_var2  @ load the memory address of var2 via label adr_var2 into R1
  11.     ldr r2, [r0]      @ load the value (0x03) at memory address found in R0 to register R2  
  12.     str r2, [r1]      @ store the value found in R2 (0x03) to the memory address found in R1
  13.     bkpt            
  14.  
  15. adr_var1: .word var1  /* address to var1 stored here */
  16. adr_var2: .word var2  /* address to var2 stored here */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement