-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAverage of 5 Numbers.asm
More file actions
63 lines (53 loc) · 1.06 KB
/
Average of 5 Numbers.asm
File metadata and controls
63 lines (53 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
INCLUDE io.h
cr EQU 0dh
lf EQU 0ah
DATA SEGMENT
prompt1 DB cr,lf,'Enter the 1st Number :',0
prompt2 DB cr,lf,'Enter the 2nd Number :',0
prompt3 DB cr,lf,'Enter the 3rd Number :',0
prompt4 DB cr,lf,'Enter the 4th Number :',0
prompt5 DB cr,lf,'Enter the 5th Number :',0
summ DW ?
d DW 5
sum DW 10 dup(?)
values DW 10 dup(?)
label2 DB cr,lf,'the Sum of the 5 Numbers is:',0
label3 DB cr,lf,'the Average of the 5 Numbers is:',0
DATA ENDS
CODE SEGMENT
ASSUME cs:CODE, ds:DATA
START: MOV ax, data
MOV ds, ax
output prompt1
inputs values,10
atoi values
add summ,ax
output prompt2
inputs values,10
atoi values
add summ,ax
output prompt3
inputs values,10
atoi values
add summ,ax
output prompt4
inputs values,10
atoi values
add summ,ax
output prompt5
inputs values,10
atoi values
add summ,ax
mov ax,summ
itoa sum,ax
output label2
output sum
cwd
div d
itoa sum,ax
output label3
output sum
quit: mov ah,4ch
int 21h
CODE ENDS
END START