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
-
Information from the March 31, 2014, year-end, unadjusted trial balance of The Online Store is as follows: Required 1. Copy the unadjusted trial balance on a work sheet form and complete the work...
-
Esquire Products Inc. expects the following monthly sales: Cash sales are 40 percent in a given month, with the remainder going into accounts receivable. All receivables are collected in the month...
-
Prove that \(b(x ; n, p)=b(n-x ; n, 1-p)\).
-
January 1, 2017, Heckert Company purchases a controlling interest in Aker Company. The following information is available: a. Heckert Company purchases 1,600 shares of Aker Company outstanding stock...
-
Consider a standard quadratic equation in the form ax + bx + c = 0 where a =1, b=6, c= 6. Rewrite it in complete square form (x + f) = g
-
A rigid foundation is subjected to a vertical column load, P = 355 kN, as shown in Figure 11.43. Estimate the elastic settlement due to the net applied pressure, ÎÏ, on the foundation....
-
My product name is Bidet. (A device that is installed in your toilet bowl to help wash and clean one's rear end. Although it is attached to the toilet, a bidet is connected to the water line behind...
-
What do you think about the differences that exist between rights that attach in the area of criminal legal representation versus those that exist in the realm of civil legal assistance? Does it seem...
-
Because of organizational restructuring directives from your boss, the department you manage must reassign team members to new project teams. You are thinking of asking a highly capable and...
-
In 2020, American Airlines was honored by the Human Rights Campaign (HRC) with the highest possible rating (a score of 100%) in the prestigious 2020 Corporate Equality Index (CEI). American has...
-
Young children usually have a fair degree of hyperopia. As they grow, their eyeballs lengthen and the hyperopia usually clears up. Given what you know about accommodation, explain why young children,...
-
Diffraction can be used to provide a quick test of the size of red blood cells. Blood is smeared onto a slide, and a laser shines through the slide. The size of the cells is very consistent, so the...
-
The mechanism shown in the figure below consists of four bars and two revolute joints at points O2 and 04. Note that the links are balanced and w is constant. For this mechanism find: a) The...
-
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...
-
Use Minitab to obtain the results of Tukey's test for the shear bond strength data from Example 1 in Section 13.1. Approach The steps for obtaining the results of Tukey's test using Minitab, Excel,...
-
Another scientist examines how the presence of a nonnative bird species, the starling, affects other species of birds. Is this a population-level study, a community-level study, or an ecosystem-level...
-
What is the function of the placenta?
Study smarter with the SolutionInn App