Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted by asd ( 15 years ago )
.data
string: .space 16
init: .asciiz "\nPodaj ciag znaków > "
msg: .asciiz "\nPoprawione        > "

.text
 #wypisz komunikat
 li $v0, 4
 la $a0, init
 syscall
 
 #wczytaj ciag
 li $v0, 8
 la $a0, string
 li $a1, 16  #wczytaj max 16
 syscall
 
 #popraw
 la $t0, string
fix: 
 lb $t1, ($t0)
 blt $t1, ' ', end
 
 blt $t1, 'A', continue #jesli mniej niz 'A' to dalej
 bgt $t1, 'Z', continue #jesli wiecej niz 'Z' to dalej
 
 addiu $t1, $t1, 32  #lowcase zrób
 sb $t1, ($t0)
 
continue:
 addiu $t0, $t0, 1
 b fix
 
 #wypisz ciag
end: 
 li $v0, 4
 la $a0, msg
 syscall
 la $a0, string
 syscall
 
 #koniec
 li $v0, 10
 syscall

 

Revise this Paste

Parent: 40628
Your Name: Code Language: