HW_07 - CS/ECEn 124 W2012 Homework#7 Stacks(Ch 8...

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

View Full Document Right Arrow Icon
CS/ECEn 124, W2012 Homework #7 Stacks (Ch 8) Interrupts (9) Name Section Score / 36 Questions: Answers: 1. (3 points) Define subroutine cohesion. What properties of cohesion should be found in your subroutines? 2. (3 points) Define subroutine coupling. What properties of coupling should be found in your subroutines? 3. (6 points) What is wrong (if anything) with the following blinky program? DELAY .equ 100 mainloop: xor.b #0x01,&P1OUT ; toggle P1.0 push.w #DELAY ; pass delay call #delay ; call delay jmp mainloop delay: push.w r15 ; callee-save mov.w #0,r15 ; init counter delay02: dec.w r15 ; delay over? jne delay02 ; n dec.w 2(SP) ; y, outer done? jne delay02 ; n pop.w r15 ; y, restore r15 ret ; return 4. (6 points) What would be the difference in code size and the cycles used to toggle the LED on and off then (assume it is off), if the delay subroutine below was placed in-line? DELAY .equ 10 mainloop: xor.b #0x01,&P1OUT ; toggle P1.0 mov.w #DELAY,r15 ; pass delay call #delay ; call delay jmp mainloop delay: dec.w r15 ; delay over?
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