Question: Write an arm assembly code to count leading one The following is sample answer code , you need to write another answer not to use

Write an arm assembly code to count leading one

The following is sample answer code , you need to write another answer not to use CMP (I need to have new answer using only 1. LDR[*] 2. MOV[*] 3. B[*] 4. ADC[*] 5. LSR[*]

DO NOT USE CMP ) EXPORT __main __main LDR R0, =0x2345ABCD MOV R1, #0

loop CMP R0, #0 BEQ stop CLZ R2, R0 ADD R2, #1 ADD R1, #1 LSL R0, R2 BNE loop

stop B stop END

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!