It's my first time doing MIPS assembly and I'm trying to create a program that (1) accepts user's input (2) pre-store it in a specific address (3) multiply using repeated addition
Here's my program:
#Data Segment#
.data 0x10010000
x: .word 1988
y: .word 1923
.text
#Main Segment
main:
sub $t3, $t3, $t3 #initialize counter
sub $t4, $t4, $t4 #initialize product
multiloop:
lui $t0, 0x1001
lw $t1, 0($t0) #load first integer value; variable for addition
lw $t2, 4($t0) #load second integer value; variable for counter
sub $t2, $t2, $t3 #counter operation
bltz $t2, done #if counter > 0 means operation is complete
add $t4, $t4, $t1 #addition
addi $t3, $t3, 1 #increment counter
j multiloop #loop
done:
sw $t4, 32($t0)
The question is: why is my program " program is finished running (dropped off bottom)". Any help? Thanks!