Fill out the blank spaces in the table below. Assume ints are 32 bits and pointe
ID: 3790778 • Letter: F
Question
Fill out the blank spaces in the table below. Assume ints are 32 bits and pointers are 64 bits. All sizes should be in bytes. For each entry in the table below, list what you would need to add to the base address of the array to get the offset for given element. In other words, for char A, if &A; is x, what do you add to x to get the address of A[i]? Your answer should be in bytes. Assume the base address of S is in %rdx, and i is %rcx. S is an array of 32 bit integers. For each of the examples below, show how you would generate the address for the example in x86 memory format (i.e. D(rbx, rbi, S))Explanation / Answer
1. Assumption: Integers are 32 bits, i.e., 4 bytes. Pointers are 64 bits, i.e., 8 bytes. Characters are 8 bits, i.e., 1 byte. Longs are 64 bits, i.e., 8 bytes.
2.
Array Declaration Element Size Total Size of Array char A[5] 1 5 int B[12] 4 48 int *C[4] 8 32 long D[3] 8 32 int E[3][2] 4 24Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.