Question: 3. Consider the C program and simplified memory map for a 16-bit microcontroller shown below. Assume that the stack grows from the top (area

3. Consider the C program and simplified memory map for a 16-bit 

3. Consider the C program and simplified memory map for a 16-bit microcontroller shown below. Assume that the stack grows from the top (area D) and that the pro- gram and static variables are stored in the bottom (area C) of the data and program memory region. Also, assume that the entire address space has physical memory associated with it. i #include 2 #define FOO 0x0010 3 4 5 6 7 8 9 10 11 int n; int m; void foo (int a) { if (a > 0) { } 12 13 14 15 16 } n = n + 1; foo (n); } int main() { n = 0; m foo ( *m); printf("%d ", n) ; (int.) FOO; B A data and program memory stack program and static variables memory-mapped I/O interrupt vectors 0xFFFF 0x0020 0x001F 0x0010 0x000F 0x0000 You may assume that in this system, an int is a 16-bit number, that there is no op- erating system and no memory protection, and that the program has been compiled and loaded into area C of the memory. (a) For each of the variables n, m, and a, indicate where in memory (region A, B, C, or D) the variable will be stored. (b) Determine what the program will do if the contents at address 0x0010 is 0 upon entry. (c) Determine what the program will do if the contents of memory location Ox0010 is 1 upon entry.

Step by Step Solution

3.53 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Refer the given information in the textbook and assume th... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!