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
3.1 Programming Input and Output 101
io_buf[buf_tail++] = achar;
/* check pointer */
if (buf_tail == BUF_SIZE)
buf_tail = 0;
}
char remove_char() { /* take a character from the buffer
head */
char achar;
achar = io_buf[buf_head++];
/* check pointer */
if (buf_head == BUF_SIZE)
buf_head = 0;
}
Assume that we have two interrupt handling routines defined in C, input_handler for the
input device and output_handler for the output device. These routines work with the device
in much the same way as did the busy-wait routines. The only complication is in starting
the output device: If io_buf has characters waiting, the output driver can start a new output
transaction ...
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