Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started