The DATA SEGMENT
MSG DB 'INPUT ERROR', 0 dh, 0 ah, '$'
WORD1 DB 'The uppercase is',' $'
WORD2 DB 'The lowercase is',' $'
The DATA ENDS
CODE SEGMENT
ASSUME the DS: DATA, CS: CODE
START:
MOV AX, DATA
MOV DS, AX
MOV AH, 01 h
INT 21 h
CMP AL, 'A'
JB ERR
CMP AL, 'Z'
JA ONE
The ADD AL, 20 h
MOV DX, OFFSET WORD2
MOV AH, 09 h
INT 21 h
JMP TWO
ONE: CMP AL, 'a'
JB ERR
CMP AL, 'z'
JA ERR
SUB AL, 20 h
MOV DX, OFFSET WORD1
MOV AH, 09 h
INT 21 h
JMP TWO
TWO: MOV DL, AL
MOV AH, 02 h
INT 21 h
JMP EXIT
ERR: MOV DL, 0 ah
MOV AH, 02 h
INT 21 h
Dh MOV DL, 0
MOV AH, 02 h
INT 21 h
MOV DX, OFFSET MSG
MOV AH, 09 h
INT 21 h
EXIT: MOV AH, 4 ch
INT 21 h
CODE ENDS
The END START