{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info iconThis 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?
Background 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 ]}