Registers t1 has the base address of the given array and s0

Registers $t1 has the base address of the given array and $s0 is holding the value for variable y. A[500]= y+ A[200]; Compile the given array in C to MIPS Assembly language.

Solution

A[500]=y+A[200]

Below is the equivalent instruction of above line in assembly language

ADD $t1(500), $t0, $t1(200)

Here we are using add instruction to add $t0 which is holding the value of y and $t1(200) which is holding the value as A[200]

 Registers $t1 has the base address of the given array and $s0 is holding the value for variable y. A[500]= y+ A[200]; Compile the given array in C to MIPS Asse

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site