Advertisements
Advertisements
प्रश्न
Write an Assembly Language Program to count the number of 1’s data byte stored at memory location C030H. Store the count at memory location C031H.
कोड लेखन
Advertisements
उत्तर
Label Mnimonics/Operands Comments/Remarks
START LDA C030H ; Load accumulator by operand
MVI C, 08H ; Initialize counter C by 08H
MVI E, 00H ; Initialize counter E by 00H
UP RRC ; Check for one
JNC SKIP ; Is digit is zero, SKIP does not increment count
INR E ; Is digit 1 increment count
SKIP DCR C ; Decrement counter C by 1
JNZ UP ; is not zero, repeat
MOV A, E
STA C031H
HLT ; Stop.shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
