.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB 'ENTER HEX:$'
MSG2 DB 'DECIMAL:$'
MSG3 DB 'WANT AGAIN(Y/y):$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,9
INT 21H
MOV AH,1
INT 21H
MOV CL,9
ADD CL,48
CMP AL,CL
JG L1
MOV DL,AL
MOV AH,2
INT 21H
JMP EXIT
L1:
MOV DL,49
MOV AH,2
INT 21H
CMP AL,'A'
JE L2
L2:
MOV DL,48
INT 21H
JMP EXIT
CMP AL,'B'
JE L3
L3:
MOV DL,49
INT 21H
JMP EXIT
CMP AL,'C'
JE L4
L4:
MOV DL,50
INT 21H
JMP EXIT
CMP AL,'D'
JE L5
L5:
MOV DL,51
INT 21H
JMP EXIT
CMP AL,'E'
JE L6
L6:
MOV DL,52
INT 21H
JMP EXIT
CMP AL,'F'
JE L7
L7:
MOV DL,53
INT 21H
JMP EXIT
EXIT:
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN