[comp.sys.ibm.pc] Turning off NumLock through software

bwbe_c50@uhura.cc.rochester.edu (Brent W. Benson) (11/09/89)

A friend of mine has a Clone IBM compatible.  It is a 12mhz 80286.
When it is turned on, during the initialization process (i.e. memory
check, etc.) the NumLock light goes on.

While this is not the end of the world, is there some way to turn
it back off in the autoexec.bat file.  Or better yet, is there some
way to prevent it happening in the first place.  

Brent

toma@tekgvs.LABS.TEK.COM (Tom Almy) (11/10/89)

In article <3932@ur-cc.UUCP> bwbe_c50@uhura.cc.rochester.edu (Brent W. Benson) writes:
<A friend of mine has a Clone IBM compatible.  It is a 12mhz 80286.
<When it is turned on, during the initialization process (i.e. memory
<check, etc.) the NumLock light goes on.

<While this is not the end of the world, is there some way to turn
<it back off in the autoexec.bat file.  Or better yet, is there some
<way to prevent it happening in the first place.  

A simple program to do this need only clear the next to most significant
bit (mask 40H) of memory location 40:17. The following program will do 
just that:

begin 644 numlock.com
MZ0@`.@$`````"@"\FO_'!@4!F/^]_O^)+@<!_.@%`+@`3,TA,=*.PB:@%P0P-
-Y"7?`#'2CL(FHA<$PQ<$T
``
end

toma@tekgvs.labs.tek.com
Standard Disclaimers Apply

cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) (11/11/89)

In article <3932@ur-cc.UUCP> bwbe_c50@uhura.cc.rochester.edu (Brent W. Benson) writes:
$A friend of mine has a Clone IBM compatible.  It is a 12mhz 80286.
$When it is turned on, during the initialization process (i.e. memory
$check, etc.) the NumLock light goes on.
$While this is not the end of the world, is there some way to turn
$it back off in the autoexec.bat file.  Or better yet, is there some
$way to prevent it happening in the first place.  

   If you have the 101-key (enhanced) keyboard, your num lock light will go
on when you boot.  Period.

   What you can do is put a short program into your autoexec.bat which
turns it off again (or you can take the low-tech solution - press the
num lock key).

   There is a program called Numoff that turns num lock off.  I don't
have a copy, but I can tell you how it works.  There is a word somewhere
in low memory that says which of the lock keys are on, and which of the
shift keys are depressed.  You just set or reset the appropriate bit in
this word to turn the various locks on or off.  Peter Norton's _Programmer's
Guide to the IBM PC_ has information on this word of memory.

-- 
Stephen M. Dunn                               cs4g6ag@maccs.dcss.mcmaster.ca
          <std_disclaimer.h> = "\nI'm only an undergraduate!!!\n";
****************************************************************************
They say the best in life is free // but if you don't pay then you don't eat

pipkins@qmsseq.imagen.com (Jeff Pipkins) (11/11/89)

In article <3932@ur-cc.UUCP> bwbe_c50@uhura.cc.rochester.edu (Brent W. Benson) writes:
>A friend of mine has a Clone IBM compatible.  It is a 12mhz 80286.
>When it is turned on, during the initialization process (i.e. memory
>check, etc.) the NumLock light goes on.
>
>While this is not the end of the world, is there some way to turn
>it back off in the autoexec.bat file.  Or better yet, is there some
>way to prevent it happening in the first place.  
>
Try the following assembly-language sequence (if you don't have an assembler,
you can use DEBUG's 'A' command.)


Mov  AX, 40h
Mov  DS, AX
CLI
Mov  AL, byte ptr [17h]
And  AL, 0DFh
Mov  byte ptr [17h], AL
STI
Ret

c60c-4ab@web-3e.berkeley.edu (Scott Drellishak) (11/11/89)

Somebody Wrote:
> A friend of mine has a Clone IBM compatible.  It is a 12mhz 80286.
> When it is turned on, during the initialization process (i.e. memory
> check, etc.) the NumLock light goes on.
> While this is not the end of the world, is there some way to turn
> it back off in the autoexec.bat file.  Or better yet, is there some
> way to prevent it happening in the first place.  
>

The word where the status is at 0040:0017 (hex).  I believe numberlock
status is kept in bit 3, but I'm not sure for sure.  The utility is really
easy to write...I keep seeing it on BBSs and thinking, "Awwww...another
person who just learned assembly language."  But, so what.


( Scott Drellishak
(
(   "Hey there!  Hi there!  Ho there! [smack] [smack] [smack]"
(			-The Mickey Mouse Club in the Spanish Inquisition

ewagar@pnet01.cts.com (Eric Wagar) (11/12/89)

Many '286s also have a configuration menu that can be looked at and changed
when certain keys are pressed during the Power On Self Test (POST).  I don't
know what kind of computer it is, but try pressing Ctrl-Alt-Esc or Num, Scroll
or Caps lock.
Eric Wagar               >>>>  ewagar@pnet01  <<<<
                               ^^^^^^^^^^^^^
      INET: ewagar@pnet01.cts.com  ARPA: crash!pnet01!ewagar@nosc.mil
          UUCP: {hplabs!hp-sdd | ucsd | nosc}!crash!pnet01!ewagar

n8541751@unicorn.WWU.EDU (kriston m. bruland) (11/12/89)

The following assembly language fragment turns off the much-hated Numlock
on my IBM Model 30-286 every day when I boot up, so that I don't have to.

    mov     ax,40h          ;status segment
    mov     es,ax           ;into es
    mov     bx,17h          ;status offset
    mov     al,11011111b    ;clear evil numlock bit!
    and     es:[bx],al      ;leave the others untouched


-- 
n8541751@unicorn.wwu.edu  |   Theory is useless without practical application
8541751@nessie.wwu.edu    |   and does not constitute practical application in
krisb@goose.wwu.edu       |   and of itself unless one is a professor.   -KMB

fayne@tellab5.TELLABS.COM (Jeffrey Fayne) (11/13/89)

 The procedure for turning off the Num Lock key is as follows

		sub	ax,ax	; set ES to 0
		mov	es,ax
		mov	al,00100000B  ; bit 5 is num lock toggle
		or	es:[418h],al  ; directly change the status byte


	This code fragment when executed will TOGGLE (ie OFF --> ON, ON --> OFF)the Num Lock key.


				Jeff

-- 
_____________________________________________________________________________
                                             
If it flies,    \      _      /             |  Jeffrey M. Fayne                
  it dies...     \   /^ ^\   /              |  Tellabs, Inc.       
      ____________\_(  .  )_/____________   |  Lisle, IL  (312)-969-8800
           --*/--|_| (___) |_|--\*--        |  
              *       O O       *           |  Standard Disclaimer Applies
_____________________________________________________________________________

fayne@tellab5.TELLABS.COM (Jeffrey Fayne) (11/13/89)

	OOPS!   Sorry, the above code fragment  listed is incorrect!

	Change:		mov	al,00100000B
	   to ;		mov	al,11011111B

			- AND -

	Change:		or	es:[418h],al
	   to :		and	es:[417h],al


	Sorry for any confusion.


-- 
_____________________________________________________________________________
                                             
If it flies,    \      _      /             |  Jeffrey M. Fayne                
  it dies...     \   /^ ^\   /              |  Tellabs, Inc.       
      ____________\_(  .  )_/____________   |  Lisle, IL  (312)-969-8800
           --*/--|_| (___) |_|--\*--        |  
              *       O O       *           |  Standard Disclaimer Applies
_____________________________________________________________________________

kthompso@entec.Wichita.NCR.COM (Ken Thompson) (11/14/89)

	mov ax,0040
	mov ds,ax
	mov al,[0017]
	and al,df
	mov [0017],al
	mov ax,4c00
	int 21


-- 
Ken Thompson     N0ITL  
NCR Corp.  3718 N. Rock Road            
Wichita,Ks. 67226  (316)636-8783       
Ken.Thompson@wichita.ncr.com                                                 

slaghtrl@lafcol.UUCP (Slaght Ralph L) (11/16/89)

Someone was seeking a numlock routine?  Here are the batch file which
I use and the uuencoded COM file which the batch file calls:


@echo off
nlok
if not errorlevel 1 goto off
echo numlock turned ON now
goto end
:Off
echo numlock turned OFF now
goto end
:end


***********cut here and run through uudecode*******
begin 666 nlok.com
=NT  CL.[%P F@#<@)HH')""+R(#Y 1O 0+1,S2$"
 
end