Please answer Question 2 using Question 1I posted my answer

Please answer Question 2 using Question 1...I posted my answer to Question 1.

I have attached my answer to Question1....Please answer question 2 using Question1

Background: asciiz stores a string with the null terminator 3 data 4 lower asci iz \"hola 5 upper .asciiz \'\'xxxx\'\' 0x10010000 a l o h x x x 10 10 10 10 x .ascii stores a string without a null terminator 3 data 4 lower ascii \"hola 5 upper .ascii \"xxxx\" 0x10010000 a l o h x x x x Since MIPS stores a string as ASCII bytes, it will make sense to use the lbu/sb load/store byte instructions. 1. Write a MIPS program to copy a lowercase string to another string, converted to uppercase. For example: \"hola\" should become \"HOLA\". Store string lower as asciiz and reserve space for string upper using space. Look up an ASCII table in hex online or in the notes and notice the difference in hex between upper and lower case letters to figure out how to easily convert from one to the other. Your program should loop until it encounters the null terminator. Take a screen shot of the program code. Take another screen shot of the memory area after the program ran, but check the ASCII box below the memory window.

Solution

.data
firsttyped: .asciiz \"\"
newline: .asciiz \"\ \"
.text
main:
    li $v0, 8
    li $a1, 20
    la $a0, firsttyped
    syscall
    li $v0, 4
    li $t0, 0
loop:
    lb $t1, firsttyped($t0)
    beq $t1, 0, exit
    sub $t1, $t1, 32
    sb $t1, firsttyped($t0)
    addi $t0, $t0, 1
    j loop
exit:
    li $v0, 4
    la $a0, firsttyped
    syscall

    li $v0, 10
    syscall

Please answer Question 2 using Question 1...I posted my answer to Question 1. I have attached my answer to Question1....Please answer question 2 using Question1

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site