Question
Write a MIPS assembly language program that does the following in sequence - takes user input for the value of an integer a - takes
Write a MIPS assembly language program that does the following in sequence
- takes user input for the value of an integer a
- takes user input for the value of an integer b
- takes user input for the value of an integer c
- prints the value of the quadratic equation ax2 + bx + c for 10 different integer values of x starting from 1 to 10
I've done these so far:
.data
a: .asciiz "Enter a Value: " # Enter a Value
b: .asciiz "Enter b Value: " # Enter b Value
c: .asciiz "Enter c Value: " # Enter c Value
.text
la $a0, a # load the addr of prompt into $a0
li $t0, 4 # 4 is the print_string syscall
syscall # print the "Enter a Value"
li $t0, 5 # 5 is the read integer syscall
syscall # read the integer which gets stored in $v0
move $t0,$v0 # # put the integer in $t0 for for later processing
la $a1, b # load the addr of value into $a0
li $v0, 4 # 4 is the print_string syscall
syscall # print the string, "Double the number is "
move $t1, $v0 # put the value from $t0 in $a0 for printing
li $v0, 1 # 1 is the print_int syscall
syscall # print the value of doubled input number
la $a0, c # load the addr of endline into $a0
li $v0, 4 # 4 is the print_string syscall
syscall # print n endline character
# the following 2-line instructions are needed for the program to exit properly
li $v0, 10 # 10 is the exit program syscall
syscall # exit program
Please help me complete the program as basic as possible with MIPS MARS 4.5
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