Question

What is Stack Pointer (SP) register and its size in AVR? Before initializing, its default value...

What is Stack Pointer (SP) register and its size in AVR? Before initializing, its default value is $0000. (i) Is it fine to keep SP register with this default value, why/why not? (ii) If we want to initialize the SP register with last RAM location, what will be the value in Hexadecimal for a RAM having total size of 16KB?

Homework Answers

Answer #1

Stack Pointer = The Stack Pointer (SP) register is used to indicate the location of the last item put onto the stack. When you PUT something ONTO the stack (PUSH onto the stack), the SP is decremented before the item is e item is placed on the stack. When you take something OFF of the stack (PULL from the stack), the SP is incremented after the item is e item is pulled from the stack. Before you can use a stack you have to initialize th itialize the SP to point to one value higher than the highest memory location in the stack. For the HC12 use a blo e a block of memory from about $3B00 to $3BFF for the stack. For this region of memory, initialize th itialize the stack pointer to $3C00. Use LDS (Load Stack Pointer) to ter) to initialize th itialize the stack pointer. The stack pointer is initialized o itialized only one time in e time in the program.

SP register size is 8 or 16 bit

i) Default value of the stack pointer is 0x0000. Therefore programmers have to initialize a stack before use it. z The stack pointer always points to the top of the stack z Definition of the top of the stack varies: z the location of Last-In element; E.g, in 68K z the location available for the next element to be stored E.g. in AVR.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Q1 ) We are writing a subroutine, and want to use $t0. What are the considerations?...
Q1 ) We are writing a subroutine, and want to use $t0. What are the considerations? (check all that apply) 1 - We know that the routine which called us gives us permission to use this register, so we don't have to save its value before using it. 2 - The routine which called us may have an important value in that register, so we should save its value before using it. 3- We know that the subroutine won't touch...
Leave comments on code describing what does what Objectives: 1. To introduce pointer variables and their...
Leave comments on code describing what does what Objectives: 1. To introduce pointer variables and their relationship with arrays 2. To introduce the dereferencing operator 3. To introduce the concept of dynamic memory allocation A distinction must always be made between a memory location’s address and the data stored at that location. In this lab, we will look at addresses of variables and at special variables, called pointers, which hold these addresses. The address of a variable is given by...
what is the issue in Emaar case study ? (10marks) Emaar Properties specializes in creating value-added,...
what is the issue in Emaar case study ? (10marks) Emaar Properties specializes in creating value-added, master-planned communities that meet the full spectrum of lifestyle needs. Highlights include Downtown Dubai, the 500-acre mega-project including Burj Khalifa – the world’s tallest building, and The Dubai Mall—the world’s largest shopping and entertainment destination. Emaar is extending its expertise in developing master-planned communities internationally, and has established operations in the United Arab Emirates, Saudi Arabia, Syria, Jordan, Lebanon, Egypt, Morocco, India, Pakistan, Turkey,...
Analysis: This section should include the issue register as a bare minimum, but may include also...
Analysis: This section should include the issue register as a bare minimum, but may include also why-why diagrams, a Pareto chart, a waste table and/or value-added analysis table. Flow analysis or simulation of this case study might be possible but might require making a lot of assumptions given the provided data. The first part of the project: Introduction    Walmart has continued to retain the top position on the Fortune 500 list for a consecutive fifth year. The brand has...
Read the LDC Cloud Systems Case Study and answer the question below: THE EMAIL The email...
Read the LDC Cloud Systems Case Study and answer the question below: THE EMAIL The email had been sent from one mid-level accounting manager at headquarters to another about six months earlier. The message read: Bill, here are the accounting issues I mentioned, and as you know, some of these go back a ways. The data that supports these accounts are not always clear and keep changing, and we are not sure what the correct accounting treatment is for these...
Answer the following questions from the information below a. What are the organization's marketing goals? b....
Answer the following questions from the information below a. What are the organization's marketing goals? b. What are the symptoms of the problem? In other words, which of the organization's marketing goals mentioned in section a., above are not being met? c. What is the organization's problem? Look at the symptoms and make a judgement about what their cause may be. Do not confuse symptoms with problems. Problems cause symptoms. d. Perform a SW/OT analysis: -What are the organization's internal...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
What are your top 3 take aways from this article? Technology is no longer just for...
What are your top 3 take aways from this article? Technology is no longer just for geeks. The internet has changed everything, including marketing. Be they small, medium or large, social media grants all companies an equal playing field on which to organically reach new customers. However, success will always ride on the marketing strategy employed. Obviously, larger companies have the advantage of bigger budgets and more resources. But that doesn’t mean social media for small business owners can’t compete...
Team 5 answer the questions What are 4 key things you learned about the topic from...
Team 5 answer the questions What are 4 key things you learned about the topic from reading their paper? How does the topic relate to you and your current or past job? Critique the paper in terms of the organization and quality. Incentive Systems             In this paper, we will focus primarily on financial rewards that companies use to attract, retain and motivate the brightest and most talented candidates in the labor market. By providing a reward system that...