Assigning Value from Register to a Variable in Keil

-1

I am new to Keil uVision5, and have a very simple question regarding ARM assembly code. In my DATA area I defined a variable x and set its value to 0, and in the CODE area I moved the value of 2 into register 1. Now I want to store the value of register 1 into my variable x. In the DATA area I defined three variables:

x EQU 0x00000123
y EQU 0x00000456
z EQU 0

In the CODE area I did the following operations:

MOV r0, #x
MOV r1, #y
ADDS r2, r0, r1

Now the sum of the two hexadecimal values is stored in register r2. What I need to do is assign to z the value stored in r2. Basically, assign z = value in r2. Any help will be appreciated. Thank you.

assembly
arm
keil
asked on Stack Overflow Sep 11, 2018 by Alexander Nenartovich • edited Sep 11, 2018 by Alexander Nenartovich

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0