Question: Help with Assembly language ex output my output I am having trouble figuring out how to print out the correct option and the correct change

Help with Assembly language

ex output

Help with Assembly language ex output my output I am having troublemy output

figuring out how to print out the correct option and the correct

I am having trouble figuring out how to print out the correct option and the correct change

-----------------------

.data

VendingName: .ascii "Vending Maching \0" Candy: .ascii "1. Yum Candy (25 cents) \0" PaperHat: .ascii "2. Paper Hat (50 cents) \0" AstroBoy: .ascii "3. Astro boy Toy (75 cents) \0" Kitty: .ascii "4. Kitty (95 cents) \0"

Items: .quad Candy .quad PaperHat .quad AstroBoy .quad Kitty

Costs: .quad 25 .quad 50 .quad 75 .quad 95

EnterMoney: .ascii "Enter money: \0" .quad 0

MoneyTotal: .quad 0

Selection: .ascii "Enter your selection: \0" .quad 0

Change: .ascii "Your Change is \0"

.text .global _start

_start:

mov $VendingName, %rcx call PrintCString

mov $Candy, %rcx call PrintCString

mov $PaperHat, %rcx call PrintCString

mov $AstroBoy, %rcx call PrintCString

mov $Kitty, %rcx call PrintCString

mov $EnterMoney, %rcx call PrintCString call ScanInt mov %rcx, MoneyTotal

mov $Selection, %rcx call PrintCString call ScanInt

mov $Change, %rcx call PrintCString

mov MoneyTotal, %rcx sub Costs, %rcx call PrintInt call PrintCString

call EndProgram

Example Your solution doesn't have to look exactly like the example below. The user's input is printed in blue. The data outputted from your calculations is printed in red. You don't have to make the text that color in your program You don't have to worry about input validation. If they enter a wrong amount, don't worry about what will happen Fluff-a-matic Vending machine 1. Cat Nip (85 cents) 2. string (25 cen 3. Bouncy Bal1 (60 cents) 4. Cat Snacks (42 cents) Enter money: 100 Your selection: 3 3. Bouncy Ball (60 cents) Your change is 40 Example Your solution doesn't have to look exactly like the example below. The user's input is printed in blue. The data outputted from your calculations is printed in red. You don't have to make the text that color in your program You don't have to worry about input validation. If they enter a wrong amount, don't worry about what will happen Fluff-a-matic Vending machine 1. Cat Nip (85 cents) 2. string (25 cen 3. Bouncy Bal1 (60 cents) 4. Cat Snacks (42 cents) Enter money: 100 Your selection: 3 3. Bouncy Ball (60 cents) Your change is 40

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!