Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help ASAP!! Question 3. a) Explain the difference between a Macro and a Subroutine. b) Consider the AVR assembly given in Listing 3-1. i.

Need help ASAP!!

image text in transcribed

Question 3. a) Explain the difference between a Macro and a Subroutine. b) Consider the AVR assembly given in Listing 3-1. i. All instructions in the program are 2 bytes long. What is the size of the code in bytes? ii. Explain the function of the symbols @0' and '@l' in the co iii. Determine the maximum delay this code can generate. Sho all your workings. Assume the processor is operating at 16 MHz iv. Given sample code showing how this macro could be called AVR assembly code. v. Write a subroutine that could achieve the same delay as thi macro. Give sample code showing how this subroutine coul be called vi. Discuss how longer delays could be achieved using the subroutine you wrote in part (v). Listing 3-1 nop .MACRO delay ldi @o,@1 loop: nop nop nop dec @o brne loop ENDMACRO

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions