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
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
can you please show me with the screen shot of the output, Thank you.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images