hw18SLN - ECE 212 HW 18 SOLUTIONS p 1 of 9

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 212 HW 18 SOLUTIONS p 1 of 9 //home/vdimitrov/8658/e65e19758e59ea2118063531ec2b46977f330bb4.doc ECE 212 Homework Set 18 – SOLUTIONS 1. Below are list files for the E2B interrupt routine presented in lecture and the subroutine bin2segs . Also shown are memory contents and the Stack Pointer. Show the memory contents and Stack Pointer immediately after the pshx instruction is executed in the bin2segs subroutine. Assume that when the interrupt strikes, the register contents are: A = AA B = BB X = 1234 Y = 5678 CCR = 05 PC = 0123 List File: 4 ;Name: E2B (Interrupt Routine) 5 ;Description: Read the data from the source, 6 ; convert it to segment data, 7 ; and send to the 7-segment LED 8 ; connected to Port B. 9 E2B: 0000 [04] B6100A 10 ldaa PortE ;Get the data, 0003 [06] BD000A 11 jsr bin2segs ; convert it to segment data, 0006 [04] B71004 12 staa PortB ; and send to Port B. 0009 [12] 3B 13 rti 16 ;Name: bin2segs . . . 23 bin2segs: 000A [03] 37 24 pshb ;Save the regisers 000B [04] 3C 25 pshx ; we're using. . . . 0017 [05] 39 38 rts ; and return. Memory:
Background image of page 1

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

View Full DocumentRight Arrow Icon
ECE 212 HW 18 SOLUTIONS p 2 of 9 (1.) Solution:
Background image of page 2
ECE 212 HW 18 SOLUTIONS p 3 of 9 2. Shown below is an output device that requests data by asserting its Ready output. Ready is active- Low and is connected to the active-Low 6812 IRQ pin. Also shown (next page) is a list file for a main program, two subroutine skeletons and an interrupt routine specification. The main program fills a data buffer and sets everything up for the interrupts to occur. The interrupt routine sends one Byte from the buffer to the output device. (a) Complete the table to give the contents of memory locations 0132 through 0134 after the instruction stx BuffPtr executes. Program execution begins at location 0100. (b) Write the interrupt routine as specified in its documentation.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This homework help was uploaded on 04/17/2008 for the course ECE 212 taught by Professor Greco during the Spring '08 term at Lafayette.

Page1 / 9

hw18SLN - ECE 212 HW 18 SOLUTIONS p 1 of 9

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

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