You are on page 1of 12

Convert Lower Case String into Upper Case String

1. INTRODUCTION

To convert from lowercase to uppercase, we subtract 32 from the ASCII code of the
lowercase letter to obtain the ASCII code of the corresponding uppercase letter. The number
32 is obtained by subtracting the ASCII code for 'A' from the ASCII code for 'a' (i.e. 'A' - 'a' =
97 - 65 = 32).
The to Upper Case () method converts a string to upper case letters. Note: The to Lower Case
() method converts a string to lower case letters.
Upper () method returns the uppercase string from the given string. It converts all lowercase
characters to uppercase. If no lowercase characters exist, it returns the original string.
Upper and u case are equivalent string manipulation functions that manipulate character
string data and convert lowercase characters in a string to uppercase.
The topper () function converts the lowercase letter c to the corresponding uppercase letter. Both
functions return the converted character. If the character c does not have a corresponding lowercase or
uppercase character, the functions return c unchanged.

1
Convert Lower Case String into Upper Case String

2. COURSE OUTCOME

 Write assembly language program for the given problem.


 Use instructions for different addressing modes.
 Develop an assembly language program using assembler.
 Develop an assembly language program using procedure, macro and modular
programming approach.

2
Convert Lower Case String into Upper Case String

3. LITERATURE REVIEW

The 8086 (also called APX 86) is a 16-bit microprocessor chip designed by Intel
between early 1976 and June 8, 1978, when it was released. The Intel 8088,
released July 1, 1979, is a slightly modified chip with an external 8-bit data bus
(allowing the use of cheaper and fewer supporting ICs, and is notable as the
processor used in the original IBM PC design, including the widespread version
called IBM PC XT.

The different ways in which a source operand is denoted in an instruction is


known as addressing modes.
There are 8 different addressing modes in 8086 programming-
Immediate addressing modes, Register addressing mode, Base addressing mode,
Indexed addressing mode, Based-index addressing mode, Based indexed with
displacement mode

A string is a data type used in programming, such as an integer and floating point
unit, but is used to represent text rather than numbers.
There are so many application of this project as it uses in case sensitive filling
applications.

The 8086 microprocessor support 8 types of instructions-

 Data Transfer Instruction


 Arithmetic Instruction
 Bit Manipulation Instruction
 String Instruction
 Program Execution Transfer Instructions (Branch & Loop Instruction )
 Processor Control Instruction
 Iteration Control Instruction
 Interrupt Instruction

3
Convert Lower Case String into Upper Case String

4. ACTUAL RESOURCES USED

a. WORKING

 To convert a character from lowercase to uppercase in assembly language, you can


use the ASCII table to add the difference between uppercase and lowercase letters to
the ASCII code of the lowercase letter. In ASCII, uppercase letters have a smaller
code than their lowercase counterparts, so adding the difference will result in the
uppercase letter. Here is an example code in x86 Assembly Language to read in a
lowercase letter and convert it to uppercase.
 The toupper() function takes just a single parameter, the character to be converted from
lowercase to uppercase. The ASCII value of the character is passed to the toupper() function.
int toupper(int c); Here c is the character to be converted from lowercase to uppercase.

4
Convert Lower Case String into Upper Case String

b. ALGORITHM

Step 1 : Initialize data segment


Step 2 : Initialize memory pointers for source and destination
Step 3 : Read character from source memory
Step 4 : If end of string then go to step 9
Step 5 : Convert from lower to upper case
Step 6 : Store into destination memory
Step 7 : Increment memory pointers by 1
Step 8 : Go to step 3
Step 9 : Stop

5
Convert Lower Case String into Upper Case String

c. FLOWCHART

6
Convert Lower Case String into Upper Case String

d. CODING

data segment
lowercase db 'welcome $'
uppercase db 0ah dup(0)
data ends

code segment
assume cs:code,ds:data
mov ax,data
mov ds,ax
lea si,lowercase
lea di,uppercase
up:mov al,[si]
cmp al,"$"
JE Exit
sub al,20h
mov [di],al
inc si
inc di
jmp up
Exit:int 03h
code ends
end

7
Convert Lower Case String into Upper Case String

5. ACTUAL RESOURCES USED

Sr. No Hardware specification Specification

1. Processor Ryzen 5
2. Random access Memory(RAM) 16 GB(Minimum)
3. Hard Drive (HDD) 512GB

Sr. No Software specification Specification

1. Operating system Windows


2. Software Dos box
3. Language used Assembly language program

8
Convert Lower Case String into Upper Case String

6. OUTPUT

9
Convert Lower Case String into Upper Case

7. CONCLUSION

 If we see the ASCII character set of all the alphabet we will find that there is a difference
of 20H between lower case and upper case.
 So to convert character from lower case to upper case, simply subtract 20H from the ASCII
of lower case character and to convert character from upper case to lower case, simply add
20H to the ASCII of upper case character.

1
Convert Lower Case String into Upper Case

8. FUTURE SCOPE

 Lowercase letters are used for common nouns and for every letter after the initial letter
of the first word of a sentence.

 Uppercase letters are most often used at the start of sentences and as the first letter of
proper nouns, though there are other times to use the capital letter form too.

 This program is designed to convert the lowercase string to upper case string. We can
easily convert the given lowercase string uppercase string. Sometimes this is necessary
to convert the cases of any string in a particular application for some purpose or for some
sensitive use.

1
Convert Lower Case String into Upper Case

9. REFERENCE

 https://www.studocu.com/in/document/vardhaman-mahaveer-open-university/web-
designcybersecurity/lower-case-to-upper-case-mic/38265241
 0https://prowritingaid.com/lowercase-uppercase-letters
 https://people.vts.su.ac.rs/~pmiki/ASM_old/ASM%20zbirka/asm/alp4.pdf

You might also like