Assembly code of a substring in a string.

Discussion in 'Assembly Language Programming (ALP) Forum' started by Koala269, Jan 17, 2010.

Thread Status:
Not open for further replies.
  1. Koala269

    Koala269 New Member

    Joined:
    Jan 17, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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.


    Intel 86 processor
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice