How do I change the following code to be from a sum of squares to 100 to a sum of cubes? If you can help will you please point out the line(s)? Thanks.
# FILE = figA4.s
# From jws@cs.uga.edu Tue Oct 7 08:46 EDT 2003
.text
.align 2
.globl main
main:
subu $sp,$sp,32
sw $ra,20($sp)
sd $a0,32($sp)
sw $0,24($sp)
sw $0,28($sp)
loop:
lw $t6,28($sp)
mul $t7,$t6,$t6
lw $t8,24($sp)
addu $t9,$t8,$t7
sw $t9,24($sp)
addu $t0,$t6,1
sw $t0,28($sp)
ble $t0,100,loop
# la $a0,str
# lw $a1,24($sp)
# jal printf # we dont have printf, use next 6 instrs:
la $a0,str # 1
li $v0,4 # 2
syscall # 3
lw $a0,24($sp) # 4
li $v0,1 # 5
syscall # 6
move $v0,$0
lw $ra,20($sp)
addu $sp,$sp,32
j $ra
.data
.align 0
str:
.asciiz "The sum of the cubes from 1 to 100 is %d\n"