I know it has a Microprocessor, but does it also have a
Microcontroller? For example, I am (from a project I found) going to
have my PC control some LEDs and a LCD display. But since the
microprocessor doesn't have resident I/O, etc., then what is it that
actually sends data through the parallel port to the outside world?
A parallel interface chip mapped so that dumping a byte to a certain
address looks (to the CPU) like it just wrote the byte to memory,
probably...
Reverse the concept if you've got a bidirectional PP, or some other type
of port that's capable of both input and output - The port gets data
from somewhere. It sets a flag (probably, but not necessarily, an
interrupt - several methods are easily available, and several more that
aren't quite as easy can be used) to indicate it has something for the
CPU to work with, then when the CPU services that interrupt (or polls
the flag, or...) the system software knows to tell the CPU "Yo! Stupid!
Read this byte of "RAM" and do something with it!"
Likewise, any other output (or input) device can be (relatively) easily
mapped to look like RAM from the CPU's viewpoint. From there, it's just
a matter of adding code that "does the dirty work".
This only directly "notices" devices on the motherboard, but the same
concept can be applied to slot-installed stuff like a SCSI card, USB
card, and so on - The OS takes a poll of the slots at startup, figures
out that slot "X" has a "Super-whiz-bang 2000" output device in it that
knows to look at location $0XYZ, and sets up interrupts, handlers, and
the other needed "stuff" so that the CPU can go on believing it's simply
talking to a byte of RAM (at location $0XYZ) on the motherboard. Your
program calls a routine that needs to write data to the S-W-B 2K, which
triggers any of several possible methods that tell the CPU to write the
byte your routine supplied to $0XYZ. From there, it becomes an "SEP"(1)
as far as the CPU is concerned, and your program keeps on truckin'
along. Again, for input, reverse the concept.
(1) What? You don't know what an SEP is???? OK, where have you been
hiding since the publication of the Hitchhiker's Guide To The Galaxy
series???? An SEP is "(S)omebody (E)lse's (P)roblem".