ASSUME CS:CODE,DS:DATA
DATA SEGMENT
ORG 2000H
INPUT DB “ENTER THE STRING”,0DH,0AH,“$”
OUTPUT DB “THE ENTERED STRING IS:” ,0DH,0AH,“$”
S_LENTH DB 0
BUFFER DB 80 DUP(0)
DATA ENDS
CODE SEGMENT
START: MOV AX,DATA
MOV DS,AX
XOR CL,CL
LEA DX,INPUT
MOV AH,09H
INT 21H
LEA BX,BUFFER
REPEAT: MOV AH,01H
INT 21H
CMP AL,0DH
JZ EXIT
INC CL
MOV [BX],AL
INC BX
JMP REPEAT
EXIT: MOV S_LENTH,CL
LEA BX,BUFFER
ADD BL,CL
MOV AL,’$’
MOV [BX],AL
LEA DX,OUTPUT
MOV AH,09H
INT 21H
LEA DX,BUFFER
MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END START
you can display message on screen by entering the program name and by pressing enter
No comments:
Post a Comment