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
We can use a shift and continue until we find a 1 or stop on all bits shifted MOV r... View full answer
Get step-by-step solutions from verified subject matter experts
