Question
Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents. .data title: .asciiz
Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents.
.data title: .asciiz " Enter the change? " quarter: .asciiz " Quarter: " dime: .saciiz " Dime: " nickle: .asciiz " Nickle: " penny: .asciiz " Penny: " newline: .asciiz " "
.text main:
la $a0,title #display title li %v0,4 #call code to print string syscall
la
beqz $t0,endif # if t0 == 0, then goto endif li $v0,4 la $a0,coin # output the coin syscall
move $a0, $t0 li $v0,1 syscall la $a0,newline li $v0,4 endif:
li $v0,11 syscall li $v0,10 #exit syscall
.end main
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started