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 "SABC9" and returns with EAX pointing to the "5" in the target string: NCLUDE Irvine32.inc Str_find PROTO, pTarget:PTR BYTE, pSource:PTR BYTE data arget BYTE "01ABAAAAAABABCC45ABC9012",0 Source BYTE "SABC9",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? enTarget DWORD? enSource DWORD? Dosition DWORD? code main PROC INVOKE Str_find ADDR target, ADDR source mov position.cax jz wasfound; ZF-1 indicates string found mov edx,OFFSET str3; string not found call WriteString jmp quit was found:; display message mov edx,OFFSET str1 call WriteString moveax position; write position value call WriteDec mov edx,OFFSET str2 call WriteString quit: exit nan ENDP Str_find PROC. [....] your code] Str_find ENDP

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Control Structure
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education