Micro Project Report Title: Convert Lowercase String Into Uppercase String
Micro Project Report Title: Convert Lowercase String Into Uppercase String
1. Introduction
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
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String
2
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String
2. Requirement Specification
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.
4
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String
Start
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
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.
• Load the effective address of STR1 into the source index register (SI).
• Load the effective address of STR2 into the destination index register (DI).
6
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String
• The EXIT label is reached when the '$' character is encountered in the source string.
• Jump to an infinite loop (JMP EXIT), preventing further execution.
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
8
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String
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
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.
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.
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.
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: -
15
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV
Convert Lowercase String into Uppercase String
Project Diary
BY
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.
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
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.
18
SHARAD INSTITUTE OF TECHNOLOGY, POLYTECHNIC YADRAV