This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Learning DOS programming
This page is a collection of tips and learning materials to get started with DOS programming. Finding good DOS-related materials can be tricky on the modern internet; as a general advice, look out for books, magazine articles, and tutorials usually distributed as plain-text files from the '80s and '90s.
Learning at least the fundamentals of DOS programming is not only useful for writing new DOS programs. If you want to troubleshoot, debug, or reverse engineer old DOS programs, you need to be able to read x86 assembly code and be familiar with the BIOS interrupts at the very minimum.
Once you're fluent in x86 assembly, the other big learning area is becoming familiar with the workings of various graphics and audio adapters at the register level. Most DOS games and demos program to the bare metal, without any driver or API between the DOS program and the hardware. In the '90s, various audio middleware started appearing that simplified this task at least on the audio front (e.g., the Miles Sound System), but graphics programming has 99.9% of the time been accomplished by hitting the VGA hardware directly at the lowest possible level.
Learning x86 assembly
Most modern x86 assembly learning materials are not relevant to DOS and are way more complicated than need to be. It's best to use assembly books and tutorials written before 2000.
While you're still a beginner, ignore protected mode completely and just focus on the 8086 stuff. After you've got the basics down, you'll only need to familiarise yourself with the more common 386 instructions and the extended 32-bit registers to understand real-mode programs.
The overwhelming majority of DOS programs only use 386 instruction set at most, and outside of scientific and engineering software and perhaps a few late DOS era flight simulators and Quake, the FPU is not used by DOS programs at all.
Suggested study plan for beginners
-
One modern tutorial that is quite good—just ignore the 64-bit and protected mode parts: https://www.codeproject.com/articles/45788/the-real-protected-long-mode-assembly-tutorial-for
-
Read the first two chapters of The 8086/8088 Primer. Free on the author's website: https://stevemorse.org/8086/index.html
-
Read this very good x86 assembly tutorial: http://textfiles.com/programming/asmtutor.pro
-
Optionally read chapter 3 of the The 8086/8088 Primer.
-
Refer to the short instruction descriptions in Help-PC as you work on some assembly code. This guide contains opcodes descriptions and timings up to the 486. https://docs.huihoo.com/help-pc/
Video
- Common BIOS video modes
- Comprehensive list of all BIOS video modes
- VESA BIOS Extension 1.2
- VESA BIOS Extension 2.0
Further learning materials
- Assembly Programming Journals
- HelpPC Reference Library – Includes DOS/BIOS/EMS/Mouse interrupt services documentation [mirror1, mirror2, mirror3]
- IBM 51xx PC Reference
- PC Game Programmer's Encyclopedia, The
- Phat Code – Quality resources for hobbyist and oldskool game and demo programmers
General
How-to's
- Adding utilities
- Applications
- Config file examples
- Dual-mouse gaming
- Getting started
- Instant launch
- Joysticks and Gamepads
- Keymapper
- Multiplayer & serial ports
- Windows
Lists
- AUTOTYPE candidates
- CDDA / GUS / MIDI games
- DOS/32A compatibility
- Dual OPL2 and OPL3 games
- Games with enhanced Tandy & PCjr graphics and sound
- Shaders
- Special keys
Audio
- Audio mixer signal flow diagram
- Audio configuration recommendations
- GUS enhancements
- MIDI
- Sound cards
- True 16-bit audio games
Video
Issues
Dev
- How to contribute
- Release process
- Audio tests
- CPU tests
- DOS tests
- Input tests
- Performance tests
- Video tests — Video modes
- Video tests — CRT shaders
- Video tests — Presentation
- Learning DOS programming
- Intel compiler tips