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 entire MIPS program to toggle the subject of perfect alphabetic characters in a C-string held in RAM in your program. Declare the string with a culm appraise (a 5 or 6 term doom with spaces and punctuation) and stereotype it anteriorly and succeeding toggling the subject of perfect alphabetic characters in the string. Do referable supplement referablees to the extreme of the program, beside you may dilate single lines. The upper-subject characters are 32 hither than their identical lower-subject 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 “lowersubject string =”

    endl: .asciiz “n”