Using the MS-DOS 4 release to compile programs

preview_player
Показать описание
Someone had asked me if it was possible to use the Microsoft MS-DOS 4.00 source code release to compile new programs.

And that's an interesting question, because as I showed in my other video at the time, the BAK (the Binary Adaptability Kit) includes a C compiler and an assembler so it could compile the source code.

So the short answer is Yes, you can use the Microsoft C compiler they included in the source code release to compile your own programs. The C compiler is provided as binary only, no source code, but it's a working C compiler.

So let's look at how you can use the C compiler there to compile your own programs.

Visit our website

Join us on Facebook

Follow us on Mastodon

Consider supporting me on Patreon

And don't forget to Like and Subscribe!

Standard comment rules apply.
Рекомендации по теме
Комментарии
Автор

For absolutely no practical reason, I'd love to see a benchmark between ms-dos 4 and current free dos. It'd be great to see how it differs - even when virtualized

kenielf
Автор

Just stumbled across this video, you make a great teacher.

MattKasdorf
Автор

I already extracted the MS C compiler, its libs and include files and the additional tools and MASM from the MS-DOS 4 release a couple of weeks ago, when the source code of MS-DOS 4 was released.

OpenGLever
Автор

Nice video as usual,
Programming sessions are always welcome and I expect there will be more to come(I hope)
Thanks Jim!

ahmad-murery
Автор

16:02 the INC directory contains SYS subdirectory

platoek
Автор

I think you may have missed a sys directory inside the headers directory.

SlideRSB
Автор

Why is the second version of the array.exe program 10x smaller?
At 18:22 it's ~700 bytes, while at 14:00 it's ~7kB.

Maxjoker
Автор

A question: the provided multitasking version of MS-DOS stops other programs wenn you use "normal" DOS EXEs. Can the Microsoft compiler produce Windows-style "new" executables that you could concurrently? Thank you for the video!

alexandershendi
Автор

13:18 Why did the program work? I imagined it should have crashed right after that null pointer assignment?

aintaintaword
Автор

I noticed that this compiler can understand the modern syntax for the function parameters, and it's a 1986 compiler, before K&R 2. When was the new syntax introduced and when did it become the norm for a compiler to support it?

simpleprogrammingcodes
Автор

I await the ultimate showdown! Which is better ed or edlin!

grappydingus
Автор

Sure it's nice that Microsoft released this but why would you want to use it when we have OpenWatcom that can target 16bit dos and supports a relatively modern C standard. I guess this might be useful if cl itself actually is 16 bit and you absolutely need to compile a program on an AT or an XT. Benchmark comparison might be interesting but it seems unlikely this old compiler could win but maybe it has optimizations better targeted to 8086 and 80286 cpus than what you'd find in a 32 bit compiler.

MonochromeWench
Автор

I know this is gonna sound strange, considering the fact that DOS is mainly a CLI OS, but is it possible to get a desktop environment running on FreeDOS?

MasterH
Автор

Nice video as always, I have never properly programmed in C under DOS but the usage of malloc got me thinking, when it's running (presumably) in real mode you're limited to what's left of 640K base memory, right? And if I wanted to use more memory I'd have to use a different compiler that can produce programs that run in protected/enhanced mode.

snap_oversteer