0% found this document useful (0 votes)
62 views1 page

Cse 316 (Lab - 2) Case Conversion Program

This program takes a lowercase letter as input from the user, converts it to uppercase, and displays the uppercase letter. It prints a prompt asking the user to enter a lowercase letter. It then reads the character, subtracts 32 to convert it to uppercase (ASCII difference between cases), stores it, and displays a message saying the uppercase form of the input letter.

Uploaded by

Mehedi Al Masum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views1 page

Cse 316 (Lab - 2) Case Conversion Program

This program takes a lowercase letter as input from the user, converts it to uppercase, and displays the uppercase letter. It prints a prompt asking the user to enter a lowercase letter. It then reads the character, subtracts 32 to convert it to uppercase (ASCII difference between cases), stores it, and displays a message saying the uppercase form of the input letter.

Uploaded by

Mehedi Al Masum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

CSE 316 (Lab -2) CASE CONVERSION PROGRAM

TITLE PGM4_3: CASE CONVERSION PROGRAM


.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
;initialize DS
MOV AX,@DATA ;get data segment
MOV DS,AX ;initialize DS
;print user prompt
LEA DX,MSG1 ;get first message
MOV AH,9 ;display string function
INT 21H ;display first message
;input a character and convert to upper case
MOV AH,1 ;read character function
INT 21H ;read a small letter into AL
SUB AL, 20H ;convert it to upper case
MOV CHAR,AL ;and store it
;display on the next line
LEA DX, MSG2 ;get second message
MOV AH,9 ;display string function
INT 21H ;display message and upper case
letter
;DOS exit
MOV AH,4CH
INT 21H ;DOS exit
MAIN ENDP
END MAIN

You might also like