# Data Area
buffer: .space 100
input_prompt: .asciiz “Enter string:\n”
output_prompt: .asciiz “Output:\n”
convention: .asciiz “Convention Check\n”
newline: .asciiz “\n”
# DO NOT MODIFY THE MAIN PROGRAM
la $a0, input_prompt # prompt user for string input
li $v0, 8 # take in input
la $a0, buffer
li $a1, 100
move $s0, $a0 # save string to s0
ori $s1, $0, 0
ori $s2, $0, 0
ori $s3, $0, 0
ori $s4, $0, 0
ori $s5, $0, 0
ori $s6, $0, 0
ori $s7, $0, 0
move $a0, $s0
jal SwapCase
add $s1, $s1, $s2
add $s1, $s1, $s3
add $s1, $s1, $s4
add $s1, $s1, $s5
add $s1, $s1, $s6
add $s1, $s1, $s7
add $s0, $s0, $s1
la $a0, output_prompt # give Output prompt
move $a0, $s0
jal DispString
DispString:
addi $a0, $a0, 0
ConventionCheck:
addi $t0, $0, -1
addi $t1, $0, -1
addi $t2, $0, -1
addi $t3, $0, -1
addi $t4, $0, -1
addi $t5, $0, -1
addi $t6, $0, -1
addi $t7, $0, -1
ori $v0, $0, 4
la $a0, convention
addi $v0, $zero, -1
addi $v1, $zero, -1
addi $a0, $zero, -1
addi $a1, $zero, -1
addi $a2, $zero, -1
addi $a3, $zero, -1
addi $k0, $zero, -1
addi $k1, $zero, -1
jr $ra
ori $v0, $0, 10
# COPYFROMHERE – DO NOT REMOVE THIS LINE
# YOU CAN ONLY MODIFY THIS FILE FROM THIS POINT ONWARDS:
#TODO: write your code here, $a0 stores the address of the string
# Do not remove this line – it should be the last line in your function code