Large DOS Programs
Large DOS Programs
Why are DOS programs much larger than Windows programs? A Windows-header is larger than a DOS-header, yet a Windows progam starts at 5k and a DOS at 58k. Why? Is there a way to make DOS programs smaller, (even if it means more work)?
Thank you.
Thank you.
PMODE may also support DJGPP, see http://www.thefreecountry.com/programmi ... ders.shtml .
With WDOSX you can also compile your console Win32 (not DOS) FB applications, stub it and run them in raw DOS, without Windows.
With WDOSX you can also compile your console Win32 (not DOS) FB applications, stub it and run them in raw DOS, without Windows.
I have 3 questions:
1) Is there a way to not include the DPMI, and just output a standard DOS, (MZ,) exe?
2) Is there an assembler that is compatable with FreeBasic's output assembly? I am not concerned about libraries, I would like to be able to write DOS programs in FreeBasic, compile them to assembly, then create the DOS program using an assembler. Hopefully, this will create smaller DOS programs.
3) Can DOS programs be compressed and still work in pure DOS, (like a Windows program)?
Thank you.
1) Is there a way to not include the DPMI, and just output a standard DOS, (MZ,) exe?
2) Is there an assembler that is compatable with FreeBasic's output assembly? I am not concerned about libraries, I would like to be able to write DOS programs in FreeBasic, compile them to assembly, then create the DOS program using an assembler. Hopefully, this will create smaller DOS programs.
3) Can DOS programs be compressed and still work in pure DOS, (like a Windows program)?
Thank you.
No.unknown wrote:1) Is there a way to not include the DPMI, and just output a standard DOS, (MZ,) exe?
GNU as can be used but this will not help you creating smaller EXE files.unknown wrote:2) Is there an assembler that is compatable with FreeBasic's output assembly? I am not concerned about libraries, I would like to be able to write DOS programs in FreeBasic, compile them to assembly, then create the DOS program using an assembler. Hopefully, this will create smaller DOS programs.
Yes, you may take a look at WDOSX (which also compresses the executable).unknown wrote:3) Can DOS programs be compressed and still work in pure DOS, (like a Windows program)?
Regards,
Mark
Bloat compiler
It IS done so by default. But you need the external file" Is there a way to not include the DPMI, and just output a standard DOS, (MZ,) exe? "
CWSDPMI.EXE. This is BAD.
You can also include it - EXEcutable bloats from 60KB to 80 KB.
You can't use 32 bit programming in DOS without DPMI. Silly but
true: the CPU architecture causes this problem.
FBC is a 32 bit compiler. Advantages: no 64KB & 640KB BUG,
better performance. Disadvantages: a huge DOS extender (>=50KB)
has to be inclued or bundled. PMODE/DJ is SLIGHTLY smaller than CWSDPMI.
unknown wrote:
YES, with UPX.3) Can DOS programs be compressed and still work in pure DOS, (like a Windows program)?
QUESTION to the DOS devel:
Why did you use CWSDPMI and not DOS/32A ? It is (well, slightly)
smaller than CWSDPMI, but has much better performance and less
problems than PMODE, and a more liberal license.
I included CWSDPMI in the package because that is what the DJGPP docs usually refer to. I don't find it to be overly large, either - the version of CWSDPMI used is only 13 KB.
There are a number of reasons why programs produced by fbc for DOS (and the DJGPP gcc port as well) are large, such as the extensive *NIX emulation throughout the C runtime library, and to be compatible with DJGPP-compiled C libraries, this cannot be changed.
There are a number of reasons why programs produced by fbc for DOS (and the DJGPP gcc port as well) are large, such as the extensive *NIX emulation throughout the C runtime library, and to be compatible with DJGPP-compiled C libraries, this cannot be changed.
I don't understand all those references to UPX and CWSDPMI. Simply use WDOSX and you'll get the advantage(s) of both with one single tool:
Mark
- WDOSX compresses your executable
- WDOSX is a DPMI stub - so no external executable required
- Complete sources of WDOSX are available
- Allows to stub Win32 applications too which should allow you to execute Win32 console applications under plain DOS too
Mark
Just create the EXE as normal. The WDOSX archive contains a STUBIT.EXE. Use it with STUBIT YOUREXE.EXE
This will automatically replace DJGPP's EXE stub and compresses the whiole EXE too.
You can get WDOSX from here (http://tippach.business.t-online.de/wdosx/).
Regards,
Mark
This will automatically replace DJGPP's EXE stub and compresses the whiole EXE too.
You can get WDOSX from here (http://tippach.business.t-online.de/wdosx/).
Regards,
Mark