Question: It must be a ASM code with comments in every code and there should be no DB or DW it must be BYTE lastly must
It must be a ASM code with comments in every code and there should be no DB or DW it must be BYTE lastly must use asmlib.inc and one more thing this a college assignment so please use ASM codes only. Those of you are who have taken the C class are going to be very familiar with this but it is a good exercise to combine most of what we have been doing to date.
Write a program that asks the user to guess the next roll of a six sided die. Each guess costs $ If they guess correctly, they get $ The player will start out with a $ bank. Each time he or she guesses incorrectly you will subtract $ from their bank. Each time they guess correct, you add $ to their bank. Print the total winnings or loss at the end of the game. You can simulate the toss of the dice using the RandomRange function Dont forget to Randomize It is important that you seed the random number generator only once at the top of the file. Seeding the random number generator in a loop does not have the effect that you might think it does.
You are not to use any IF ELSE, WHILE, or ENDW or REPEAT instructions. You are to use pure old fashion assembly language to solve this.
Your program should look something like this:
Welcome to the dice guess game. it costs $ to play.
Would you like to continue? yn
y
Please enter your guess for the next roll. It only costs $ to play
If you are correct I will pay you $:
Winner!
Your bank is now $
Would you like to continue? yn
y
Please enter your guess for the next roll. It only costs $ to play
If you are correct I will pay you $:
Sorry you lose. The dice rolled
Your bank is now $
Would you like to continue? yn
y
Please enter your guess for the next roll. It only costs $ to play
If you are correct I will pay you $:
Sorry you lose. The dice rolled
Your bank is now $
Would you like to continue? yn
n
Thanks for Playing
Your bank is now $
Press any key to close this window
You are probably going to want to review random numbers and the while loop.
NOT Allowed
The use of legacy directives like DB and DW is not allowed in this class. A deduction of will be given if you use them.
The use of indirect addressing around variables is NOT allowed in the class unless you are using indirect addressing. An example of this would be val Doing this will result in a reduction in your grade.
Please NOTE:
Not putting comments in assembly language source code in unacceptable. You are required to comment each line of code you write. Failure to do so will result in a reduction in your grade.
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
