Mzsmunna
10/16/2019 - 9:31 AM

PROBLEM_3_TAKE_INPUT_UNTILL_PRESS_ENTER


.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB 'ENTER INPUT :$'
MSG2 DB 'PRINT VALUE:$'
MSG3 DB 'PROGRAM CLOSED$'
.CODE
MAIN PROC
    
 MOV AX,@DATA
 MOV DS,AX 

 L1: 

 LEA DX,MSG1
 MOV AH,9
 INT 21H

 MOV AH,1
 INT 21H
 MOV BL,AL 
 
 CMP BL,0DH
 JE EXIT


 MOV AH,2
 MOV DL,0DH
 INT 21H
 MOV DL,0AH
 INT 21H 
 
 LEA DX,MSG2
 MOV AH,9
 INT 21H


 MOV AH,2
 MOV DL,BL
 INT 21H


 MOV AH,2
 MOV DL,0DH
 INT 21H
 MOV DL,0AH
 INT 21H


 

 JNE L1

 EXIT: 
 
 MOV AH,2
 MOV DL,0DH
 INT 21H
 MOV DL,0AH
 INT 21H 
 
 LEA DX,MSG3
 MOV AH,9
 INT 21H


 MOV AH,4CH
 INT 21H
 MAIN ENDP
 END MAIN