You are on page 1of 8

MPMCA Project Report

On

TO CHECK WHETHER THE GIVEN STRING IS PALINDROME


USING 8086 ALP

Submitted

In partial fulfillment of the requirement for the award of the Degree of

BACHELOR OF TECHNOLOGY

In

ELECTRONICS & COMMUNICATION ENGINEERING

By

G. BHARATH KUMAR 16311A04D5

UNDER THE SUPERVISION OF

Mrs. K. SIVA SUNDARI

Associate Professor, E.C.E Department

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

SREENIDHI INSTITUTE OF SCIENCE & TECHNOLOGY


(AUTONOMOUS)
Yamnampet, Ghatkesar, R.R District, Hyderabad – 501301(Affiliated to JNT University
Hyderabad, Hyderabad and Approved by AICTE - New Delhi)
CERTIFICATE
Date:

This is to certify that the MPMCA project report entitled" TO CHECK WHETHER THE
GIVEN STRING IS PALINDROME USING 8086 ALP" being submitted by
G. BHARATH KUMAR (16311A04D5), in partial fulfilment for the award of Bachelor of
Technology degree in Electronics & Communications Engineering to Sreenidhi Institute of
Science and Technology, Yamnampet, Ghatkesar [Telangana], is a report of review work
carried out by her during academic year 2018 under our guidance and supervision.

Mrs. K. SIVA SUNDARI Dr. S. P. V. SUBBA RAO


Coordinator Professor
Associate Professor HOD, ECE Department
ECE Department
AIM:

TO CHECK WHETHER THE GIVEN STRING IS PALINDROME


USING 8086 ASSEMBLY LANGUAGE PROGRAME

SOFTWARE REQUIRED:

1. PC WITH WINDOWS

2. MASAM SOFTWARE

THEORY:

String:
A string is traditionally a sequence of characters, either as a literal
constant or as some kind of variable. The latter may allow its elements to be mutated
and the length changed, or it may be fixed (after creation). A string is generally
considered a data type and is often implemented as an array data
structure of bytes (or words) that stores a sequence of elements, typically characters,
using some character encoding. String may also denote more general arrays or other
sequence (or list) data types and structures.
Depending on programming language and precise data type used, a variable declared
to be a string may either cause storage in memory to be statically allocated for a
predetermined maximum length or employ dynamic allocation to allow it to hold a
variable number of elements.
When a string appears literally in source code, it is known as a string literal or an
anonymous string.

Palindrome:
A palindrome is a word, number, phrase, or other sequence
of characters which reads the same backward as forward, such
as madam or racecar or the number 10201. Sentence-length palindromes may be
written when allowances are made for adjustments to capital letters, punctuation, and
word dividers, such as "A man, a plan, a canal, Panama!", "Was it a car or a cat I
saw?" or "No 'x' in Nixon".
Composing literature in palindromes is an example of constrained writing.
The word "palindrome" was coined by the English playwright Ben Jonson in the 17th
century from the Greek roots palin and dromos.
Explanation:

To check if a string is a palindrome or not, a string needs to be compared with the


reverse of itself.

Consider a palindrome string: radar,

---------------------------
index: 0 1 2 3 4

value: r a d a r
---------------------------

To compare it with the reverse of itself, the following logic is used:

1. 0th character in the array, string1 is same as 4th character in the same string.
2. 1st character is same as 3rd character.
3. 2nd character is same as 2nd character.
4. And so on
5. ith character is same as 'length-i-1'th character.
6. If any one of the above condition fails, do not jump to specified location , which
implies that the string is not a palindrome.
7. By default, if the condition satisfies jump to the specified location and continue the
operation until the count value becomes zero,
8. If all location values are equal then give string is palindrome.
PROGRAM:

ASSUME CS:CODE,DS:DATA,ES:DATA

DATA SEGMENT

STRING1 DB ‘MADAM’

STRING2 DB 10 DUP(?)

COUNT DW 05

RES DB ?

DATA ENDS

CODE SEGMENT

START: MOV AX, DATA

MOV DS, AX

MOV ES, AX

MOV CX, COUNT

LEA SI, STRING1

LEA DI, STRING2

ADD DI, CX

DEC DI

GO: MOV AL, [SI]

MOV [DI], AL

INC SI

DEC DI

LOOP GO

LEA SI, STRING1

LEA DI, STRING2

MOV CX, COUNT

CLD
REPNZ CMPSB

JZ ABC

MOV RES,’N’

MOV RES+1,’O’

INT 03H

ABC: MOV RES,’Y’

MOV RES+1,’E’

MOV RES+2,’S’

INT 03H

CODE ENDS

END START

Applications of Palindrome:
Uses of palindromes in fiction writing:

1) Place them in the mouth of a social misfit.

2) Used in crime or supernatural genres as a means of filling out a character’s profile.

3) Incorporate into historic works – especially those set in the ancient world.

4) Throw into a comedy, or use as part of a comic interlude.

5) Creating palindrome poetry.

Use in biology:

"Palindrome recognition is important in computational biology. Palindromic structures


can frequently be found in proteins and identifying them gives researchers hints about
the structure of nucleic acids. For example, in nucleic acid secondary structure
prediction, one is interested in complementary palindromes which are considered in
the full version."
Output:
RESULT AND CONCLUSION:

AN ASSEMBLY LANGUAGE PROGRAM TO CHECK WHETHER THE GIVEN


STRING IS PALINDROME USING 8086 IS PERFORMED.

You might also like