3. Consider the C program and simplified memory map for a 16-bit microcontroller shown below. Assume...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 <stdio.h> 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", 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. 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 <stdio.h> 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", 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.
Expert Answer:
Answer rating: 100% (QA)
Refer the given information in the textbook and assume th... View the full answer
Related Book For
Multinational Business Finance
ISBN: 978-0132743464
13th edition
Authors: David K. Eiteman, Arthur I. Stonehill, Michael H. Moffett
Posted Date:
Students also viewed these general management questions
-
Explain in your own words why it is important to consider the ranges of the consequences in determining a trade-off weight.
-
Explain goal-setting theory. Discuss why it is important to select the right set of performance metrics.
-
Explain in about one sentence why it is important to animals for the major carbohydrate storage polymer, glycogen, to be branched rather than unbranched.
-
In Problems 23 34, graph each system of linear inequalities. x - 2y 6 2x - 4y 0
-
Analyze movements across the strategic groups in the U.S. retail industry. How do these movements within this industry change the nature of competition?
-
Suppose X Uniform(0, 1), and given X = x, Y Exponential ( = 1/2x). a. Find the linear MMSE estimate of X given Y . b. Find the MSE of this estimator. c. Check that E[XY ] = 0.
-
1 Show the accounts involved in the transactions below under the main five headings of the financial statements (i.e. assets, liabilities, equity, revenue and expenses): 2 Advise what accounts would...
-
In deciding to go to a new organizational form, what impact should the capabilities of the following groups have on your decision? a. Top management b. Middle management c. Lower-level management
-
Find the area of the shaded region. The total area of the shaded reg (Simplify your answer.) 49- y= 49-x 35 21- 7 -5 -3 -17 1 3 to -21- -35 75 60
-
Following are the ordinates of a storm hydrograph of a river draining a catchment area of 423 km due to a 6h storm.. Derive the ordinates of 6h unit hydrograph & plot the same. Time in hr -6 Stream...
-
3 The following information is available for Lock-Tite Company, which produces special-order security products and uses a job order costing system. April 30 May 31 1.11 points Finished goods eBook...
-
How do organizational leaders cultivate a culture of commitment that transcends mere compliance, leveraging strategies like transformational leadership and authentic communication ?
-
Review a new HIPAA training plan for new staff at the brand new Seattle Grace Hospital scheduled to open next June. As you know, HIPAA is a complex set of laws requiring institutions to build and...
-
Describe a change you have either participated in or observed in your organization. Using the eight-step model of change, analyze which suggested strategies were employed and which were not. Was the...
-
How does organizational culture shape the perception and acceptance of diversity, equity, and inclusion (DEI) initiatives, and what are the key factors that drive a successful DEI transformation ?
-
Let g(s) (4s-6)9. = Then g'(s) is 36(4s-6) g'(5) is g'(s) is and g'(5) is
-
The 2021 balance sheet for Hallbrook Industries, Inc., is shown below. HALLBROOK INDUSTRIES, INC. Balance Sheet December 31, 2021 ($ in thousands) Assets Cash $ 390 Short-term investments Accounts...
-
Apply Jacobis method to the given system. Take the zero vector as the initial approximation and work with four-significant-digit accuracy until two successive iterates agree within 0.001 in each...
-
What are the advantages and disadvantages of limiting a firms activities to exporting compared to producing abroad?
-
In the context of unbundling cash flows from subsidiary to parent, why might a host government be more lenient in its treatment of fees than its treatment of dividends? What difference does it make...
-
A leveraged buyout is a financial strategy in which a group of investors gain voting control of a firm and then liquidate its assets in order to repay the loans used to purchase the firms shares. How...
-
The greater the number of shares in a portfolio, the less the marginal contribution to diversification of an additional security will be. True or false?
-
Under which circumstances can the risk of a portfolio be less than the individual risk of each of the securities it contains?
-
What is the drawback of the coefficient?
Study smarter with the SolutionInn App