Google Search

Thursday, October 13, 2011

To write an assembly language program to calculate arithmetic mean of ‘N’ numbers.


ARITHMETIC MEAN OF ‘N’ NUMBERS

Aim: -   To write an assembly language program to calculate arithmetic mean of ‘N’ numbers.

                      MOV AX, DATA
                      MOV DS, AX
                      XOR AL, AL
                      LEA SI, NUM
                      MOV CX, 0005
                      MOV AH, 00
NEXT:        ADD AL, [SI]
                   INC SI
                   LOOP NEXT
                   MOV CL, 05
                   DIV CL
                   MOV SUM, AL
                    END

Result: Arithmetic mean of given ‘n’ numbers is obtained.

0 comments:

Post a Comment