Problem with installing an Interrupt handle ???

Hi,
I'm trying to write a simple program to install a new Interrupt handle to
the Timer Tick Interrupt $1c with Free Pascal.
The code works while running under Windows 95 but doesn't work under MS-DOS
mode and I can't understand why. I need to run it under MS-DOS mode
because I plan to use the Programmable Interval Timer at high frequency
which Windows doesn't allow.

Any suggestions ???

Richard S.

Program Int_test;

Uses go32;

Var
   IRQ_CK : word;
   oldtimerirq,newtimerirq : tseginfo;

Procedure int_play;
Interrupt;
Begin
  asm
    pusha
  end;

  inc(IRQ_CK);

  asm
    popa
  end;
end;

Procedure install(T_F:Boolean);
Begin
  if T_F = true then
  begin
    get_pm_interrupt($1c,oldtimerirq);
    newtimerirq.segment:=get_cs;
    newtimerirq.offset:=@int_play;
    set_pm_interrupt($1c,newtimerirq);
  end;
  if T_F = false then set_pm_interrupt($1c,oldtimerirq);
end;

Procedure test;
Begin
  repeat
    IRQ_CK := 0;
    repeat until IRQ_CK >1;
    write('.');
  until port[96] = 1; {hit Esc key to quit}
end;

Begin
  install(true);
  test;
  install(false);
end.