-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment Table.asm
107 lines (70 loc) · 1.32 KB
/
Assignment Table.asm
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
.model small
.data
value dw "Enter the value : $ "
nline dw 0AH,0DH,"$"
print1 dw " X $"
print2 dw " = $"
table db 01,02,03,04,05,06,07,08,09,10
num db ?
.code
main proc
mov AX,@data
mov DS,AX
mov dx, offset value
mov ah,09
int 21h
mov ah,01
int 21h
mov num,al
mov bl,al
sub bl,30h
mov cx,0Ah
mov SI,offset table
M:
call newline
call number
call print
mov AX,0h
mov DX,0h
mov AL,[SI]
INC SI
MUL BL
AAM
mov DL,AH
mov BH,AL
ADD DL,30h
MOV AH,02
INT 21h
mov DL,BH
ADD DL,30h
MOV AH,02
INT 21h
loop M
newline:
mov dx, offset nline
mov ah,09
int 21h
ret
number:
mov dl,num
mov ah,02
int 21h
ret
print:
mov dx, offset print1
mov ah,09
int 21h
mov dl,[SI]
add dl,30h
mov ah,02
int 21h
mov dx, offset print2
mov ah,09
int 21h
ret
main endp
end main
ret