You are here:Home » Microprocessor » Count the number of 1s: 8085

Count the number of 1s: 8085


The following program will count the number of 1s in a 8085 Microprocessor:

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

The following flowchart might give you a better idea: