Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   Assembly Language coding (http://www.go4expert.com/forums/assembly-language-coding-t20650/)

Syed Zakir Hussain 12Jan2010 22:53

Assembly Language coding
 
Write a subroutine that takes the segment and offset pairs for two null terminated strings. If the first string is present anywhere inside the second string, the subroutine returns 1 in AX and otherwise it returns 0.
For example, if the first string is "cde" and the second is "abcdef", the subroutine returns 1. If however the second string is "abcd", the subroutine returns 0. Be careful about the lengths of strings and never access beyond the null byte at the end of string. Do check your subroutine with "aab" as the first string and "aaab" as the second. Since "aab" is a substring of "aaab", your subroutine should return 1.

lionaneesh 22Feb2011 00:17

Re: Assembly Language coding
 
Quote:

Originally Posted by Syed Zakir Hussain (Post 62923)
Write a subroutine that takes the segment and offset pairs for two null terminated strings. If the first string is present anywhere inside the second string, the subroutine returns 1 in AX and otherwise it returns 0.
For example, if the first string is "cde" and the second is "abcdef", the subroutine returns 1. If however the second string is "abcd", the subroutine returns 0. Be careful about the lengths of strings and never access beyond the null byte at the end of string. Do check your subroutine with "aab" as the first string and "aaab" as the second. Since "aab" is a substring of "aaab", your subroutine should return 1.

Duplicate Thread of http://www.go4expert.com/showthread.php?t=20687

shabbir 22Feb2011 06:49

Re: Assembly Language coding
 
Quote:

Originally Posted by lionaneesh (Post 79680)

Its the other way round.


All times are GMT +5.5. The time now is 12:37.