Please show how to solve all three parts of the question.
Prob 1. (60 points) Assume the address of a 16-element uint8_t array my_arr is 0x2000_0100 and the values are given in the table below.
Address
Byte 0 Byte 1
0x2000_0100: 0x2000_0102: 0x2000 0104 0x2000 0106: 0x2000 0108: 0x2000 010A
0x00 0x04 0x08 0x0C 0x10 0x14
0x02 0x06 0x0A 0x0E 0x12 0x16
Assume we run the following code to print out some values.
uint8_t *p8a = (uint8_t *0x20000100; uint8_t *p8b = (uint8_t *)0x2000010C; 3 *p8b++= *(p8a + 2); *p8b++ = ++*(p8a + 4); :++egd*++=++qgd *p8b++ = *p8a++;
Determine
1. (10 points) The addresses and values that have been changed by the right side expressions of the statements in lines 4 to 7. For example, if we run *p8b = ++*++p8a as the first line of runnable code, then, we would have the value at address 0x2000_0101 changed from 2 to 3.
2. (20 points) The four 8-bit values in the memory starting at address 0x2000_010C after running the above code.
3. (30 points, 5 pts for lines 4 and 7 each and 10 points for lines 5 and 6 each) Write the code in lines 4 to 7 in an assembly function with the following prototype and call instance:
void my_fn(uint8_t *pa,uint8_t *pb); my_fn(p8a, p8b);