INF: Using the /HIGH and /DS Linker Switches

ID Number: Q79143

2.x 3.x 4.x 5.0x 5.10 5.11 5.13 5.15

MS-DOS

Summary:

The linker switch /HIGH is used to request that the loader place the

program into RAM at the highest possible address. The PSP, however, is

still loaded into low memory. Without the /HIGH switch, the entire

program is loaded into the lowest address in the first available block

of RAM.

The linker switch /DS[ALLOCATE] relocates all addresses in DGROUP so

that the last byte in the group has offset FFFFh.

The /DS and /HIGH switches are not recommended for use with high-level

languages, but can be used with real-mode assembly language programs.

More Information:

When a program is linked with /HIGH, all memory between the program's

segments (which are at the highest possible address) and its PSP

(which is low in memory) is owned by the program. Therefore, memory

cannot be dynamically allocated and freed. Also, no other programs can

be loaded in memory.

With the /HIGH switch, you can allow your stack or heap to grow

downward without running into other program data, providing it is the

first segment in the memory map.

The start-up code for Microsoft high-level languages is incompatible

with the /HIGH option. It automatically specifies /DOSSEG, which

forces a low load. It also requires some dynamic memory allocation. It

is possible to use /HIGH if you write your own start-up code, but you

will not be able to call many of the Microsoft run-time functions

because they require dynamic memory allocation.

Early versions of Microsoft FORTRAN and Microsoft Pascal generate code

that must be linked with /DS. The /HIGH switch is often used in

conjunction with /DS. This is one reason that the /DS and /HIGH

switches are still available as linker options.

Additional reference words: 2.00 2.01 2.10 2.40 2.41 2.44 2.50 3.00

3.01 3.02 3.04 3.05 3.06 3.51 3.55 3.60 3.61 3.64 3.65 3.69 4.06

4.07 4.10 5.01.20 5.01.21 5.02 5.03 5.05 5.10 5.11 5.13 5.15 link