Friday, November 14, 2014

To convert a upper case letter to lower case


The assembly language program given below is a program for case conversion. The program is capable to convert a uppercase letter to lowercase. For example after running the program, it will ask to provide an uppercase letter. When you will input an uppercase letter using keyboard, then the program will convert the uppercase letter to lowercase immediately. This is the basic operation of the given program.

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 uppercase letter to lowercase
case conversion program,assembly programming,assembly language,lower level programming
.MODEL SMALL
.STACK 100H
.DATA
CR EQU 0DH
LF EQU 0AH

MSG1 DB 'Enter a upper case letter: $'
MSG2 DB 0DH, 0AH,'In lower 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
ADD 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