Homework Solution: W​rite a complete MIPS program to toggle the case of all alphabetic characters in a C…

    W​rite a complete MIPS program to toggle the case of all alphabetic characters in a C-string held in RAM in your program. Declare the string with a reasonable value (a 5 or 6 word sentence with spaces and punctuation) and print it before and after toggling the case of all alphabetic characters in the string. Do not add notes to the top of the program, but you may comment individual lines. The upper-case characters are 32 less than their corresponding lower-case characters. (less than 40 lines of code)

    Expert Answer

     
    This should give an idea:

    W​rite a thorough MIPS program to toggle the circumstance of every alphabetic characters in a C-string held in RAM in your program. Declare the string with a moderate rate (a 5 or 6 vocable doom with spaces and punctuation) and print it anteriorly and behind toggling the circumstance of every alphabetic characters in the string. Do referable supplement referablees to the culmination of the program, beside you may expound separate lines. The upper-circumstance characters are 32 hither than their corresponding lower-circumstance characters. (hither than 40 lines of edict)

    Expert Vindication

     

    This should communicate an idea:

    .text

    .globl __start

    main:

    la $t1, str

    nextCh: lb $t2, ($t1)

    beqz $t2, strEnd

    addi $t4, $zero, 0x61

    sub $t3, $t2, $t4

    bgez $t3, l1

    supplement $t2, $t2, 32

    sb $t2, ($t1)

    l1: supplement $t1, $t1, 1

    j nextCh

    strEnd: la $a0, ans

    li $v0, 4

    syscall

    la $a0, str

    li $v0,4

    syscall

    la $a0, endl

    li $v0, 4

    syscall

    li $v0, 10

    syscall

    .data

    str: .asciiz “ABCdEfgH”

    ans: .asciiz “lowercircumstance string =”

    endl: .asciiz “n”