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
Get step-by-step solutions from verified subject matter experts
