Question: Consider a program that declares global integer variables x, y, z[10]. These variables are allocated starting at a base address of decimal 1000. All these

 Consider a program that declares global integer variables x, y, z[10].

Consider a program that declares global integer variables x, y, z[10]. These variables are allocated starting at a base address of decimal 1000. All these variables have been initialized to zero. The base address 1000 has been placed in $gp. The program executes the following assembly instructions: lw $s 1, O($gp) lw $s2, 4($gp) addi $s 1, $s1,5 addi $s2. $s2,9 sw $51. 8($gp) sw $s2, 12($gp) add $s2. $s2, $51 sw $s2, 16($gp) Question 1 1 pts What are the memory addresses of the following variables? the third element of array z Question 2 1 pts What are the values of the following variables at the end of the program? the first element of array z the second element of array z the third element of array z Consider a program that declares global integer variables x, y, z[10]. These variables are allocated starting at a base address of decimal 1000. All these variables have been initialized to zero. The base address 1000 has been placed in $gp. The program executes the following assembly instructions: lw $s 1, O($gp) lw $s2, 4($gp) addi $s 1, $s1,5 addi $s2. $s2,9 sw $51. 8($gp) sw $s2, 12($gp) add $s2. $s2, $51 sw $s2, 16($gp) Question 1 1 pts What are the memory addresses of the following variables? the third element of array z Question 2 1 pts What are the values of the following variables at the end of the program? the first element of array z the second element of array z the third element of array z

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!