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
-
Georges friend Quentin was helping to renovate Georges home. George realized he needed some pipe to complete a plumbing installation, but didnt have any cash on him, so Quentin gave him $5. In...
-
Is it fair to consider modern ethics and philosophy as anthropocentric? Justify your response.
-
Suppose Bonzai Boards, Inc., had sales of \($180,000\) and sales returns of \($22,000.\) Cost of goods sold was \($110,000.\) How much gross profit did Bonzai Boards, Inc., report? a. ($48,000\) b....
-
Jimmy's Delicatessen sells large tins of Tom Tucker's Toffee. The deli uses a periodic review system, checking inventory levels every 10 days, at which time an order is placed for more tins. Order...
-
1. Need to have at least 3 out of 5 attributes better than the benchmark (row 26, Cells D-I), duration can be longer if you feel that the yields will drop 2. A minimum of 12 ETFS need to be used to...
-
1. Are the four intrinsic characteristics the best ones to base the relationship performance measures for Donnell Truong Ventures? If not, what characteristics would be more suitable? In either case,...
-
In 2012, the average credit score for loans that were purchased through Fannie Mae was 766. A random sample of 35 mortgages were selected, and it was found that the average credit score was 771with a...
-
Sunbeams cash flow from operations (CFFO) was negative, but at the same time the company was operating at a great profit, which signaled of inappropriately recorded _________________ .
-
According to the SECs AAER, which of the following was a method used by CUC to overstate its earnings? (a) Falsification of sales documents. (b) Side agreements with customers that were not recorded....
-
Explain why downsizing a company by closing segments or product lines that report an accounting loss often leads to a decrease in profits rather than an increase.
-
When Xerox factored or sold its accounts receivable to avoid reclassifying them as operating leases instead of sales-type leases, this had the effect of: (a) Decreasing the amount of revenue it...
-
Explain why a bill and hold sale causes cash flow from operations (CFFO) to lag behind operating income.
-
When determining the effect of a transaction on a financial ratio, the steps include Blank . journalize the transaction to see what accounts are affected post the transaction to the unadjusted trial...
-
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...
-
A machine of mass \(m=500 \mathrm{~kg}\) is mounted on a simply supported steel beam of length \(l=2 \mathrm{~m}\) having a rectangular cross section (depth \(=0.1 \mathrm{~m}\), width \(=1.2...
-
An electronic instrument, weighing \(1000 \mathrm{~N}\), is supported on a rubber mounting whose forcedeflection relationship is given by \(F(x)=157 x+0.2 x^{3}\), where the force \((F)\) and the...
-
The force-deflection relation of a steel helical spring used in an engine is found experimentally as \(F(x)=34.6 x+0.34 x^{2}+0.002 x^{3}\), where the force \((F)\) and deflection \((x)\) are...
Study smarter with the SolutionInn App