Question: Some machines have a find-first-one instruction that counts the location of the first bit set to 1 within the word. Write an ARM sequence of

Some machines have a find-first-one instruction that counts the location of the first bit set to 1 within the word. Write an ARM sequence of instructions that takes the word in rO and puts the locations of the first bit set to 1 in rl. Count from the left, so that if bit 31 is set, the value returned should be 0. If bit O is set, the value returned is 31. If no bit is set, the value returned should be 32.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

We can use a shift and continue until we find a 1 or stop on all bits shifted MOV r... View full answer

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 Computer Architecture Questions!