{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sample_exam3_A09

sample_exam3_A09 - Name ECE2801 PRACTICE EXAM#3 Box Show...

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

View Full Document Right Arrow Icon
Name: ________________________  Box:________ ECE2801  PRACTICE EXAM #3   Show all work. Sign your test and all scrap paper. Circle final answer for  each part of each question. Points are as indicated.  Good Luck! 1)  Fully answer the questions below. (25 pts)   a) What is program counter (PC) and why is it important?   b) A certain embedded system received data very infrequently from Port 1         Pin 5.  The system programmer decides to use interrupts to service the input         yet every time the Port 1 Pin 5 input is activated the system fails. Why? port1_ISR  ; Interrupt service routine for Port 1 PUSH   R5   CLR   R5 MOV.B  P1IN, R5 PUSH   R4            MOV    #0020h,R4 AND.B  R4,R5      MOV.B  R5, pin5     ; pin5 was declared as DS8 POP    R4 ; restore R4 RETI   c) Explain the operation of the instruction   CALL #adder   and its effect of the        stack pointer (SP) and program counter (PC).
Image of page 1

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

View Full Document Right Arrow Icon
  d)  Find 5 different errors (or at least examples of bad programming practice) in          the code segment below   badProc ;  This  procedure  has some problems PUSH  R4 PUSH  R5 MOV   A, R5 MOV   &B, R4 CMP  R5, R4 JZ    exitError   ; SUB   R4, R5 DEC   PC MOV   SP, R7 ADD   R7, #1000h POP   R4 POP   R5         RETI exitError  ; main error handler
Image of page 2
Image of page 3
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