Excuse me, can someone help me on this? I need to convert all the lowercase letters such as this "Hello how are you?" to "HELLO HOW ARE YOU?",
Here is what I have so far:
.data
firsttyped: .asciiz ""
newline: .asciiz "\n"
.text
main:
li $v0, 8
li $a1, 20
la $a0, firsttyped
syscall
li $v0, 4
li $t0, 0
loop:
lb $t1, firsttyped($t0)
beq $t1, 0, exit
sub $t1, $t1, 32
sb $t1, firsttyped($t0)
addi $t0, $t0, 1
j loop
exit:
li $v0, 4
la $a0, firsttyped
syscall
li $v0, 10
syscall
Can someone help me out on this please? I need to prevent that error the underlined e from coming.
By the way I do not understand psuedo codes.
You should:
To do so you would:
replace .asciiz ""
from firsttyped with:
firsttyped: .space 20
Add the following lines after beq $t1, 0, exit
blt $t1, 'a', not_lower
bgt $t1, 'z', not_lower
and add the label not_lower
before addi $t0, $t0, 1
:
not_lower: