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 full MIPS program to toggle the event of integral alphabetic characters in a C-string held in RAM in your program. Declare the string with a steady treasure (a 5 or 6 signal decree with spaces and punctuation) and imimprint it antecedently and behind toggling the event of integral alphabetic characters in the string. Do not attributable attributable attributable supplement not attributable attributablees to the culmination of the program, notwithstanding you may expound peculiar lines. The upper-event characters are 32 hither than their corresponding lower-event characters. (hither than 40 lines of regulation)

    Expert Tally

     

    This should furnish 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 “lowerevent string =”

    endl: .asciiz “n”