0% found this document useful (0 votes)
10 views18 pages

Micro Project Report Title: Convert Lowercase String Into Uppercase String

This micro project report details the development of a program that converts a lowercase string into its uppercase equivalent using Intel x86 assembly language. The project emphasizes efficient string manipulation techniques, in-place conversion, and direct interaction with the microprocessor. It also discusses the advantages and disadvantages of using assembly language for such tasks, concluding that while it offers performance benefits, it introduces complexity and reduced readability.

Uploaded by

sanikakabade07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views18 pages

Micro Project Report Title: Convert Lowercase String Into Uppercase String

This micro project report details the development of a program that converts a lowercase string into its uppercase equivalent using Intel x86 assembly language. The project emphasizes efficient string manipulation techniques, in-place conversion, and direct interaction with the microprocessor. It also discusses the advantages and disadvantages of using assembly language for such tasks, concluding that while it offers performance benefits, it introduces complexity and reduced readability.

Uploaded by

sanikakabade07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Convert Lowercase String into Uppercase String

Micro Project Report

Title: Convert Lowercase String into Uppercase String

1. Introduction

In the realm of microprocessor programming, understanding fundamental string manipulation


and character conversion is essential. This micro project focuses on creating a program that takes
a lowercase string as input and transforms it into its uppercase equivalent. By delving into this
project, participants can gain insights into low-level language programming, string manipulation
techniques, and the intricacies of character conversions.

1.1 Overview:

The primary objective of this microproject is to design and implement a microprocessor program
that takes a string as input, processes each character, and outputs the converted string in
uppercase. The program employs the Intel x86 assembly language to interact directly with the
microprocessor, providing a closer link to the hardware for enhanced efficiency.

1.2 Key Features:

• String Conversion: The program focuses on converting a string's characters from


lowercase to uppercase. It does so by adjusting the ASCII values of the characters.
• Efficient Assembly Code: The microproject utilizes assembly language to write efficient
and compact code, allowing for direct manipulation of the microprocessor's registers and
memory.
• In-Place Conversion: The string conversion is performed in-place, meaning the converted
string overwrites the original string's memory, saving space and resources.

1
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

1.3 Technical Implementation:

• Programming Language: The micro project can be implemented using a low-level


language such as Assembly or a higher-level language compatible with the specific
microprocessor architecture.
• String Manipulation: Utilize string manipulation techniques to iterate through each
character of the input string and perform the case conversion.
• Conditional Statements: Implement conditional statements to check the case of each
character and apply the conversion as needed.
• User Interaction: Incorporate input/output instructions for user interaction, allowing users
to input a string and view the converted output.

2
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

2. Requirement Specification

Sr.no Name of Material Specifications Quantity Remarks

1 Desktop Computer with Windows 11, RAM 8GB 1 Yes


required specifications. Processor-Intel (i) core i5
2 software DOSBOX TASM 1.4 Software 1 Yes

3 Browser Chrome - Yes

4 Website 1. https://chat.openai.com/ - Yes


2. https://bard.google.com/?utm_so
urce=sem&utm_medium=paid-
media&utm_campaign=q3enIN
_sem6

5 Reference Microprocessor 8086 1 Yes

3
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

3. System Design

The system design for the micro project involves breaking down the functionality into modular
components that work cohesively to achieve the conversion of a lowercase string to an uppercase
string. The primary modules include input handling, conversion logic, and output display.

3.1 Architecture Design

1. Input Handling Module:


• Responsibility: Responsible for obtaining the lowercase string input from the user.
• Implementation: Utilizes input/output instructions specific to the microprocessor
architecture to prompt the user for input and stores the input string in memory.

2. Conversion Logic Module:


• Responsibility: Implements the conversion logic to transform each lowercase character
to its corresponding uppercase form.
• Implementation: Utilizes string manipulation techniques, conditional statements, and
microprocessor-specific instructions to iterate through the input string, check the case of
each character, and apply the conversion as needed

3. Output Display Module:


• Responsibility: Displays the resulting uppercase string as the output.
• Implementation: Utilizes output instructions specific to the microprocessor to display the
converted uppercase string to the user.

4. Main Program Module:


• Responsibility: Orchestrates the flow of the program by coordinating the execution of the
input handling, conversion logic, and output display modules.
• Implementation: Contains the main program logic, including calls to subroutines for input
handling, conversion logic, and output display.

4
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

3.2 Flow of Execution

Start

Data Initialization Check if Char = '$'


STR1 = 16 zeros If yes, Exit Loop
STR2 = uninitialized If no, Convert

Code Initialization
Convert Char
Set DS, Load AX
Subtract 32 from AL
with base of DATA
Store result in DI

Index Initialization
Load SI with LEA STR1 Increment SI and DI
Load DI with LEA STR2 Go back to Check

String Copy and Exit Loop


Convert Loop Infinite Loop

End

5
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

4. Algorithm

A step-by-step algorithm for Convert Lowercase String into Uppercase String. This algorithm
outlines the core functionality of the program.

Step 1. Initialize Data Segment:


• Define two arrays, STR1 and STR2, of 16 bytes each.
• Set STR1 with 16 zeros and leave STR2 uninitialized.

Step 2. Initialize Code Segment:


• Set the data and code segments using ASSUME DS: DATA, CS: CODE.
• Load the base address of the data segment into the AX register.
• Set the data segment register (DS) to the loaded value.

Step 3. Initialize Indices:

• Load the effective address of STR1 into the source index register (SI).
• Load the effective address of STR2 into the destination index register (DI).

Step 4. String Copy and Convert Loop:

• Start a loop labeled as UP.


• Load a byte from the source string (STR1) into the AL register.
• Compare the loaded byte with the ASCII value of '$'.
• If the byte is '$', jump to the EXIT label.
• If not '$', subtract 32 from the ASCII value to convert lowercase letters to uppercase.
• Store the result in the destination string (STR2).
• Increment the source and destination indices.
• Jump back to the beginning of the loop.

6
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

Step 5. Exit Loop:

• The EXIT label is reached when the '$' character is encountered in the source string.
• Jump to an infinite loop (JMP EXIT), preventing further execution.

Step 6. End of Code and Data Segment:

• Mark the end of the code segment (CODE ENDS).


• End the program (END).

7
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

5.Program Code

DATA SEGMENT
STR1 DB 16 DUP (0)
STR2 DB 16 DUP (?)
DATA ENDS

CODE SEGMENT
ASSUME DS: DATA, CS: CODE

MAIN: MOV AX, DATA


MOV DS, AX
LEA SI, STR1
LEA DI, STR2

UP: MOV AL, [SI]


CMP AL, '$'
JZ EXIT
SUB AL, 32
MOV [DI], AL
INC SI
INC DI
JMP UP

EXIT: JMP EXIT


CODE ENDS
END

8
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

6. Explanation of Program Code

1. Data Segment:
• STR1 and STR2 are defined as arrays of 16 bytes each.
• STR1 is initialized with 16 zeros.
• STR2 is uninitialized (? means uninitialized).

DATA SEGMENT
STR1 DB 16 DUP(0)
STR2 DB 16 DUP(?)
DATA ENDS

2. Code Segment:
• The ASSUME DS:DATA, CS:CODE directive sets the data and code segments.
• MOV AX, DATA loads the base address of the data segment into the AX register.
• MOV DS, AX sets the data segment register to the loaded value.

CODE SEGMENT
ASSUME DS: DATA, CS: CODE
MAIN: MOV AX, DATA
MOV DS, AX

3. String Copy Loop:


• LEA SI, STR1 loads the effective address of STR1 into the source index register (SI).
• LEA DI, STR2 loads the effective address of STR2 into the destination index register
(DI).

LEA SI, STR1


LEA DI, STR2

4. Character Conversion Loop:


• The loop labeled UP begins.
• MOV AL, [SI] loads a byte from the source string (STR1) into the AL register.
• CMP AL, '$' compares the loaded byte with the ASCII value of '$'.
9
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

• JZ EXIT jumps to the EXIT label if the byte is '$'.


• If not '$', the program continues to convert the character.
• SUB AL, 32 subtracts 32 from the ASCII value, converting lowercase letters to
uppercase.
• MOV [DI], AL stores the result in the destination string (STR2).
• INC SI and INC DI increment the source and destination indices.
• JMP UP jumps back to the beginning of the loop.

UP: MOV AL, [SI]


CMP AL, '$'
JZ EXIT
SUB AL, 32
MOV [DI], AL
INC SI
INC DI
JMP UP

5. Exit Loop:
• The EXIT label is reached when the '$' character is encountered in the source string.
• JMP EXIT is an infinite loop that prevents the program from executing any further.

EXIT: JMP EXIT

6. Code and Data Segment End:


• CODE ENDS marks the end of the code segment.
• END indicates the end of the program.

CODE ENDS
END

10
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

7. Implementation
7.1 Output of the program code

11
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

8. Advantages

Efficiency: Assembly language allows for precise control over the hardware, making it highly
efficient in terms of execution speed and resource utilization.

Low-Level Operations: Assembly language provides a closer representation of the computer's


architecture, enabling programmers to perform low-level operations and optimizations.

Direct Memory Access: The code directly manipulates memory addresses, which can be
advantageous for tasks requiring direct access to specific locations in memory.

Compact Code: Assembly code is often more compact than equivalent high-level language
code, leading to smaller executable files.

Portability: Assembly code can be relatively portable across different platforms, especially if
care is taken to use platform-independent instructions. However, this portability is limited
compared to high-level languages.

12
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

9. Disadvantages

Complexity: Writing assembly code is complex and requires a deep understanding of the
hardware architecture. This complexity increases the likelihood of errors and makes code
maintenance challenging.

Readability and Maintainability: Assembly code is generally less readable and harder to
maintain than code written in high-level languages. This can lead to difficulties in understanding
and updating the code.

Platform Dependence: While assembly code can be relatively portable, it is still highly
dependent on the specific architecture and instruction set of the target platform. Porting code
between different architectures may require significant modifications.

Lack of Abstraction: Assembly language lacks the abstractions provided by high-level


languages, making certain programming tasks more laborious and error-prone.

Development Time: Writing assembly code is time-consuming compared to high-level


languages. This increased development time can be a significant drawback, especially for
projects with tight deadlines.

Limited High-Level Constructs: Assembly language lacks high-level constructs like functions,
classes, and data structures, which can hinder code organization and modularity.

13
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

10. Conclusion: -

In conclusion, this microproject successfully addressed the task of converting a lowercase string
to uppercase using assembly language for a microprocessor. The program efficiently utilizes low-
level operations to manipulate the ASCII values of characters, showcasing the advantages of
assembly language in terms of speed and resource utilization.

The in-place conversion feature adds to the program's effectiveness by overwriting the original
string's memory, saving space and resources. The use of efficient assembly code allows for direct
interaction with the microprocessor's registers and memory, contributing to a compact and
streamlined solution.

While assembly language provides a powerful means to control hardware and optimize
performance, it comes with challenges such as complexity and reduced readability. However, for
specific tasks that demand direct hardware interaction, as demonstrated in this microproject,
assembly language proves to be a valuable tool.

In future developments or projects, considerations for code readability and maintainability could
be explored, potentially utilizing high-level languages with well-defined abstractions.
Nevertheless, this microproject successfully fulfills its objectives, providing a functional and
efficient solution for converting lowercase strings to uppercase in a microprocessor environment.

14
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

11. Reference: -

1. DOSBOX TASM 1.4 Documentation and Resources


2. https://chat.openai.com/
3. https://bard.google.com/?utm_source=sem&utm_medium=paid-
media&utm_campaign=q3enIN_sem6
4. Guided by Mrs. M. M. Babar

15
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String

Project Diary

BY

Ms. Tasmiya Firoj Nadaf 25034


Ms. Vedika Mahesh Nagarkar 25035
Ms. Varsha Sanjay Nimbalkar 25036
Ms. Samedha Adinath Patil 25037

Students
Sr.no Date Work done Hours Guide sign
sign
1. 8-1-24 At first, we made the 15 min
group of 5 members.

2. 10-1-24 Searched Project 1 hour


Subject.

3. 12-1-24 We took suggestions 15 min


from our guide for
selecting our project

4. 15-1-24 After selection of 1 hour


project topic wise
searched the basic
information related to it

16
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String
5. 18-1-24 Then the collection of 1 hour
information was done. 30 min

6. 25-1-24 Later we visited to our 30 min


guide for suggesting us
some more information
on topic and some
corrections in collected
information.
7. 28-1-24 If there were some 1 hour
corrections then it was
corrected.

8. 3-2-24 After correcting it, we 30 min


again visited our guide
to show the corrections.

9. 10-2-24 Then we started 1 hour


searching some more
information on the topic
(for gaining some more
knowledge).

10. 12-2-24 We had a visit to our 30 min


guide after searching
some information.

11. 20-2-24 Some suggestions were 30 min


guided and we tried to
make it correct as per
the guide's requirement.

17
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String
12. 24-2-24 After making some 20 min
changes we again had a
visit to our guide.

13. 26-2-24 Then we started 1 hour


implementing it on the 30 min
required Software

14. 2-3-24 Then by that time, we 40 min


made the project report.

15. 15-3-24 We had visited to our 1 hour


guide to present our
project.

16. 20-3-24 Then we finally 1 hour


submitted our project
and project report till
this date.

18
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy