Saturday, September 12, 2009

Count number of one's in a number (8085)


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

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

1 comment: