Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MIPS code: strcpy: addi $sp, Ssp, -4 sw $s0. 0($sp) add $s0, $zero, $zero # i add # adjust stack for 1 item # save

image text in transcribedimage text in transcribed

MIPS code: strcpy: addi $sp, Ssp, -4 sw $s0. 0($sp) add $s0, $zero, $zero # i add # adjust stack for 1 item # save $s0 0 $t1, $a! in $t1 # addr of y[i] # $t2 = y[1] # addr of x[i] # x[i] = y[i] # exit loop if y[i] ?1: $50, in $t3 add $t3, $s0, Sa0 sb $t2, 0(St3) beq $t2, $zero, L2 addi $s0, $s0, 1 -0 L1 # next iteration of loop $sp,'4 #pes to reteavedSs addi $sp, $sp, 4 jr Sra # pop 1 item from stack # and return sp, MIPS code: strcpy: addi $sp, Ssp, -4 sw $s0. 0($sp) add $s0, $zero, $zero # i add # adjust stack for 1 item # save $s0 0 $t1, $a! in $t1 # addr of y[i] # $t2 = y[1] # addr of x[i] # x[i] = y[i] # exit loop if y[i] ?1: $50, in $t3 add $t3, $s0, Sa0 sb $t2, 0(St3) beq $t2, $zero, L2 addi $s0, $s0, 1 -0 L1 # next iteration of loop $sp,'4 #pes to reteavedSs addi $sp, $sp, 4 jr Sra # pop 1 item from stack # and return sp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions