COMTEST - 4


outp(0x3f8 - 0x100 * port, div & 0x00ff);

//

outp(0x3fb - 0x100 * port, mode->ctl_aux.ctl & 0x7f);

//

outp(0x3f9 - 0x100 * port, imask);

return 0;

}

/**

*.Name aux_outp

*.Title

*

*.Descr

*

*

*.Proto void aux_outp(char chr, int port);

*

*.Params char chr - ;

*

* int port - :

* 0 - COM1, 1 - COM2

**/

void aux_outp(char chr, int port)

{

unsigned status_reg, out_reg;

status_reg = 0x3fd - 0x100 * port;

out_reg = status_reg - 5;

while( (inp(status_reg) & 0x20) == 0 );

outp(out_reg, chr);

}

/**

*.Name aux_inp

*.Title

*

*.Descr

*

*

*

*.Proto char aux_inp(int port);

*

*.Params int port - :

* 0 - COM1, 1 - COM2

*

*.Return

**/

char aux_inp(int port)

{

unsigned status_reg, inp_reg;

status_reg = 0x3fd - 0x100 * port;

inp_reg = status_reg - 5;

while( (inp(status_reg) & 1) == 0 );

return(inp(inp_reg));

}