HW3_Solutions - Electrical Computer Telecommunications...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Electrical, Computer, & Telecommunications Engineering Technology Micro Computers 20073 0618-303 Homework #3 HOMEWORK #3 Due 4/4/08 1. ; This is the program for HW3 .include “m128def.inc” .def Temp1 = R16 .def Temp2 = R17 .def Temp3 = R18 .org 0x0000 rjmp RESET RESET: ; start loop here ldi Temp1, a OUTER ldi Temp2, b MIDDLE: ldi Temp3, c INNER: dec Temp3 brne INNER dec Temp2 brne MIDDLE dec Temp1 brne OUTER ; end program here Derive the equation for the time delay of this nested loop in terms of a, b and c. 2. Design the flowchart and the program code for a program that does the following: Determine which pushbutton on the mega128.2 board is being pressed (S1-S8) Output to the LEDs the binary code for the button number (0001 for S1 and1000 for S8, for example) of the button being pushed. You can assume only one button at a time will be pushed. If no button is being pushed, all the LED’s should be off. 3. If you use the PUSH and POP instructions within a subroutine to temporarily store and retrieve data, why is it critical that you have the same number of PUSHes as you do POPs?
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern