string matching

Posted on 2007-10-21
Last Modified: 2012-08-14
If I have a large piece of text in the form:
MyText   BYTE This is a really long piece food of text &,0
the label will be MyText and it will be NULL terminated
the question is how can I search for any word  such as "foo" within  MyText than, if the program found it or any word contains "foo" such as "food" it  is going to print "foo" if it is found or  "FOOD" in any case and keep searching until the last word in MyText
Question by:Deem2007
    1 Comment
    LVL 5

    Accepted Solution

    since in which assembler it needs to implemented is not mentioned, here i give general idea.

    write a subroutine equalen to 'C' strncmp which may return 1 or 0.
    find the length of MyText(n) and "foo" (m)

    iterate 0 to n-m
      call subroutine by passing itr , text to find and length m.
      if returned value is 1, print and exit, else continue iterating till n-m times

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Ti 89 Calculator 6 742
    Patching a Windows EXE 23 727
    DOS function for Text Windows size 8 279
    Integrating PowerShell Script in C# Assembly Code 4 580
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    DECT technology has become a popular standard for wireless voice communication. DECT devices are not likely to be affected by other electronic devices and signals because they operate in a separate frequency-band.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now