Palindrome program 8086


















My program only prints the first letter of the input string as reversed string and doesn't really test the palindrome properly. This is what I've done so far:. We're using this old emulator software called emu which has some documentation online.

Any help would be highly appreciated! Thank you. You set SI to point to the first byte of mystr and after copying this byte you decrement SI, which gets SI out of the buffer. SI should be pointed to the last character in mystr in the beginning. Instead of. The instruction tess: mov al,[SI],0 ; End of data?

Posting the source text is not enough, it should be accompanied with information how it was assembled and linked. You should have taken the hint in the comment "; Source buffer address id SI decremented ". In order to traverse the source string backwards - that's what 'decremented' means - you need to initialize the source pointer SI to the end of the string.

Please notice that you don't need that cmp cl,0 instruction because the preceding dec cl instruction already set the necessary flags.

You don't want the addresses again in SI and DI. You need to fetch the characters that this registers point at and then compare those:. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Palindrome program for emu in assembly language Ask Question. Asked 1 year, 8 months ago. Active 1 year, 8 months ago. Viewed 1k times. Is a typical home-work assignment for beginners. Yes, please do write. Reverse the string and compare it to the original.

If they match, then it is a palindrome. It is a simple program. Log in. Computer Programming. Intel and Study now. See answer 1. Best Answer. Study guides. Software and Applications non-game 20 cards. What is a programming language. What does DOS stand for. What is a software that is distributed for free. What is application software. Q: Assembly language program in to check wether given string is palindrome or not? Write your answer Related questions.

Assembly language program for string concatenation using microprocessor? Write a program in assembly language that reverses a string stored in the data segment? Write a C program to check a string is a palindrome or not? Program for palindrome in java using constructor? What are examples of a palindrome program forward and backwards? Then jne exit to figure out why you left the loop. Why are loops always compiled into "do But if you care about modern x86 instead of , you'd avoid the slow loop instruction entirely.

PeterCordes Thanks it worked — Ahmad Habib. Add a comment. Active Oldest Votes. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science.



0コメント

  • 1000 / 1000