-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtaking input and displaying.asm
More file actions
46 lines (32 loc) · 1.25 KB
/
taking input and displaying.asm
File metadata and controls
46 lines (32 loc) · 1.25 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
TITLE TAKING_SINGLE_CHARACTER_AND_DISPLAYING_IT
.MODEL SMALL
.STACK 100H
.DATA
MSG DB "Goodbye you sacrilegious sack of shit!$"
.CODE
MAIN PROC
MOV AX, @DATA ;initializing DS
MOV DS, AX
MOV AH, 1 ;single character input
INT 021H ;take input
MOV BL, AL ;the input from keyboard is stored in AL, we temporarily
;store it in BL
MOV AH, 2 ;%%%% line 16 to 20 is for a new line
MOV DL, 0DH
INT 021H
MOV DL, 0AH
INT 021H
MOV DL, BL ;get the stored info from BL to DL
INT 021H ;display that shit
MOV AH, 2 ;NEWLINE
MOV DL, 0DH
INT 021H
MOV DL, 0AH
INT 021H
LEA DX, MSG ;getting the fucking message
MOV AH, 9 ;function for displaying a string
INT 021H ;and the display
MOV AH, 04CH ;if anyone cares, this code returns control to DOS, i.e the OS
INT 021H
MAIN ENDP
END MAIN