If both of the integers are unsigned or positive at all times what you can do is (Inputs are not from user in this case you should add syscalls for the first 2 li instructions in order to do that):
$a0: x variable
$a1: y variable
.text
li $a0, 5 #x variable
li $a1, 3 #y variable
jal exponent
li $v0, 10
syscall
exponent:
addi $sp, $sp, -12 #decrement the stack pointer
sw $s0, 0($sp) #store values for not muting
sw $s1, 4($sp)
sw $s2, 8($sp)
move $s0, $a0
move $s1, $a1
li $s2, 1
###PRINT###
la $a0, prompt1
li $v0, 4
syscall
move $a0, $s0
li $v0, 1
syscall
la $a0, prompt2
li $v0, 4
syscall
move $a0, $s1
li $v0, 1
syscall
###END PRINT###
loop:
mul $s2, $s2, $s0 #in each iteration 1 multiplication done
addi $s1, $s1, -1
bne $s1, 0, loop #when $a1 equals 0 it will go on
###PRINT###
la $a0, result
li $v0, 4
syscall
move $a0, $s2
li $v0, 1
syscall
###END PRINT###
move $v0, $s2
lw $s0, 0($sp) #load values for not muting
lw $s1, 4($sp)
lw $s2, 8($sp)
addi $sp, $sp, 12
jr $ra
.data
.align 2
prompt1: .asciiz "X: "
.align 2
prompt2: .asciiz "Y: "
.align 2
result: .asciiz "Result: "
If you are aiming to cover negative numbers too you should add another loop for that case and inside it rather than mul instruction you should use div.
Keep in mind that in Stackoverflow you should not ask for whole programs :)