Question: Write a program in Assembly Language that will find the total number of strings user had entered. In example: Enter a string: asdfsdads Enter a

Write a program in Assembly Language that will find the total number of strings user had entered. In example:

Enter a string: asdfsdads

Enter a substring: sd

Number of total substrings in the string: 2

Program is already written on the code below, but there are some errors or some code might be missing. Here is the code:

.code

main PROC

mov esi,0 ;esi should be string

mov edi,0 ;edi should be substring

mov ecx,x

outer:

push esi

push ecx

mov ecx, y

inner:

cmp string[esi], substring[edi]

jne -exit

inc esi

inc edi

loop inner

inc counter

-exit: pop ecx

pop esi

inc esi

mov edi, 0

loop outer:

call dumpregs

exit

main ENDP

END main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!