Question: I need to know the answer immediately. Thank you Assembly code : MOV r1,#0 ;; r1=0 MOV r2,#0 ;; Number of bits to countable MOV

I need to know the answer immediately. Thank you

Assembly code : MOV r1,#0 ;; r1=0 MOV r2,#0 ;; Number of bits to countable MOV r3,#0 ;; Number of bits of 1 CMP r0,#0 BEQ exit loop AND r4,r2,#1 ;; Take AND with 1 CMP r4,#0 ;; If it is 0, the bit is not 1 BEQ skip ADD r3,r3,#1 ;; r3 contains a number of 1's. skip LSR r2,r2,#1 ;; Shift 1 bit to the right. ADD r2,r2,#1 CMP r2,#32 BNE loop exit

Q: Improve the above program and create subroutine 'count0' which counts the number of zeros in the 32 bit number.

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!