     NAME: 

          Loadhi  -  Loads a program into the upper memory.

     SYNOPSIS: 

          LOADHI [/L:m[,n][;m[,n]]]... [/S] [/E] [/V] [/@XXXX] [/M=min[,max]] 
                 filename [arguments to filename]

     DESCRIPTION: 

          LOADHI loads a program into the upper memory. This is usually 
          done with programs that stay resident in memory ("TSR" programs), 
          to make more conventional memory available.

          If no upper memory is available, or if the program doesn't
          fit there, it will be loaded into conventional memory.
 
          The "filename" argument works just like when you start a program
          from the command line, except that you can't run batch files or
          internal commands. (There's no need to load those high, anyway...)

          The exit code is either 255, if something went wrong, or the 
          exit code of the program that was loaded high, if the loading 
          was successful.

          I/O redirection commands on the command line will redirect the
          output of both LOADHI and the other program (although LOADHI will
          only produce output when started with the /V switch).

     OPTIONS: 
          
          /?      shows the synopsis.
          
          /L:region[,minsize][;region[,minsize]]...      

                  Specifies which memory regions the program can use.
                  
                  'region' is the number of the memory region. Region 0 is 
                  conventional memory, region 1 is the first UMB region,
                  region 2 is the second UMB region, etc. You can specify 
                  as many regions as are available on your system.
                  
                  When the 'L' switch is used, the program can only use the
                  UMB regions listed after the 'L' switch. Without the 'L' 
                  switch, the program can use all upper memory regions.

                  'minsize' is the minimal amount of free memory that must 
                  be available in the memory region for the program to use 
                  it. If there is less free memory in the region, the 
                  program will not be allowed to access that region.

          /S      Shrinks each memory region to the minimum size specified 
                  with the 'L' switch, before the program is loaded. This
                  switch is used to optimize the memory usage of the program.
          
          /E      Creates no environment copy for the program. This saves
                  a little memory, but use it only if you are sure that
                  the program doesn't need the environment.
 
          /V      Verbose mode. LOADHI will print various messages, 
                  reporting the progress of the loading. 
          
          /@XXXX  Loads the program at segment address XXXX, if possible.
                  If it's not possible, the program will be loaded in the 
                  first free memory block after XXXX, that is big enough 
                  for the program.

          /M=min[,max]

                  Specifies the minimal and maximal memory requirement
                  of the program, either in bytes or kilobytes. To specify 
                  kilobytes, terminate the number with a 'k', as in '256k'.
                 
                  Some EXE files need more memory than their header info 
                  says. Some COM files need a full 64 kb block to run 
                  properly. In this case, use '/M=64k'.

                  If a max size is specified, the program will be loaded in 
                  the memory block that closest matches the max size. 
                  Otherwise, it will be loaded in the largest available 
                  memory block.
          
     BUGS: 

          If a program doesn't run correctly, or the system crashes, the 
          reason is almost always that the program was allocated a too 
          small memory block (some programs need more memory than their 
          header info says). 

          Try using the /M switch with a large number, and see if the 
          problem goes away.
     
     AUTHOR: 

          Svante Frey <sfrey@mail.kuai.se>

     EXAMPLES: 

          LOADHI MYTSR.EXE
 
          loads the program MYTSR.EXE into the upper memory. The program
          can use all memory regions.

          LOADHI /L:1;3 D:\DOSPRG\QA\QA.COM
          
          loads QA.COM in the first upper memory region. QA will only have
          access to the first and third upper memory regions.

          LOADHI /L:0;2;3 COMMAND.COM

          The program COMMAND.COM will be loaded in the conventional
          memory area. It will only have access to the second and third
          upper memory regions.

          LOADHI /L:1,96000;2 /S /V MEM /DEBUG

          MEM will be loaded in the first UMB region, if this region 
          contains at least 96000 bytes free memory. This region will be
          shrunk to exactly 96000 bytes before MEM is loaded. MEM will
          also be allowed to access the second UMB region. Informational
          messages will be printed to standard output.

          LOADHI /@1000 PACKED.EXE

          The program PACKED.EXE will be loaded at 1000:0000 if that
          memory is free, or else in the first free memory block after 
          1000:0000 that is big enough for the program.
