PROGRAM TO COUNT NUMBER OF 1s IN REGISTER A

MVI C,00H           ;COUNTER FOR 1
MVI B, 8               ;DOWN COUNTER
                                ;FOR 8-BIT REGISTER A
UP: RAL
JNC PASS
INR C
PASS: DCR B
JNZ UP

HLT

No comments:

Post a Comment