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 $s1, 0($gp) Iw $s2, 4($gp) addi $s 1, $s 1,5 addi $s2, $s2, 9 sw $81, 8($gp) sw $s2, 12($gp) add $s2, $s2, $s 1 sw $s2, 16($gp) 1. What are the memory addresses of variables x, y, z[O], z[1], and z[2]? 2. What are the values of variables x, y, z[0], z[1], and z[2] at the end of the program

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!