{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Assn4 - li $v0,1 move $a0 $s0 syscall#Print counter1 li...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
.data str: s Prompt: .asciiz " Please Input a string (15 characters long): \n " count1: .asciiz "\n Number of upper case letters is: " count2: .asciiz "\n Number of lower case letters is: " .globl main .text main: li $v0,4 la $a0, Prompt syscall li $v0, 8 la $a0, str li $a1, 16 syscall s la $t3, str lb $t0, 0($t3) $ addi $s0, $zero, 0 #initialize counter for upper case # addi $s1, $zero, 0 #initialize counter for lowwer case # loop: beq $t0, $zero, exit jal upper jal lower addi $t3, $t3, 1 #get address of new character # lb $t0, 0($t3) j loop l exit: li $v0,4 la $a0, count1 syscall #Print counter 1 phrase
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: li $v0,1 move $a0, $s0 syscall #Print counter1 # li $v0,4 la $a0, count2 syscall #Print counter 2 phrase li $v0,1 move $a0, $s1 syscall #print counter2 # end: j end e upper: li $t1, 65 #lower bound li $t2, 90 #upper bound bgt $t0, $t2, exitup blt $t0, $t1, exitup addi $s0, $s0, 1 #increment counter exitup: jr $ra $ lower: li $t1, 97 #lower bound li $t2, 122 #upper bound bgt $t0, $t2, exitdw blt $t0, $t1, exitdw addi $s1, $s1, 1 #increment counter exitdw: jr $ra...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern