home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TOOL_INC.ZIP / GIVETIME.INC < prev    next >
Encoding:
Text File  |  1988-02-11  |  987 b   |  43 lines

  1.  
  2. (*
  3.  * this procedure should be called often inside the "nothing to do" loop when
  4.  * the system has nothing to do (eg. waiting for a host mode call; no rx/tx
  5.  * activity when online; sitting at a dialing directory prompt; etc.)
  6.  *
  7.  * this call does nothing (and is SAFE) when doubledos is not used
  8.  *
  9.  *)
  10.  
  11. procedure give_up_time;      {give up unused time under doubledos}
  12. var
  13.    reg:  registers;
  14.    i:    integer;
  15.  
  16. begin
  17.    {simple delay to reduce frequency of give-up-time calls, in case they
  18.     cause some interference under non dv/dd environments}
  19.    for i := 1 to 1000 do ;
  20.    {exit;}
  21.  
  22.    {get topview/taskview version}
  23.    reg.bx := 0;
  24.    reg.ax := $1022;
  25.    intr($15,reg);
  26.  
  27.    {give up time with taskview}
  28.    if reg.bx <> 0 then
  29.    begin
  30.       reg.ax := $1000;          {give up remainder of timeslice}
  31.       intr($15,reg);
  32.    end
  33.    else
  34.  
  35.    {give up time with doubledos}
  36.    begin
  37.       reg.ax := $fe01;
  38.       msdos(reg);
  39.    end;
  40. end;
  41.  
  42.  
  43.