Jump to content

DOS MZ executable

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 178.164.253.49 (talk) at 15:08, 30 November 2016 (replaced DOS with MS-DOS where it needed, as DOS is a generic operation system type and this article is about MS-DOS). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

MS-DOS MZ executable
Filename extension
.exe
Internet media typeapplication/x-dosexec, application/x-msdos-program, application/x-ms-dos-executable
Magic numberMZ or ZM
Type of formatBinary, executable
Extended toNew Executable
Linear Executable
Portable Executable

The MS-DOS MZ executable format is the executable file format used for .EXE files in MS-DOS.

The file can be identified by the ASCII string "MZ" (hexadecimal: 4D 5A) at the beginning of the file (the "magic number"). "MZ" are the initials of Mark Zbikowski, one of the developers of MS-DOS.[1]

The MZ MS-DOS executable file is newer than the COM executable format and differs from it. The MS-DOS executable header contains relocation information, which allows multiple segments to be loaded at arbitrary memory addresses, and it supports executables larger than 64 KiB; however, the format still requires relatively low memory limits. These limits were later bypassed using MS-DOS extenders.

The environment of an EXE program run by MS-DOS is found in its Program Segment Prefix.

Compatibility

MZ MS-DOS executables can be run from MS-DOS and Windows 9x-based operating systems. 32-bit Windows NT-based operating systems can execute them using their built-in Virtual MS-DOS machine (although some graphics modes are unsupported). 64-bit versions of Windows cannot execute them. Alternative ways to run these executables include DOSBox, DOSEMU and Wine.

MZ MS-DOS executables can be created by linkers, like Digital Mars Optlink, MS linker, VALX or Open Watcom's WLINK; additionally, FASM can create them directly.

See also

References

  1. ^ Inside Windows: An In-Depth Look into the Win32 Portable Executable File Format - MSDN Magazine, February 2002. "Every PE file begins with a small MS-DOS® executable. ... The first bytes of a PE file begin with the traditional MS-DOS header, called an IMAGE_DOS_HEADER. The only two values of any importance are e_magic and e_lfanew. ... The e_magic field (a WORD) needs to be set to the value 0x5A4D. ... In ASCII representation, 0x5A4D is MZ, the initials of Mark Zbikowski, one of the original architects of MS-DOS."