Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. Suppose we have the following AVR assembly program .org 0x00 LDI R20,0 LDI R21. 10 LooD: CALL F1 MP F2 DEC R21 BRNE Lo0D

image text in transcribed
7. Suppose we have the following AVR assembly program .org 0x00 LDI R20,0 LDI R21. 10 LooD: CALL F1 MP F2 DEC R21 BRNE Lo0D org 0x200 F1: INC R20 CALL F2 RET ora 0x320 F2: INC R20 CALL F3 RET org 0x400 F3: DEC R20 RET a) Translate the program into its machine code values (in Hexadecimal). Fill all the information in the table below to reflect the content of the program memory In binary In hex Address 0x000 0x200 0x320 0x400 b) Suppose that the stack pointer is initialized to be equal to the end of the RAM. 1 What would be the contents of the stack when the program reaches F1 for the first time? 2 What would be the contents of the stack when the program reaches F2 for the first time? 3) What would be the contents of the stack when the program reaches F3 for the first time? 4) What would be the contents of the stack when the program reaches F2 for the second time? 5) The program will generate a stack underflow. Explain why and find the value of the contents of R20 when it happens

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

Students also viewed these Databases questions

Question

Writing a Strong Introduction

Answered: 1 week ago