Home /
Expert Answers /
Computer Science /
consider-two-c-int-arrays-a-and-b-the-base-address-of-a-is-held-by-s1-and-b-s2-variable-i-pa223
(Solved): Consider two C++ int arrays A and B. - The base address of A is held by $s1, and B$s2. - Variable i ...
Consider two C++ int arrays A and B. - The base address of A is held by $s1, and B$s2. - Variable i is an index into A. Assume i is never out of index bound. - Variable x and y are C++ int variables. Write the instructions corresponding to the C++ code below. A[i]=B[i?3]+(B[i?2]?20); 1 \# Line 2?6 compute the addr. of B[i]2# The addr. of B[0]=R[$ 3 \# The Byte offset of B[i] based off B[0]=4?#$ to = Byte offset of B[i] 4 5 \# The addr. of B[i]=addr. of B[ 6 7 \# The Byte offset of B[i?2] based off B[i]= 8 9 #$t3=B[i?2]?20 10 \# The Byte offset of B[i?3] based off B[i]=11#$t4=B[i?3] 12 13 \# Iine 14?17 compute the addr. of A[i]14# The addr. of A[0]=R[$ 15 \# The Byte offset of A[i] based off A[0]=R[$16# The addr. of A[i]=addr. of A[ ]+R[S 17 #$t 6 = address of A[i] 18 \# The Byte offset of A[i] based off A[i]= 19