This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Microprocessors & Applications (UPTU) Appendix B ØØ Explanation : • We will accept two strings from the user. After accepting the strings, the first step in string comparison is to check whether their string lengths are equal. If the string lengths are not equal, we print the message unequal strings. If the string lengths are equal, we check if the contents of two strings are equal. The lengths of the two stings are initialized in the CX register. • The source and destination address are initialized in DS : SI and ES : DI registers. • Using the string instruction REPE CMPSB, two data are compared character by character. • If all the characters are matching display the message “equal strings” otherwise display “unequal strings”. ØØ Algorithm : Step I : Initialize the data memory. Step II : Allocate data memory to save the strings. Step III : Initialize DS and ES register....
View Full Document
This note was uploaded on 08/04/2011 for the course ECON 101 taught by Professor Lucky during the Spring '11 term at Silver Lake.
- Spring '11