Question: Plese help me with the _ asm, I cannot figure out how to output two words per line ' #include #include #include using namespace std;
Plese help me with the asm, I cannot figure out how to output two words per line
#include
#include
#include
using namespace std;
char sentence;
int i;
char c;
void readSentence
cout "Enter a sentence: ;
cin.getlinesentence
;
void skipLine
cout endl;
void display
cout c;
int main
cannot make another dl it wont make sense
cannot break it it wont work
cannot double up it wont work
my best bet is to allow is to compute words and go to the next line
asm
Call readSentence; reading the sentence
lea esi, sentence; making sentence an esi
mov dlesi; moving the sentence in
whileLoop:
cmp dl; when there is no input
je endWhile; goes to endWhile
mov dlesi; moving the sentence to dl
mov c dl moving the dl to c
call display; displaying the one letter
add esi, ; goes to the next letter
mov dlesi; saves the letters being outputted
inc i; idk
cmp esi; if word has space
Je newLine; go to new line
jmp whileLoop; lets all the words play out until it gets to a space
newLine:
Call skipLine; calls the skip part
add esi, ; adds another word??
inc i; idk
jmp whileLoop; does the loop again
endWhile: end asm
cout endl;
systempause;
return ;
output
Enter a sentence: The best way to care for others is to first care for yourself
Output:
The best
way to
care for
others is
to first
care for
yourself
Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
