I need this done in ASM (MASM assembly)I need to add user input into my program to get string from user and then count the amount of words in string I need the code below modified so that it counts...


I need this done in ASM (MASM assembly)I need to add user input into my program to get string from user and then count the amount of words in string I need the code below modified so that it counts the amount of words instead of the amount of characters. This requires user input first. Or you could just count the amount of blank spaces and return the count to eat Instructions: Write a pros that takes a user single string argument, counts the number of words in the string, and returns the count via the EAX register.386.MODEL flat, STD call.STACK 4096


; Change the IRVINE32 direction if it is not installed in the bellow folder INCLUDE      C:\Irvine\Irvine32.inc INCLUDELIB


C:\Irvine\Irvine32.lib .data string BYTE "The length of the string is 30", 0 .code stolen PROC push ebb move ebb, esp. move def, [ebb + 8] ; get the start address of the string move eat, 0; initialize length = 0 L1: move lb, [def]  ; move the i-th character to BL camp lb, 0 ; if BL = 0, then the end of the string, break the loop je L2 add def, 1; otherwise move EDX to the address next character add eat, 1; increase the length jump L1


L2: pop ebb ret stolen ENDP main PROC; put the address of the string onto the stack move eat, OFFSET string push eat call stolen; length should be at EAX call Write-in exit main ENDP END main




May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here