-
Notifications
You must be signed in to change notification settings - Fork 1
/
13. PRINT AND BEEP.asm
86 lines (68 loc) · 1.56 KB
/
13. PRINT AND BEEP.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
; THIS SIMPLE PROGRAM READ THREE VALUE A PRINT THEM IN THE MIDDLE OF
; 11x11 BOS OF ASTERISKS
; THE BEEP THE COMPUTER
; SUPPOSE THE INITIALS ARE A A T
; THE THE OUTPUT WILL BE
; ***********
; ***********
; ***********
; ***********
; ***********
; *** AAT ***
; ***********
; ***********
; ***********
; ***********
; ***********
.MODEL SMALL
.DATA
MSG DB "ENTER THE INITIALS", 0AH, 0DH, '$'
STARS DB '***********', 0AH, 0DH, '$'
MID DB "*** "
C1 DB ?
C2 DB ?
C3 DB ?, ' ***', 0AH, 0DH, "$"
.CODE
MAIN PROC
; INITIALIZE DATA SEGMENT
MOV AX, @DATA
MOV DS, AX
; PRINT THE MESSAGE
LEA DX, MSG
MOV AH, 9
INT 21H
; TAKE INPUT
MOV AH, 1
INT 21H
MOV C1, AL
INT 21H
MOV C2, AL
INT 21H
MOV C3, AL
; CARRIAGE RETURN TO CURRENT LINE
MOV AH, 2
MOV DL, 0DH
INT 21H
; DISPLAY FIRST 5 LINES OF ASTERISKS
MOV AH, 9
LEA DX, STARS
INT 21H
INT 21H
INT 21H
INT 21H
INT 21H
; PRINT THE MID VALUE
LEA DX, MID
INT 21H
; DISPLAY SECOND 5 LINES OF ASTERISKS
LEA DX, STARS
INT 21H
INT 21H
INT 21H
INT 21H
INT 21H
; DOS EXIT
MOV AH, 4CH
INT 21H
MAIN ENDP
END MAIN