I hope there will be more threads like this. That would really be a blessing for newbies like us.
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
DigestI
View 37,627 Replies 100
----------------------------------------------------------------------------
LOADHIGH (LH)
Loads a program into upper memory. Loading a program into upper memory can preserve more conventional memory space for
other programs to use (for information about memory optimization, see the chapter "Making More Memory Available"
in the MS-DOS 6.22 User's Guide).
Syntax
LOADHIGH filename
To specify the memory area into which the program should be loaded, use the following syntax:
LOADHIGH ...] ]
filename
LOADHIGH can be abbreviated as LH.
Switches
/L:region1...]
Specifies the memory region into which to load the program. If /L is not used, MS-DOS loads the program into the largest free upper memory block
(UMB), and makes other available UMBs available to the program. /L can be used to specify a particular memory region into which the program is loaded or
memory regions the program can use.
Specifying a region number after the /L switch causes the program to be loaded into the largest free memory block in the specified region. For example, to
load a program into the largest free memory block in region 4, enter /L:4 (the MEM /F command line can list free
memory regions).
When using the /L switch, the program can use only the specified memory regions. For programs that use multiple memory regions,
multiple regions can be specified (using the MEM /M command with the program name as a parameter lets you view the program's memory usage).
When multiple regions are specified, separate the memory block numbers with semicolons (;). For example, to use memory blocks 2 and 3, enter
/L:2 ; 3 .
Normally, MS-DOS loads the program into the specified upper memory region containing a UMB larger than the program's load size (the program's load
size is usually equal to the size of the executable file). If the program needs more space when running than its load
size, you can use the minsize parameter to make sure the program is not loaded into a UMB smaller than the space it needs at run time. MS-DOS will load the program
into a UMB larger than both the program's load size and the size specified by minsize.
/S
Shrinks the UMB to the minimum size when loading the program. Using this switch makes memory use most efficient. This switch is usually
used only by the MemMaker program. MemMaker can analyze a program's memory usage to determine whether it is safe to use
this switch when loading the program. This switch can only be used together with the /L switch, and affects only UMBs for which a minimum size has been specified.
Parameters
filename
Specifies the location and name of the program to load.
parameters
Specifies the command-line parameters required by the program.
Related commands
For information about loading device drivers into upper memory, see the <DEVICEHIGH> command.
For information about using MemMaker to move programs to upper memory, see the <MEMMAKER> command.
◆
Example Syntax
----------------------------------------------------------------------------
LOADHIGH (LH)─Notes
Requires the DOS=UMB command
Before using the LOADHIGH command, you must add the DOS=UMB command to the COMFIG.SYS file. For more
information about the DOS=UMB command, see the <DOS> command.
Use MemMaker to optimize upper memory automatically
MS-DOS 6.22 includes the MemMaker program, which can automatically optimize system memory usage. MemMaker scans
upper memory and analyzes the memory usage of drivers and applications to determine which programs are best suited for loading into available
UMBs. MemMaker adds LOADHIGH commands to the AUTOEXEC.BAT file, and specifies /L and /S switches when necessary. For more
information about MemMaker, see the chapter "Making More Memory Available" in the MS-DOS 6.22 User's Guide.
An upper memory manager must be installed
Before programs can be loaded into upper memory, an upper memory manager must be installed. MS-DOS provides EMM386.EXE for 80386
or higher computers to manage upper memory. EMM386 can be installed with the DEVICE command in the CONFIG.SYS file
(the DEVICE command to install the HIMEM.SYS extended memory manager must come before the DEVIECE command that installs EMM386)
How LOADHIGH works
When loading a program with LOADHIGH, MS-DOS tries to load the program into upper memory. If upper memory
is insufficient, MS-DOS loads the program into conventional memory. Using the MEM /M command and specifying the program name lets you determine
whether the program is using a UMB.
Using LOADHIGH in the AUTOEXEC.BAT file
The most convenient way to use the LOADHIGH command is in AUTOEXEC.BAT. (If the
MemMaker program is used, it will automatically add the required LOADHIGH commands to the AUTOEXEC.BAT file.)
◆
Syntax Notes
----------------------------------------------------------------------------
LOADHIGH (LH)─Examples
The following command line loads the DOSKEY program into upper memory and specifies that MS-DOS load the program into memory region 1:
loadhigh /l:1 c:\dos\doskey
The following command line loads the program MYPROG.EXE into memory region 1, and allows the program to use upper memory regions 3 and 4:
lh /L:1;3;4 c:\programs\myprog.exe
The following command line loads MYPROG into conventional memory (region 0) and allows the program to access upper memory region 1:
loadhigh /l:0;1 c:\programs\myprog.exe
◆