Free Electronic Circuits & 8085 projects

Electronic projects with circuit diagram and 8085 microprocessor projects.

Count number of one’s in a number

Published on Nov 16 2009 // Beginners

Statement: Write a program to count number of l’s in the contents of D register and store the count in the B register.

Sample problem 1:

(2200H) =  04

(2201H) = 34H

(2202H) = A9H

(2203H) = 78H

(2204H) =56H

Result = (2202H) = A9H

Source program :

  • MVI B, 00H
  • MVI C, 08H
  • MOV A, D
  • BACK: RAR
  • JNC SKIP
  • INR B
  • SKIP: DCR C
  • JNZ BACK
  • HLT

Flowchart for program

21-Count number of one's in a number

Related Programs for Beginners: (Click down)

Calculate the sum of series of numbers

Right shift bit of data

Divide a 16 bit number by a 8-bit number

Find the negative numbers in a block of data.