UNIT COM;



INTERFACE

uses crt,dos;

const com_port : word = 0;
var   regs : Registers;

procedure COM_init(var err : word);
procedure com_out(b: byte ; var status : byte);
procedure com_in(var b: byte ;var status : byte);

implementation

procedure COM_init(var err : word);
begin
  regs.dx:=com_port;
  regs.ah:=0;
  regs.al:=$83;
  intr($14,regs);
  err:=regs.ax;
end;

procedure com_out(b: byte ; var status : byte);
begin
  regs.ah:=1;
  regs.al:=b;
  regs.dx:=com_port;
  intr($14,regs);
  status:=regs.ah;
end;

procedure com_in(var b: byte ;var status : byte);
begin
  regs.ah:=2;
  regs.dx:=com_port;
  intr($14,regs);
  b:=regs.al;
  status:=regs.ah;
end;

begin
end.