Unit - példaprogram

unit EgerUnit;

interface

  procedure Init;
  procedure Be;
  procedure Ki;
  function LeBal: boolean;
  function LeJobb: boolean;
  function XKoor: integer;
  function YKoor: integer;

implementation

uses Dos;
var  r: registers;

procedure Init;
  begin
    r.ax := 0;
    Intr($33, r);
  end;

procedure Be;
  begin
    r.ax := 1;
    Intr($33, r);
  end;

procedure Ki;
  begin
    r.ax := 2;
    Intr($33, r);
  end;

function LeBal: boolean;
  begin
    r.ax := 3;
    Intr($33, r);
    LeBal := r.bx=1;
  end;

function LeJobb: boolean;
  begin
    r.ax := 3;
    Intr($33, r);
    LeJobb := r.bx=2;
  end;

function XKoor: integer;
  begin
    r.ax := 3;
    Intr($33, r);
    XKoor := r.cx;
  end;

function YKoor: integer;
  begin
    r.ax := 3;
    Intr($33, r);
    YKoor := r.dx;
  end;

end.