Question: 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
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
Get step-by-step solutions from verified subject matter experts
