How the NUMLOCK Setting Works in MS-DOS 6.22
This article explains the function, syntax, and operational impact of
the NUMLOCK configuration setting during the MS-DOS 6.22
boot sequence. It details how the command alters keyboard behavior upon
startup, where it is defined, and why it was introduced to manage
hardware defaults.
Purpose of the NUMLOCK Command
In MS-DOS 6.22, the NUMLOCK command is an internal
configuration directive used specifically within the
CONFIG.SYS startup file. Its sole role during the boot
process is to explicitly set the initial state of the keyboard’s Num
Lock key to either active (ON) or inactive (OFF) before the operating
system presents the command prompt to the user.
Prior to MS-DOS handling this state natively, the default status of the Num Lock indicator was dictated solely by the system's motherboard BIOS. Depending on the hardware manufacturer, machines often booted with Num Lock forced on, which caused issues on compact keyboards or laptops where the numeric keypad was overlaid onto standard typing keys.
Syntax and Implementation
The command is placed directly into the CONFIG.SYS file
using simple syntax:
NUMLOCK=ON— Automatically enables Num Lock during boot, allowing the numeric keypad to output numbers immediately.NUMLOCK=OFF— Disables Num Lock during boot, configuring the keypad keys to act as directional arrows and navigation keys (Home, End, Page Up, Page Down).
Execution During Boot
During startup, the MS-DOS kernel (IO.SYS and
MSDOS.SYS) reads and parses CONFIG.SYS. When
the parser encounters the NUMLOCK directive, it directly
modifies the keyboard flag byte stored in the BIOS Data Area (BDA) at
memory address 0040:0017h.
By setting or clearing the appropriate bit at this address, MS-DOS ensures that:
- The keyboard controller updates the physical LED indicator light on the keyboard.
- Keystrokes generated from the numeric keypad are translated into the
expected scan codes as soon as
AUTOEXEC.BATbegins executing.
If the NUMLOCK line is omitted from
CONFIG.SYS, MS-DOS 6.22 leaves the keyboard state
unchanged, allowing the hardware BIOS setting to dictate whether Num
Lock begins enabled or disabled.