Question: After executing the following code, please answer the question: int x; int * ptr; ptr = &x; for ( i = 0 ;i < 6
After executing the following code, please answer the question:
int x;
int ptr;
ptr &x;
for i;i;i
ptri;
ptr;
What's in x
We know &xx &x
Translate above C code to assembly language. Please choosefill in the correct answer of the blank:
data
x: word :
text
li $s #$s i
la $sx # $s &x
li $t
$s$t exit
loop: $s$s
addi $s$s #ptr
addi $s$s
$s$tloop
exit: li $v
syscallAfter executing the following code, please answer the question:
int x;
int ptr;
ptr &x;
for i;i;i
ptri;
ptr;
What's in x
We know &xx &x
Translate above C code to assembly language. Please choosefill in the correct answer of the blank:
data
x: word :
text
li $s #$s i
la $sx # $s &x
li $t
$s$t exit
loop: $s$s
addi $s$s #ptr
addi $s$s
$s$tloop
exit: li $v
syscall
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
