Question: Using bit-manipulation instructions, BFI, SBFX, UBFX, BFC, RBIT, instead of other instructions like ORR, AND, LSL, ROR, etc. accomplish the following task. Write a program

Using bit-manipulation instructions, BFI, SBFX, UBFX, BFC, RBIT, instead of other instructions like ORR, AND, LSL, ROR, etc. accomplish the following task.

Write a program to search for 0101 pattern in a 32-bit word in R0. Upon finding the pattern, extract the next 2-bits on left from R0 to R1. Also clear the pattern found from R0. Replace the extracted 2-bits with 11. You may use other registers as temp registers as needed.

Example:

R0 = 0100 0010 0100 1001 0101 1101 0011 0111

After the program completes

R0 = 0100 0010 0100 1011 0000 1101 0011 0111

R1 = 0000 0000 0000 0000 0000 0000 0000 0001

Please help

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!