Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 : [ 1 0 points ] a ) The program given below has several errors and it consumes extra memory due to some

Question 2: [10 points]
a) The program given below has several errors and it consumes extra memory due to some instructions in the program. Rewrite the program to remove the errors and make it efficient so that it consumes less memory.
[5 points]
\table[[LDI R15,10 ; initialize loop counter,],[LDI 0,R17 ; clear R17,],[BACK: LDS R18, $100,],[ADD R17,R18,],[LDS R19, $30,],[SUB R19,R17,],[STS $32,R19,],[LDI R20,1,],[SUB R15,R20,],[BREQ DONE,],[JMP BACK,],[DONE: JMP DONE,]]
Hint: To reduce memory consumption, recall the memory map of the data address space
b) Write an assembly program to generate two square waves simultaneously - one on each pin PB3 and PB7, respectively, as indicated below. Subroutine called DELAY is available for use. Don't use timers here. [5 points]
\table[[Square wave of 20% duty cycle on PB3,
image text in transcribed

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 Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

=+What is the nature of the plant or site-level role of unions?

Answered: 1 week ago

Question

=+such as the dirigenti in Italy?

Answered: 1 week ago