| |
/* Prog to send 'G' to Serial Com Port1 */
#include <stdio.h>
#include <conio.h>
#include <dos.h>
int com2Address = 0x2f8; /* Assign a var name to com2*/
int lCR = 0x2FB; /* Assign a var name to line control register*/
int dLLB = 0x2f8; /* Assign a var name to divisor latch low byte */
void main(void)
{
outp(lCR, 0x8a); /* Set line control register to 10001010 */
outp(dLLB, 0x18); /* Set divisor latch low byte to 18h for 4800 bps */
outp(lCR, 0x0a); /* Set line control register to 00001010, turning off DLAB */
outp(com2Address, 'G'); /* Set com2 to G */
}
|