Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .globl main
- main:
- li $t1, 0
- li $t2, 0
- li $t3, 0
- loop:
- add $t4, $t0, $t3 # c = &str[i]
- lbu $t4, 0($t4) # c = str[i]
- li $t6, 90 # $t6 = 90
- bgt $t5, $t6, is_lowercase # if(c <= 90)
- addi $t1, $t1, 1 # upperCount++
- b end_if
- is_lowercase:
- addi $t2, $t2, 1 # else upperCount++
- end_if:
- li $t6, 10
- addi $t3, $t3, 1 # i = i + 1
- blt $t4, $t6, loop # while(i < 10)
- done:
- li $v0, 1
- move $a0, $t1
- syscall
- move $a0, $t2
- syscall
- li $v0, 10
- syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement