string matching

Posted on 2007-10-21
Medium Priority
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

Accepted Solution

abith earned 1500 total points
ID: 20136573
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

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Know here how to troubleshoot AT&T DIRECTV no signal error message with simple, stepwise instructions. Also, if you can resolve issues like blue or black screen.
An Outlook data file aka PST is prone to corruption due to various reasons. A corrupt PST file is always inaccessible. Also, you may lose all your crucial mailbox content at any time. So to fix this corruption and protect the mailbox content from be…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
To export Lotus Notes to Outlook PST or Exchange and Domino Server files to Exchange Server or PST files with ease, go for Kernel for Lotus Notes to Outlook conversion tool. Through the video, you can watch the conversion process. A common user with…

587 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