Escolar Documentos
Profissional Documentos
Cultura Documentos
On
Submitted
BACHELOR OF TECHNOLOGY
In
By
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.
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:
---------------------------
index: 0 1 2 3 4
value: r a d a r
---------------------------
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
MOV DS, AX
MOV ES, AX
ADD DI, CX
DEC DI
MOV [DI], AL
INC SI
DEC DI
LOOP GO
CLD
REPNZ CMPSB
JZ ABC
MOV RES,’N’
MOV RES+1,’O’
INT 03H
MOV RES+1,’E’
MOV RES+2,’S’
INT 03H
CODE ENDS
END START
Applications of Palindrome:
Uses of palindromes in fiction writing:
3) Incorporate into historic works – especially those set in the ancient world.
Use in biology: