Write a procedure named Str_find that searches for the first matching occurrence of a source string inside a target string and returns the matching position. The input parameters should be a pointer to the source string and a pointer to the target string. If a match is found, the procedure sets the Zero flag and EAX points to the matching position in the target string. Otherwise, the Zero flag is clear and EAX is undefined. The following code, for example, searches for "5ABC9" and returns with EAX pointing to the "5" in the target string: INCLUDE Irvine32.inc Str_find PROTO, pTarget:PTR BYTE, pSource:PTR BYTE .data target BYTE "01ABAAAAAABABCC45ABC9012",0 source BYTE "5ABC9",0 str1 BYTE "Source string found at position ",0 str2 BYTE" in Target string (counting from zero).",0Ah,0Ah,0Dh,0 str3 BYTE "Unable to find Source string in Target string.",0Ah,0Ah,0Dh,0 stop DWORD? lenTarget DWORD? lenSource DWORD? position DWORD? .code main PROC INVOKE Str find,ADDR target, ADDR source mov position, eax jz wasfound ; ZF=1 indicates string found mov edx,OFFSET str3; string not found call WriteString jmp quit wasfound:; display message mov edx,OFFSET str1 call WriteString mov eax,position; write position value call WriteDec mov edx,OFFSET str2 call WriteString quit: exit main ENDP Str find PROC. [....] [your code] Į ! Į Str_find ENDP END main

Oh no! Our experts couldn't answer your question.

Don't worry! We won't leave you hanging. Plus, we're giving you back one question for the inconvenience.

Submit your question and receive a step-by-step explanation from our experts in as fast as 30 minutes.
You have no more questions left.
Message from our expert:
Our experts are unable to provide you with a solution at this time. Try rewording your question, and make sure to submit one question at a time. We've credited a question to your account.
Your Question:

2. can you please show me with the screen shot of the output, Thank you.

 

Write a procedure named Str_find that searches for the first matching occurrence of a source string inside a target string and returns the matching position.
The input parameters should be a pointer to the source string and a pointer to the target string. If a match is found, the procedure sets the Zero flag and EAX
points to the matching position in the target string. Otherwise, the Zero flag is clear and EAX is undefined. The following code, for example, searches for
"5ABC9" and returns with EAX pointing to the "5" in the target string:
INCLUDE Irvine32.inc
Str_find PROTO, pTarget:PTR BYTE, pSource:PTR BYTE
.data
target BYTE "01ABAAAAAABABCC45ABC9012",0
source BYTE "5ABC9",0
str1 BYTE "Source string found at position ",0
str2 BYTE" in Target string (counting from zero).",0Ah,0Ah,0Dh,0
str3 BYTE "Unable to find Source string in Target string.",0Ah,0Ah,0Dh,0
stop DWORD?
lenTarget DWORD?
lenSource DWORD?
position DWORD?
.code
main PROC
INVOKE Str find,ADDR target, ADDR source
mov position, eax
jz wasfound ; ZF=1 indicates string found
mov edx,OFFSET str3; string not found
call WriteString
jmp quit
wasfound:; display message
mov edx,OFFSET str1
call WriteString
mov eax,position; write position value
call WriteDec
mov edx,OFFSET str2
call WriteString
quit:
exit
main ENDP
Str find PROC. [....]
[your code]
Į
!
Į
Str_find ENDP
END main
Transcribed Image Text:Write a procedure named Str_find that searches for the first matching occurrence of a source string inside a target string and returns the matching position. The input parameters should be a pointer to the source string and a pointer to the target string. If a match is found, the procedure sets the Zero flag and EAX points to the matching position in the target string. Otherwise, the Zero flag is clear and EAX is undefined. The following code, for example, searches for "5ABC9" and returns with EAX pointing to the "5" in the target string: INCLUDE Irvine32.inc Str_find PROTO, pTarget:PTR BYTE, pSource:PTR BYTE .data target BYTE "01ABAAAAAABABCC45ABC9012",0 source BYTE "5ABC9",0 str1 BYTE "Source string found at position ",0 str2 BYTE" in Target string (counting from zero).",0Ah,0Ah,0Dh,0 str3 BYTE "Unable to find Source string in Target string.",0Ah,0Ah,0Dh,0 stop DWORD? lenTarget DWORD? lenSource DWORD? position DWORD? .code main PROC INVOKE Str find,ADDR target, ADDR source mov position, eax jz wasfound ; ZF=1 indicates string found mov edx,OFFSET str3; string not found call WriteString jmp quit wasfound:; display message mov edx,OFFSET str1 call WriteString mov eax,position; write position value call WriteDec mov edx,OFFSET str2 call WriteString quit: exit main ENDP Str find PROC. [....] [your code] Į ! Į Str_find ENDP END main
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage