I've written sorts before, just not in assembly.
I know how to get the string (user input or hardcoded) into a register and how to work my way through it, but I'm not sure how to make it get sorted, or sort into another register.
Any help will be appreciated
I know how to get the string (user input or hardcoded) into a register and how to work my way through it, but I'm not sure how to make it get sorted, or sort into another register.
Code:
data
str: .asciiz "zghfjsdkalqpwoeirutyvn"
.text
.globl main
main:
la $t2,str
nextCh: lb $t0,($t2) # fetch char
beqz $t0, Done # 0x0 terminates string goes to # exit
#sorting/swapping goes here ^_^;;
add $t2,1 #increment $t2 to get to next char
j nextCh
Done:
li $v0,10
syscall