sample_exam3_A09

sample_exam3_A09 - Name:_ ECE2801 PRACTICE EXAM #3 Box:_...

Info iconThis 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).
Background image of page 1

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

View Full DocumentRight 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 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   . . . .   e)  What values are in RESHI and RESLO at the end of this code segment?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

sample_exam3_A09 - Name:_ ECE2801 PRACTICE EXAM #3 Box:_...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online