so I have a program that converts two digit hexadecimal number to decimal number. I need to make it so you can enter digits from 0...9 and letter a...f and A...F as for now it converts lowercase letters to uppercase with line " SUB DL,32H " but it also changes the value of uppercase letters. How could it be fixed and the input restricted to only a...f, A...F and 0...9?
#MAKE_EXE#
DSEG SEGMENT 'DATA'
MSG DB 'Enter a two-digit hexadecimal number: $'
DSEG ENDS
SSEG SEGMENT STACK 'STACK'
DW 100h DUP(?)
SSEG ENDS
CSEG SEGMENT 'CODE'
;*******************************************
START PROC FAR
PUSH DS
MOV AX, 0
PUSH AX
MOV AX, DSEG
MOV DS, AX
MOV AH,09h
MOV DX, OFFSET MSG
INT 21h
XOR AX,AX
MOV AH,1H
INT 21H
MOV DL,AL
SUB DL,30H
CMP DL,9H
JLE M1
SUB DL,7H
SUB DL,32H
M1:
MOV CL,4H
SHL DL,CL
INT 21H
SUB AL,30H
CMP AL,9H
JLE M2
SUB AL,7H
M2:
ADD DL,AL
RET
START ENDP
;*******************************************
CSEG ENDS
END START