Aktakom ABM-4082 User Manual page 103

5 1/2 digit multimeter
Table of Contents

Advertisement

void send_port( int port,char c )
{ union REGS r;
r.x.dx = port;
r.h.ah = 1;
r.h.al = c;
int86( 0x14,&r,&r );
if( r.h.ah & 128 ) /* check ah.7,if set by int86( 0x14,&r,&r ),mean trans error */
{ printf( "\nE00:Serial port send error!" );
exit(1);
}
}
/* read a character from serial port */
char read_port( int port )
{ union REGS r;
r.x.dx = port;
r.h.ah = 2;
int86( 0x14,&r,&r );
if( r.h.ah & 128 )
{ printf( "\nE01:Serial port read error!" );
exit(1);
}
return r.h.al;
}
/* check the status of serial port */
int check_stat( int port )
{ union REGS r;
r.x.dx = port;
r.h.ah = 3;
int86( 0x14,&r,&r );
return r.x.ax;
}
/* initialize the serial port */
void port_init( int port, unsigned char code )
{ union REGS r;
r.x.dx = port;
r.h.ah = 0;
r.h.al = code;
int86( 0x14,&r,&r );
}
/* serial port */
/* int14 function1: send character */
/* character to be sent */
/* serial port */
/* int14 function2:read character */
/* if ah.7 be set, mean trans error */
/* serial port */
/* int14 function3:read status */
/* ax.7 show serial operation, ax.8 show serial receive ready */
/* serial port */
/* int14 function0:initial serial port */
/* initialization code */
ABM-4082
103

Advertisement

Table of Contents
loading

Table of Contents