-
Notifications
You must be signed in to change notification settings - Fork 0
/
VARIABLE_INPUT_OUTPUT.asm
62 lines (42 loc) · 1.01 KB
/
VARIABLE_INPUT_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
.MODEL SMALL
.STACK 100H
.DATA
;this is for data segment, variable declare here
;DB FOR DEFINE BYTE 8 BITS REG
;DW FOR DEFINE WORD 16 BITS REG
NUM1 DB 49 ;49 mean 1
CHAR DB 'A' ; FOR CHARACTER WE USE ''
MSG1 DB "My Name is LEON $"
.CODE
;THIS is CODE segment
MAIN PROC
;LIKE INT MAIN
MOV AX,@DATA ;load data segment
MOV DS,AX ; load Data to DataSource Regsister
MOV AH,2 ;FOR OUTPUT
MOV DL, NUM1 ; VALUE STORE IN OUTPUT REGSISTER DL
INT 21H
;FOR NEW LINE PRINT
MOV AH,2
MOV DL, 0AH
INT 21H
MOV DL, 0DH
INT 21H
;CHAR PRINT
MOV AH,2
MOV DL,CHAR
INT 21H
;FOR NEW LINE PRINT
MOV AH,2
MOV DL, 0AH
INT 21H
MOV DL, 0DH
INT 21H
;MSG PRINT
MOV AH,9 ;9 FOR STRING TYPE CONSOLE
LEA DX,MSG1 ;LEA FOR STRING OUTPUT
INT 21H
MOV AH,4CH
INT 21H
MAIN ENDP ;MAIN PROC END
END MAIN ; CODE END