wisconsin
Chapter 9: I/O

Chapter 9: I/O

Content locked

The catalog is public. Reading this content requires approved access.

Sign in to read
Chapter 9: I/O
9.1 Privilege, Priority, and the Memory Address Space
9.1.1 Privilege and Priority
9.1.1.1 Privilege
9.1.1.2 Priority
9.1.1.3 Two Orthogonal Notions
9.1.1.4 The Processor Status Register (PSR)
9.1.2 Organization of Memory
9.2 Input/Output
9.2.1 Some Basic Characteristics of I/O
9.2.1.1 Memory-Mapped I/O vs. Special I/O Instructions
9.2.1.2 Asynchronous vs. Synchronous
9.2.1.3 Interrupt-Driven vs. Polling
9.2.2 Input from the Keyboard
9.2.2.1 Basic Input Registers (KBDR and KBSR)
9.2.2.2 The Basic Input Service Routine
9.2.2.3 Implementation of Memory-Mapped Input
9.2.3 Output to the Monitor
9.2.3.1 Basic Output Registers (DDR and DSR)
9.2.3.2 The Basic Output Service Routine
9.2.3.3 Implementation of Memory-Mapped Output
9.2.3.4 Example: Keyboard Echo
9.2.4 A More Sophisticated Input Routine
9.2.5 Implementation of Memory-Mapped I/O, Revisited
9.3 Operating System Service Routines (LC-3 Trap Routines)
9.3.1 Introduction
9.3.2 The Trap Mechanism
9.3.3 The TRAP Instruction
9.3.4 The RTI Instruction: To Return Control to the Calling Program
9.3.5 A Summary of the Trap Service Routine Process
Example 9.1
9.3.6 Trap Routines for Handling I/O
9.3.7 A Trap Routine for Halting the Computer
9.3.8 The Trap Routine for Character Input (One Last Time)
9.3.9 PUTS: Writing a Character String to the Monitor
9.4 Interrupts and Interrupt-Driven I/O
9.4.1 What Is Interrupt-Driven I/O?
9.4.2 Why Have Interrupt-Driven I/O?
Example 9.2
9.4.3 Two Parts to the Process
9.4.4 Part I: Causing the Interrupt to Occur
9.4.4.1 The Interrupt Signal from the Device
9.4.4.2 The Urgency of the Request
9.4.4.3 The INT Signal
9.4.4.4 The Test for INT
9.4.5 Part II: Handling the Interrupt Request
9.4.5.1 Initiate the Interrupt
9.4.5.2 Service the Interrupt
9.4.5.3 Return from the Interrupt
9.4.6 An Example
9.4.7 Not Just I/O Devices
9.5 Polling Revisited, Now That We Know About Interrupts
9.5.1 The Problem
9.5.2 The Solution
Exercises
9.18 Consider the following LC-3 assembly language program:
9.19 The following LC-3 program is assembled and then executed. There are no assemble time or run-time errors. What is the output of this program? Assume all registers are initialized to 0 before the program executes.
9.20 The correct operation of the program in Example 9.1 assumes that the person sitting at the keyboard only types capital letters and the value 7. What if the person types a $? A better program would be one that tests the character typed to be sure it really is a capital letter from among th 26 capital letters in the alphabet, and if it is not, takes corrective action. Your job: Augment the program of Example 9.1 to add a test for bad data. That is, write a program that will type the lowercase representation of any capital letter typed and will terminate if anything other than a capital letter is typed.
9.25 Consider the following LC-3 assembly language program:
9.26 The following program is supposed to print the number 5 on the screen. It does not work. Why? Answer in no more than ten words, please.
ABCFGH
HARDDISK ETHERNET PRINTER CDROM
9.33 Interrupt-driven I/O:
★9.50
10
Source