Top 50 DOS Problems Solved: Num Lock

Q: Ever since I moved up from my old Amstrad 1512 to a 386 I have been annoyed by the way Num Lock comes on when the PC is started up or re-booted. I still use the numeric keypad in preference to the additional cursor key block. Is there any way Num Lock can be turned off automatically?

A: As far as I know, not even the latest version of DOS allows you to set the state of Num Lock on start-up. However, there is a short program you can create which, when run from AUTOEXEC.BAT, turns Num Lock off. Depending on whether you use MS-DOS or DR DOS, type one of the listings shown here into a text editor and save it as a plain ASCII file called NUMOFF.LST.

MS-DOS (Debug) version:

a100
XOR AX,AX
MOV DS,AX
MOV AL,BYTE PTR (417)
AND AL,DF
MOV BYTE PTR (417),AL
XOR AH,AH
INT 21

rcx
10
nNUMOFF.COM
w
q

Then type:

DEBUG < NUMOFF.LST

All being well, you will now have a program called NUMOFF.COM. Test it by pressing Num Lock to bring the keyboard light on, and type NUMOFF. The light should go off.

30 years later, this still isn’t trivial in GNOME… But the book authors get kudos for creativity in finding out how to send someone a working and useful binary via the medium of dead trees.

2 thoughts on “Top 50 DOS Problems Solved: Num Lock

  1. I suppose we should reacquaint ourselves with code like this, since this is what Greasemonkey scripts will look like once WebAssembly takes off. ;)

  2. What terrible code; fortunately the Microsoft Knowledge Base contains two better versions. Better still, as of MS-DOS 6.0, you can set NUMLOCK in your CONFIG.SYS.

Leave a Reply

Your email address will not be published. Required fields are marked *