Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

7· The table below shows the contents of several memory locations. Each loca- Ex

ID: 3585400 • Letter: 7

Question

7· The table below shows the contents of several memory locations. Each loca- Expression R-value L-value addr R-vaiue L-value addr tion is identified by its address and also by the name of the variable stored there. All numbers are shown in decimal a. m Variable Address Contents Variable Address Contents C. 1040 1056 1008 1032 1052 1000 1080 1020 1064 1044 1016 1076 1028 1076 1016 1088 1044 1064 1020 1080 1000 1052 1008 1056 1096 1084 1068 1004 1060 1036 1092 1012 1072 048 2000 1024 1072 1048 2000 1012 1092 1036 1060 1080 1068 1000 9. &e; 1 k. k1 L n1) m. h-4 Using these values, evaluate each of the expressions below four ways. First, assume that all the variables are integers, and find the expression's R-value. Then find its L-value, and give the address of the location it specifies. Next, assume that all the variables are pointers to integers and repeat the exercise. Note: Do your address arithmetic based on four-byte integers and pointers. t. Y

Explanation / Answer

Integers Pointer to integers
Expression R-value L-value addr R-value L-value addr
a m 1008 1016 1008 1016
b v+1 1037 1092 1040 1092
c j-4 996 1064 984 1064
d a-d 12 1040 Unknown 1040
e v-w -24 1092 Unknown 1092
f &c 1056 1056 1056 1056
g &e+1 1037 1032 1036 1032   
h &o - 4 1080 1096 1080 1096
i &(f+2) 1046 1044 1044 1052
j *g 1000 1000 1000 1000
k *k+1 1045 1044 1045 1052
l *(n+1) Unknown 1076 Unknown 1076
m *h-4 1076 1080 1076 1080
n *(u-4) Unknown 1036 1080 1036
o *f-g -12 1052 -12 1052
p *f-*g 52 1052 52 1052
q *s-*q -80 1004 -80 1004
r *(r-t) Unknown 1068 Unknown 1068
s y>i 0 1048 0 1048
t y>*i 1 1048 1 1048
u *y>*i 1 1048 1 1048


Note : Assuming expresssion is storing into the first variable itself.
Ex:- v = v+1
Unknown means content of the address is not mentioned in the table.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote