Basically for a class project/assignment we need to take another persons program in class and correct it for them, if they are good at assembly then your in luck if your person is bad like mine seems to be your screwed. Below is the exact code they posted, I've gone through it a bunch of times and can't even figure out except for where the variables are entered what this person is trying to do or even how to fix it so that it works. If anyone can tell what this person is trying to do, such as how they get from the variable entered part to the actual exponential situation or see a way to fix this problem or basically any help at all I would greatly appreciate it. Thanks in advance.
# Program to:
# 1 ask the user to type in the value for two variables x and y
# 2 calculate the exponential function: F(x,y) = x^y
.data #variable used follow this line
promptX: .asciiz "Enter a number for X:"
promptY: .asciiz "Enter a number for Y:"
.text
main:
li $v0, 4 # System call code for print string
la $a0, promptX # Load address of the promptA string
syscall # call OS to Print promptX
li $v0, 5 # System call code for read integer
syscall # call OS to Read integer into $v0
move $a0, $v0 # Move the integer into $s0
li $v0, 4 # System call code for print string
la $a0, promptY # Load address of the promptA string
syscall # call OS to Print promptA
li $v0, 5 # System call code for read integer
syscall # call OS to Read integer into $v0
move $a1, $v0 # Move the integer into $s0
#move $a0,$s0
#move $a1, $s1
jal exponential
move $a0, $v0
li $v0, 1
syscall
exit:
li $v0, 10
syscall
exponential:
addi $sp, $sp, -4
sw $t0, 4($sp)
move $t0, $zero
li $v0, 1
loop:
beq $t0, $a1, end
mul $v0, $v0, $a0
addi $v0, $t0, 1
j loop
end:
addi $sp, $sp, 4
jr $ra