Objectives
-to learn how to get input from keyboard
-to learn how to input a letter
-to learn how to store a letter into a variable
-to learn how to covert a lowercase letter to uppercase
.MODEL SMALL
.STACK 100H
.DATA
CR EQU 0DH
LF EQU 0AH
MSG1 DB 'Enter a lower case letter: $'
MSG2 DB 0DH, 0AH,'In upper case it is: '
CHAR DB ?,'$'
.CODE
MAIN PROC
;initializing ds
MOV AX,@DATA
MOV DS,AX
;print user prompt
LEA DX,MSG1
MOV AH,9
INT 21H
;input a charater and convert to upper case
MOV AH,1
INT 21H
SUB AL,20H
MOV CHAR,AL
;display on the next line
LEA DX,MSG2
MOV AH,9
INT 21H
;dos exit
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
No comments:
Post a Comment