Code: Alles auswählen
.data
tosortarray: .asciiz "kjihgfedcba$"
.text
main:
la $t1, tosortarray
li $t2, 0
loop1:
add $t6, $t2, 1
loop2:
lb $t7, tosortarray+0($t2)
lb $t5, tosortarray+0($t6)
bgt $t7, $t5, goon
move $t8, $t7
move $t7, $t5
move $t5, $t8
goon:
add $t6, $t6, 1
lb $t3, tosortarray+0($t6)
bne $t3, '$', loop2
add $t2, $t2, 1
lb $t3, tosortarray+0($t2)
bne $t3, '$', loop1