CSEG segment ASSUME CS CSEG ES CSEG DS CSEG SS CSEG org 100h _start mo

 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
CSEG segment
ASSUME CS:CSEG, ES:CSEG, DS:CSEG, SS:CSEG
org 100h
_start:
mov dx, offset msg_key
call PRINTER
mov ah, 10h
int 16h
cmp al, 'Y'
jz _EXIT
mov dx, offset msg_noexit
call PRINTER
int 20h
PRINTER proc
mov ah, 9
int 21h
PRINTER endp
_EXIT:
mov dx, offset msg_exit
call PRINTER
int 20h
msg_key DB 'Press key "y" for exit$'
msg_exit DB 0Dh, 0Ah, 'Exit!$'
msg_noexit DB 0Dh, 0Ah, 'No exit...$'
CSEG ends
end _start