ASSEMBLY/Keil a)Write an assembly instruction to set bits b30 and b23 of registe
ID: 3594631 • Letter: A
Question
ASSEMBLY/Keila)Write an assembly instruction to set bits b30 and b23 of register R2 into 1
b) What is the function of the following assembly instruction:
BIC r2,r2,#0x83
c) If the content of registers r1 = 0xF2E16789 and r2= 0x72CDF1F1 what will be the content of r2 after the execution of the following instructions AND r0,r1,#(0xF<<8) BIC r2,r2,#(0xF<<8) ORR r2,r2,r0
need asap will rate right away! ASSEMBLY/Keil
a)Write an assembly instruction to set bits b30 and b23 of register R2 into 1
b) What is the function of the following assembly instruction:
BIC r2,r2,#0x83
c) If the content of registers r1 = 0xF2E16789 and r2= 0x72CDF1F1 what will be the content of r2 after the execution of the following instructions AND r0,r1,#(0xF<<8) BIC r2,r2,#(0xF<<8) ORR r2,r2,r0
need asap will rate right away! ASSEMBLY/Keil
a)Write an assembly instruction to set bits b30 and b23 of register R2 into 1
b) What is the function of the following assembly instruction:
BIC r2,r2,#0x83
c) If the content of registers r1 = 0xF2E16789 and r2= 0x72CDF1F1 what will be the content of r2 after the execution of the following instructions AND r0,r1,#(0xF<<8) BIC r2,r2,#(0xF<<8) ORR r2,r2,r0
need asap will rate right away!
Explanation / Answer
A. Assuming b31 indicate most significant bit. We will apply OR operation with value 1 at b30 and b23, value 0 at remaining bits. So answer is
OR R2,R2,#0x40800000
B. BIC instruction will perform AND operation of operand 1 with complement of operand 2. Complement of #0x83 is #0x7C. Thus
BIC r2,r2,#0x83 which is equivalent to
AND r2,r2,#0x7C will clear the bit b7, b1 and b0 of r2 to zero.
C. 0xF<<8 will shift the value F to 8 bits left. So
AND r0,r1,#(0xF<<8) will clear all bits of r1 other than bits 8-11 to zero and store in r0.
Thus r0 = 0x700
BIC r2,r2,#(0xF<<8) will clear all bits in 8-11 to zero because of AND operation with complement of #(0xF<<8).
Thus r2= 0x72CDF0F1
ORR r2,r2,r0 will perform OR operation. Since r0=0x700 contains 1 at bits 8-10. So r2=0x72CDF7F1 will be the final output of r2.