The latest stable version of Free Pascal (since version 2.6.4) is available for download for the Go32v2 DOS Extender. This means you can use a very modern compiler and all its features for DOS programming.
Go32 is a so-called DOS extender. Use of this extender with FPC allows DOS programs to access more memory than would normally be possible with real-mode DOS (>640kb?).
DOS Programming Links
- The HTML version of SWAG (SourceWare Archive Group). This is an 28MB archive of source code and examples, mostly for DOS and Windows 3.1 programming with Turbo Pascal. Many snippets not involving assembler should however work without change on Free Pascal and many others are useful for any programming environment. The sources are mostly public domain, often well-documented and quite interesting. Some download links are broken, but there are many mirrors so keep trying until you find one that works.