MIC MICRO PROJECT[1]-1
MIC MICRO PROJECT[1]-1
EDUCATION
MICRO PROJECT
NAVJEEVAN POLYTECHNIC
BHANDUP [W]
GROUP DETAILS
SR. Name of Group Roll Enrollment
Seat no
NO Members no No
1. Shree Pawar 1259 24111050217
Manali Patil
Weekly Progress Report(Action Plan) Micro-Project:-
Topic: String Manipulation Project.
Academic Year: 2024-2025 Name of Faculty: Manali Patil
Program Code: Computer Engineering (CO4k).
Course & Course Code: Microprocessors (314321).
RollNo: 1259, 1260, 1261 EnrollmentNo: 24111050217, 24111050218, 24111050219
Semester: IV Name of Candidate: Shree Pawar , Tavish Gawde , Harish
Pimpalkar.
1) 2) 3)
1. Brief Description 1
1. Brief Description:-
2 Software -
TASM V3.0.1
1
4. Actual Procedure Followed :-
2. We discussed about the project for a while with the team members and the
respective staff member.
4. We researched about the project on the network, took some references and then
we performed our code in tasm.
This simple project is developed by using TASM. Here, the user can
easily get palindrome and can change lower case to upper case vice versa
using string function. It is easy to check whether the string is palindrome or
not. It will also change the string into lower case to upper case. This system
is easy to operate and understand by the user. String is s series of data byte
or word available in memory at consecutive locations. It is either referred
as byte string or word string. Their memory is always allocated in a
sequential order. Instructions used to manipulate strings are called string
manipulation instructions. A string in literal terms is a series of characters.
Thefunctions are set up to return empty strings or something of that effect
when there is an invalid situation, to prevent runtime errors, but feel free to
modify them to handle invalid strings in other ways.
2
6. String manipulation instructions in 8086 microprocessor :-
3
OPCODE OPERAND EXPLANATION EXAMPLE
LODSB none moves the byte at address DS:SI into AL; SI LODSB
is incr/decr by 1
LODSW none moves the word at address DS: SI into AX; LODSW
SI is incr/decr by 2
LODSD none moves the double word at address DS:SI into LODSD
EAX; SI is incr/decr by 4
4
OPCODE OPERAND EXPLANATION EXAMPLE
5
7. ALP to Convert string to lower case and vice versa.
Flowchart -
6
8. ALP to Check whether the string is palindrome or not :-
Algorithm-
i. Start
ii. Store variables like msg, arrray1, array2, etc. in data segment.
iii. Take the string input from the user.
iv. Make the string reverse and copy to another variable.
v. Compare the reversed string with the original string.
vi. If reversed string = original string Then print it is palindrome Else Print
it is not a palindrome
vii. Stop
7
Flowchart -
8
ALP -
DATA SEGMENT
MSG1 DB 10,13,'ENTER ANY STRING :- $'
MSG4 DB 10,13,'NO, GIVEN STRING IS NOT A PALINDROME $'
MSG5 DB 10,13,'THE GIVEN STRING IS A PALINDROME $'
P1 LABEL BYTE
M1 DB 0FFH
L1 DB ?
P11 DB 0FFH DUP ('$')
P22 DB 0FFH DUP ('$')
DATA ENDS
DISPLAY MACRO MSG
MOV AH,9
LEA DX,MSG
INT 21H
ENDM
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
DISPLAY MSG1
LEA DX,P1
MOV AH,0AH
INT 21H
DISPLAY P11
MOV DL,L1
ADD DL,30H
MOV AH,2
INT 21H
LEA SI,P11
LEA DI,P22
9
MOV DL,L1
DEC DL
MOV DH,0
ADD SI,DX
MOV CL,L1
MOV CH,0
REVERSE:
MOV AL,[SI]
MOV [DI],AL
INC DI
DEC SI
LOOP REVERSE
DISPLAY P22
LEA SI,P11
LEA DI,P22
MOV CL,L1
MOV CH,0
CHECK:
MOV AL,[SI]
CMP [DI],AL
JNE NOTPALIN
INC DI
INC SI
LOOP CHECK
DISPLAY MSG5
JMP EXIT
NOTPALIN:
DISPLAY MSG4
EXIT: MOV AH,4CH
INT 21H
CODE ENDS
END START
1
Output -
1
9. ALP to Calculate Length of String :-
ALP -
print macro m
mov ah,09h
mov dx,offset m
int 21h
endm
.model small;
Data Segment
.data
len db ?
mstring db 10,13, "Enter the string: $"
mlength db 10,13, "Length is: $";
Code Segment
.code
start:
mov ax,@data
mov ds,ax
print mstring
call accept_string ;function call to accept a string
1
mov cl,str1+1 ;storing length in cl from first byte of the array
mov bl,cl ;copying in bl for displaying
print mlength
call display1 ;printing the length
exit:
mov ah,4ch ;exit the program
int 21h
;accept procedure
mov ah,01
int 21h
ret
accept endp
mov al,bl
mov bl,al
and al,0f0h
mov cl,04
rol al,cl
cmp al,09
jbe number
add al,07
number: add al,30h
mov dl,al
mov ah,02
int 21h
mov al,bl
and al,00fh
cmp al,09
1
jbe number2
add al,07
number2: add al,30h
mov dl,al
mov ah,02
int 21h
ret
display1 endp
end start
end
1
Output -
1
10. ALP to Display a String :-
Algorithm-
1. Create a string
2. Load the effective address of the string in dx using LEA command
3. Print the string by calling the interrupt with 9H in AH
4. The string must be terminated by ‘$’ sign
ALP -
.MODEL SMALL
.STACK 100H
.DATA
.CODE
MAIN PROC FAR
MOV AX,@DATA
MOV DS,AX
;interrupt to exit
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
1
Output -
1
11. ALP for Reversing a String :-
ALP -
DATA SEGMENT
MSG1 DB 10,13,'ENTER ANY STRING :- $'
MSG2 DB 10,13,'LENGTH OF STRING IS :- $'
MSG3 DB 10,13,'REVERSE OF ENTERED STRING IS :- $'
P1 LABEL BYTE
M1 DB 0FFH
L1 DB ?
P11 DB 0FFH DUP ('$')
P22 DB 0FFH DUP ('$')
DATA ENDS
DISPLAY MACRO MSG
MOV AH,9
LEA DX,MSG
INT 21H
ENDM
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
DISPLAY MSG1
LEA DX,P1
MOV AH,0AH
INT 21H
DISPLAY MSG2
MOV DL,L1
1
ADD DL,30H
MOV AH,2
INT 21H
DISPLAY MSG3
LEA SI,P11
LEA DI,P22
MOV DL,L1
DEC DL
MOV DH,0
ADD SI,DX
MOV CL,L1
MOV CH,0
REVERSE:
MOV AL,[SI]
MOV [DI],AL
INC DI
DEC SI
LOOP REVERSE
DISPLAY P22
LEA SI,P11
LEA DI,P22
MOV CL,L1
MOV CH,0
MOV AH,4CH
INT 21H
CODE ENDS
END START
1
OUTPUT:-
2
12. Soft Copy of Micro -Project : -
2
Micro Project Evaluation Sheet