Consider a program that declares global integer variables x, y,
z[10] (z is an
array with size 10). Assume that an integer occupies 4 bytes. These
variables
are allocated starting at a base address of decimal 2000. All these
variables
have been initialized to zero. The base address 2000 has been
placed in $gp.
The program executes the following assembly instructions:
lw $s1, 0($gp)
lw $s2, 4($gp)
addi $s1, $s1, 13
addi $s2, $s2, 17
sw $s1, 8($gp)
sw $s2, 12($gp)
sub $s2, $s2, $s1
sw $s2, 16($gp)
1. What are the memory addresses of variables x, y, z[0], 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?
please help my assembly questions?
Consider a program that declares global integer variables x, y, z[10] (z is an array with size 10). Assume that an integ
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am