program chn;

{runs a TURBO Pascal CHN file to save on disk space}

{invoked by:
   >CHN chnfile }

{when compiling, remember to set size of
  all variable areas greater than those of
  files to be chained using COM options}

type
  str = string[127];

var
  command_line : str absolute Cseg:$80;     {the DOS command line}
  chnfile : file;                           {filename found on command line}

begin
  {parse command line}
  while command_line[1] = ' ' do Delete(command_line,1,1); {delete leading blanks}
  {$I-}
  assign(chnfile,command_line + '.chn');
  reset(chnfile);
  {$I+}
  if IOresult = 0 then chain(chnfile)
    else begin writeln; writeln('chn chain_file') end;
end.
CODE'
         ASSUME  CS:CSEG,DS:CSEG,ES:CSEG
   