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].](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f087a52de69_39666f087a4b4f58.jpg)
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
Get step-by-step solutions from verified subject matter experts
