DATE SEGMENT
HELLO DB 'HELLO,WORLD!$'
DATE ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATE
STAST:
MOV AX,DATE
MOV DS,AX
SUB AX,AX
lp:
MOV AH,7
INT 21h
CMP AL,41h
JNE Q
MOV AH,9
MOV DX,OFFSET HELLO
INT 21h
jmp lp
Q:
MOV AH,4Ch
INT 21h
CODE ENDS
END STAST
DATA SEGMENT
szHELLO DB 'HELLO,WORLD!$'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
SUB AX,AX
lp:
MOV AH,7
INT 21h
CMP AL,'A'
JNE Quit
MOV AH,9
MOV DX,OFFSET szHELLO
INT 21h
jmp lp
Quit:
MOV AH,4Ch
INT 21h
CODE ENDS
END START