Question: Write a MIPS Assembly Language Code for the following: Write a MIPS program to allow users to enter a string, which might be up to

Write a MIPS Assembly Language Code for the following:

Write a MIPS program to allow users to enter a string, which might be up to 64 byte long, via I/O window, and is saved to array X. The inputted string is then copied array X to array Y. You can manipulate the following procedure.

Write a MIPS Assembly Language Code for the following: Write a MIPS

Note that the procedure assumes address of x is in $a0, and y in $a1.

Your program should loop so that users can enter a new string without re-assembling the program. So After one string copy is done ask the user to enter another string.

Code in MIPS Assembly Language Only Please

strcpy: addi $sp, $Ssp, -4 # adjust stack for 1 item # save $s0 so, $zero, $zero # 1 =0 LI: a addr ot y in $t 1bu $t2, o(St1) add $t3, $s0, $a0 sb $t2, o(St3) beq $t2, $zero, L2 addi $s0, # addr of x[i] # in $t3 x[i] = y[1] # next iteration of loop # restore saved Ss0 # pop 1 item from stack 1 addi Ssp, Ssp, 4 ra and return strcpy: addi $sp, $Ssp, -4 # adjust stack for 1 item # save $s0 so, $zero, $zero # 1 =0 LI: a addr ot y in $t 1bu $t2, o(St1) add $t3, $s0, $a0 sb $t2, o(St3) beq $t2, $zero, L2 addi $s0, # addr of x[i] # in $t3 x[i] = y[1] # next iteration of loop # restore saved Ss0 # pop 1 item from stack 1 addi Ssp, Ssp, 4 ra and return

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!