#include #include #include /* Serial Ports Address, using COM2 */ #define PORT2 0x2F8 void main(void) { char command; /* Turn off interrupts on Port2 */ outportb(PORT2 + 1 , 0); /* Setting DLAB ON */ outportb(PORT2 + 3 , 0x80); /* Setting Baud rate to 9600 - Divisor Latch Low Byte */ outportb(PORT2 + 0 , 0x0C); /* Set Baud rate - Divisor Latch High Byte */ outportb(PORT2 + 1 , 0x00); /* 8 Bits, No Parity, 1 Stop Bit */ outportb(PORT2 + 3 , 0x03); /* FIFO Control Register */ outportb(PORT2 + 2 , 0xC7); /* Turn on DTR, RTS, and OUT2 */ outportb(PORT2 + 4 , 0x0B); command = 27; /* Sending the command to the Serial Port */ outportb(PORT2, command); }