Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
How to Build a Dual-Mode Program
◄Up► ◄Contents► ◄Index► ◄Back►
─────How to Build a Dual-Mode Program───────────────────────────────────────
If you cannot create a bound program, you can create a dual-mode
program instead. A dual-mode program is similar to a bound
program. Both types of programs run in both real mode and
protected mode, but they have different internal structures.
A bound program has common executable code that runs in both
modes. System calls are specific to real mode or protected mode,
but all system calls are modified at load time.
In contrast, a dual-mode program has two separate programs in one
file. One of these programs runs in real mode, and the other runs
in protected mode. All the code in a dual-mode executable program
runs in one mode or the other.
To create a dual-mode program:
1. Link a real-mode version of your program.
2. Create a module-definition file that contains the statement
STUB filename
where <filename> is the name of your real-mode program.
3. Link the protected-mode version of your program with the
module-definition file above. The protected-mode program and
the real-mode program should have different names.
-♦-