Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help figuring out the asm on this code. I am a windows user and it has to be in windows, { } not

I need help figuring out the asm on this code. I am a windows user and it has to be in windows,{} not () closed. And it has to be in asm. Please help ASAP.
#include
#include
#include
#include
//declare variables
int soda =2, water =1, beer =3, in =4, inch =6, s, sand, si, total;
string dtype;
using namespace std;
int main()
{
//display a menu
cout <<"-------------------MENU--------------------
";
cout << "Drinks
";
cout <<"\tSoda(s)................................$2
";
cout <<"\tWater(w)...............................$1
";
cout <<"\tBeer(b)................................$3
";
cout << "Sandwiches
";
cout <<"\t6 inches...............................$4
";
cout <<"\t12inches...............................$6
";
//allow user to put in their info
cout << "How many sodas? "; cin >> s;
cout <<"\tWhat kind of drink (Soda(s)/Water(w)/Beer)?"; cin >> dtype;
cout << "How many sandwiches? "; cin >> sand;
cout <<"\tWhat size (6/12 inches)?"; cin >> si;
//compute total bill
//issue, no idea how to compute it
_asm
{
mov ebx, soda;
add ebx, sand;
mov total, ebx;
}
//display total bill
cout <<"\t\tYour total bill is $"<< total << endl;
system("pause");
return 0;
}
/*-----------------------output---------------------------------------
-------------------MENU--------------------
Drinks
Soda(s)..............................$2
Water(w)........................... $1
Beer(b)..............................$3
Sandwiches
6 inches..............................$4
12inches..............................$6
How many sodas? 4
What kind of drink (Soda(s)/Water(w)/Beer)? W
How many sandwiches? 4
What size (6/12 inches)?12
Your total bill is $28
------------------------------------------------------------------------*/

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions