ch4 part B - EEL 3801 EEL 3801 Computer Organization...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: EEL 3801 EEL 3801 Computer Organization Computer Organization Spring 2010 Spring 2010 Chapter 4 Chapter 4 Input/Output Organization Input/Output Organization Hamacher et al , Computer Organization Acknowledgment and appreciation for various slide materials from Dr. Philip Wilsey, Dr. Randy Katz, Dr. Philip Leong Slide 1 of 17 Example s Suppose s Processor uses vectored interrupts s Starting address of ISR stored at INTVEC in memory s Interrupts enabled by setting bit 9 (the IE bit) in the processor status word s Keyboard and display devices are connected to the processor KEN SOUT CONTROL DATAIN Figure 4.3. Registers in keyboard and display interf aces. DEN DATAOUT 7 KIRQ SIN STATUS 6 5 4 3 2 1 DIRQ Slide 2 of 17 Example s To initialize the ISR s Load starting address of ISR to INTVEC s Load address LINE to PNTR (input chars will be stored here) s Enable keyboard interrupts (set bit 2 in register CONTROL) s Enable processor interrupts (set IE bit in processor status word PS) s ISR s Read input character from keyboard input register (will cause the interface circuit to remove interrupt request) s Store character to location PNTR and increment PNTR s When end of the line reached, disable keyboard interrupts and inform program Main s Return from interrupt Slide 3 of 17 Example Main Program Move #LINE,PNTR Initialize buffer poin ter. Clear EOL Clear end-of-line indicator. BitSet #2,CONTR OL Enable keyboard interrupts. BitSet #9,PS Set in terrupt-enable bit in the PS. . . . In terrupt-service routine READ MoveMultiple R0-R1, (SP) Save registers R0 and R1 on stack. Move PNTR,R0 Load address pointer. MoveByte DATAIN,R1 Get input character and MoveByte R1,(R0)+ store it in memory . Move R0,PNTR Update pointer. CompareByte #$0D,R1 Check if Carriage Return. Branc h RTRN Move #1,EOL Indicate end of line. BitClear #2,CONTR OL Disable keyboard interrupts....
View Full Document

Page1 / 17

ch4 part B - EEL 3801 EEL 3801 Computer Organization...

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

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