.MODEL SMALL
.DATA
VALIN DB 4 dup(' '),'$'
NL DB 0DH,0AH,'NAME:','$'
TAB_LEN EQU 9
TAB_NO EQU 2
TAB_DESC EQU 7
NB DB 0DH,0AH,'OOPS NO MATCH','$'
STUD_TBL DB '18','PINKY'
DB '20','ASHISH'
DB '21','TANMAY'
DB '29','POOJAN'
DB '39','SIYA'
DB '40','NISHA'
DB '42','JIGNA'
DB '53','POOJA'
DB '56','NEEL'
DB '58','DHAVAL'
STR1 DB 8 DUP(' '),'$'
NL1 DB 'ENTER NO:','$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
MOV ES,AX
LEA DI,VALIN
LEA DX,NL1
MOV AH,09H
INT 21H
AGAIN:
MOV AH,01H
INT 21H
CMP AL,0DH
JE LBL1
MOV [DI],AL
INC DI
JMP AGAIN
LBL1:
MOV AL,'$'
MOV [DI],AL
LEA DI,STUD_TBL
CLD
LBL2:
MOV CX,2
LEA SI,VALIN
REPE CMPSB
JE LBL3
JB LBL5
ADD DI,CX
ADD DI,TAB_DESC
JMP LBL2
LBL3:
MOV AH,09H
LEA DX,NL
INT 21H
MOV DX,00
ADD DI,CX
LEA SI,STR1
MOV CX,7
DISPLAY:
MOV AL,[DI]
MOV [SI],AL
INC SI
INC DI
LOOP DISPLAY
LBL4:
LEA DX,STR1
MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H
LBL5:
MOV AH,09H
LEA DX,NB
INT 21H
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
OUTPUT
***********
ENTER NO:02
OOPS NO MATCH
C:\tasm>ex02
ENTER NO:21
NAME:abc
C:\tasm>ex02
ENTER NO:20
NAME:xyz