Skip to Content
Computers as Components, 2nd Edition
book

Computers as Components, 2nd Edition

by Marilyn Wolf
July 2008
Intermediate to advanced
544 pages
16h 52m
English
Morgan Kaufmann
Content preview from Computers as Components, 2nd Edition
96 CHAPTER 3 CPUs
Example 3.3 illustrates a combination of input and output.
Example 3.3
Copying characters from input to output using busy-wait I/O
We want to repeatedly read a character from the input device and write it to the output device.
First, we need to define the addresses for the device registers:
#define IN_DATA 0x1000
#define IN_STATUS 0x1001
#define OUT_DATA 0x1100
#define OUT_STATUS 0x1101
The input device sets its status register to 1 when a new character has been read; we must
set the status register back to 0 after the character has been read so that the device is ready
to read another character. When writing, we must set the output status ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computers as Components, 3rd Edition

Computers as Components, 3rd Edition

Marilyn Wolf
Computer System Designs: System-on-Chip

Computer System Designs: System-on-Chip

Michael J. Flynn, Wayne Luk
PC Hardware in a Nutshell, 3rd Edition

PC Hardware in a Nutshell, 3rd Edition

Robert Bruce Thompson, Barbara Fritchman Thompson

Publisher Resources

ISBN: 9780123743978