Hello I need help with this problem 1 What is the value in R
Hello, I need help with this problem.
1. What is the value in R4 after the following instructions are executed?
MOV.w #0, R4 ; R4 =
ADD.w #0x02, R4 ; R4 =
RLA.w R4 ; R4 =
RLA.w R4 ; R4 =
Thank you for your time!
Solution
Answer:
The value in R4 after the given instructions are executed is 0 i.e R4=0.
MOV.w #0, R4 ; R4 =0
ADD.w #0x02, R4 ; R4 =2
RLA.w R4 ; R4 =1
RLA.w R4 ; R4 =0
RLA instruction performs rotate left operation for the input which is in accumulator twice for the register R4 which gives the value 1 and 0 for the 3\'rd and 4\'th instructions respectively.

