Create anassembly program that display following series and iterate it for15 tim
ID: 3608623 • Letter: C
Question
Create anassembly program that display following series and iterate it for15 times.
Series will be 3, 5, 6, 10,9, 15, 12, 20, 15, 25....
Initialize thefirst register as 3 and 5. Keep two register as a counter for eachsub part of the series.
Emphasis shouldbe put on efficient register usage.
I'm obviouslynot 'fluent' with this language and could use some explainationwith what is going on..
Thanks in advance!
I have come upwith the following code (not sure how much of it isright)
.data
.text
main:
addi $s2, $0, 3 #initialization
addi $s1, $0, 5 #initialization
addi $t2, $0,15 # $t2=0+15=15 (initialization)
LOOP: addi $s2, $s2,3 #
addi $s1, $s1, 5
addi $t2, $t2,-1 #
bne $t2, $0, LOOP
li $v0,1
syscall