-
Notifications
You must be signed in to change notification settings - Fork 1
/
Letter_Output.asm
80 lines (72 loc) · 1.16 KB
/
Letter_Output.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
.model small
.stack 100h
.data
msg1 db "Welcome User!!$"
msg2 db 0dh,0ah,"Enter Letter 1: $"
msg3 db 0dh,0ah,"Enter Letter 2: $"
msg4 db 0dh,0ah,"Enter Letter 3: $"
msg5 db 0dh,0ah,"Output: ",0dh,0ah,'$'
l1 db '$'
l2 db '$'
l3 db '$'
.code
main proc
mov ax,@data
mov ds,ax ;initialize ds
;display msg1
lea dx,msg1
mov ah,9
int 21h
;display msg2
lea dx,msg2
mov ah,9
int 21h
mov ah,1
int 21h
mov l1,al ;store the value on l1
;display msg3
lea dx,msg3
mov ah,9
int 21h
mov ah,1
int 21h
mov l2,al ;store the value on l2
;display msg4
lea dx,msg4
mov ah,9
int 21h
mov ah,1
int 21h
mov l3,al ;store the value on l3
call task
task:
;for output
lea dx,msg5
mov ah,9
int 21h
;output letter1
mov dl,l1
mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
;output letter2
mov dl,l2
mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
;output letter3
mov dl,l3
mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
main endp
end main