Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Adam’s Engineering College, Paloncha

ECE Department –MPI LAB

Experiment No.: 17 Year : III/IV B.Tech II Semester Page 1 of 2

ARITHMETIC MEAN OF ‘N’ NUMBERS

Aim: - To write an assembly language program to calculate


arithmetic mean of ‘N’ numbers.

Registers: - AX and CX

Description: - Calculating arithmetic mean of ‘N’ numbers


and the SUM is stored in AL.

Ports:- None.

DATA SEGMENT

NUM DB 05 DUP(00)
SUM DB ?

DATA ENDS

CODE SEGMENT

ASSUME CS: CODE, DS: DATA

START:
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
Lab in-charge HOD, ECE
Adam’s Engineering College, Paloncha
ECE Department –MPI LAB

Experiment No.: 17 Year : III/IV B.Tech II Semester Page 2 of 2

DIV CL
MOV SUM, AL

CODE ENDS
END START

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

Lab in-charge HOD, ECE

You might also like