I used the outp() function to write to the serial port that way:
char string[10];
strcpy (string, "TEST");
for (i = 0; i < 4; i++) {
outp (0x3F8, *(string + i));
for (x = 0; x < 10; x++); //Very little delay
}
I found the port number in the Control Panel>>System>>Peripherals>>Ports. Double click the desired port: the Resources tab gives you the port number (called I/O address or similar; I'm sorry if the terminology is not the right one: I'm translating on the fly from an italian version on Windows). The previous example is for writing to COM1.
I haven't tried to write to the parallel port, maybe it's similar to writing to the serial one.
Roberto