s 2131 2132 2133 In the following problems the data table c
#\'s 2.13.1 , 2.13.2, 2.13.3
In the following problems, the data table contains the values for registers r3 and r4. You will he asked to perform several ARM logical operations on these registers. For the lines above, what is the value of r 5 for the following sequence of instructions: OR r5. R4. r3. LSL #4 For the values in the table above, what is the value of r 2 for the following sequence of instructions: MVN r3. #1 AND r5. r3. r4. LSL #4 For the lines above, what is the value of r5 for the following sequence of instructions: MOV rS, Ox FFEF AND rS, r5. r3. LSR #3Solution
r3 = 0x55555555
r4 = 0x12345678
2.13.1) OR r5, r4, r3, LSL #4
Step 1 : r5 = r4 OR r3 = 0x4761032D
Step 2 : Logical shift the r5 by 4 bits left = 0x761032D0
2.13.2) MVN r3, #1
MVN moves one’s complement of the operand into the register.
so r3 = 0xAAAAAAAA
AND r5,r3,r4,LSL #4
Step 1 : r5 = r3 AND r4 = 0xAAAAAAAA AND 0x12345678 = 0x02200220
Step 2 : Logical shift the r5 by 4 bits left = 0x22022000
r5 = 0x22022000
2.13.3) MOV r5, 0xFFEF
MOV will copying of data from one location to another, so r5 loaded with 0xFFEF
r5 = 0xFFEF
AND r5,r5,r3, LSR #3
r5 = r5 AND r3 = 0xFFEF AND 0xAAAAAAAA = 0xAAAA
r5 LSR #3 = Shift right by 3 bits = 0x5555
