Question: Do practice problem 3.37 of page 258 with the expressions shown below, where x_s, the address of short integer array S and long integer index
Do practice problem 3.37 of page 258 with the expressions shown below, where x_s, the address of short integer array S and long integer index i are stored in registers %rdx and %rcx, respectively while the result should be store in register %rax if it is a pointer and register element %ax if it has data type short:
| Expression | Type | Value | Assembly code | |
|---|---|---|---|---|
| (a) | S[2] | |||
| (b) | S+2 | |||
| (c) | &S[i] | |||
| (d) | S[2*i+1] | |||
| (e) | S+i-2 | |||
| (f) | *(S+i-2) | |||
| (g) | S+(++i)+2 | |||
| (h) | *(S+(i++)+2) | |||
| (i) | *S-- | |||
| (j) | *(S--) |
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
