Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!psuvm!hdk From: HDK@psuvm.psu.edu (H. D. Knoble) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: Num Lock .com utility wanted Message-ID: <90254.123515HDK@psuvm.psu.edu> Date: 11 Sep 90 16:35:15 GMT References: <25475.26e8c676@kuhub.cc.ukans.edu> Organization: Penn State University Lines: 44 Publications of NUMLKOFF codes that use special characters are bound to fail because of they don't display consistently across systems. Such a .COM file was published in PC Magazine. It follows here: NUMLKOFF.COM From PC Tutor, PC Magazine, June 14, 1988, pp378-379, Vol 7, No. 11, by H. M. Weingartner. The 8 byte program, which deactivates the NumLock function, was created by entering the following commands to DEBUG: N NUMLKOFF.COM A 100 POP DS AND BY [417],DF <--417 enclosed in square brackets, ASCII 91 & 93. INT 20 <--Make sure you enter this blank line. RCX 8 W Q METHOD AND DISCUSSION (PC Magazine, 8(1):373, January 17, 1989) Very basically speaking, the BIOS uses 3 bits of a byte located at 0:417h to keep track of the status of the NumLock, CapsLock, and ScrollLock functions. The mapping of this byte follows: 0040:0017h 7 6 5 4 3 2 1 0 <---Bit positions I I I I I +----> 1=ScrollLock active I +--------> 1=NumLock active +------------> 1=CapsLock active If the bit is 1, then the corresponding function is on. NUMLKOFF simply sets bit five to zero. {If the AND above used constant BF instead of DF, (and appropriate name changed) then the CapsLock function would be turned off. Similarly, if the DEBUG instruction AND BY were changed to OR BY and the mask(s) complemented, then the function(s) would be (NUMLK)ON instead of OFF.} As a note in passing, the function TOGGLE.COM, published in the May 31, 1988 Utilities column of PC Magazine, allows all three functions to be controlled more generally.