Question: NEED DONE ASAP a) explain the direrence between a viacro and a subroutine. 6 Marks b) Consider the AVR assembly given in Listing 3-1. i.

NEED DONE ASAP a) explain the direrence between a viacro and aNEED DONE ASAP

a) explain the direrence between a viacro and a subroutine. 6 Marks 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? 2 Marks ii. Explain the function of the symbols '@O' and '@1' in the code. 2 Marks iii. Determine the maximum delay this code can generate. Show all your workings. Assume the processor is operating at 16 MHz 6 Marks iv. Given sample code showing how this macro could be called in AVR assembly code. 4 Marks v. Write a subroutine that could achieve the same delay as this macro. Give sample code showing how this subroutine could be called 6 Marks vi. Discuss how longer delays could be achieved using the subroutine you wrote in part (v). 4 Marks Total 30 Marks Listing 3-1 .MACRO delay ldi @o, @1 loop: nop nop nop nop dec @o brne loop . ENDMACRO Page 7 of 11

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!