delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/20/23:19:39

From: Genady Beryozkin <c0467082 AT techst02 DOT technion DOT ac DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How do I write to the keyboard LEDs?
Date: Mon, 20 Oct 1997 22:32:44 +0200
Organization: The Technion
Lines: 71
Message-ID: <344BBFEC.A44831D9@t2.technion.ac.il>
References: <199710182000 DOT NAA16445 AT adit DOT ap DOT net>
NNTP-Posting-Host: 192.115.49.13
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

This is a multi-part message in MIME format.
--------------7B55C5C9D81D6DD31F3F1EF0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

> At 05:27  10/18/1997 GMT, Sam. wrote:
> >How do I write to the keyboard LEDs? I know this is possible, is there
> >a simple function to do it? I can read them with _bios_keyboard, can
> >it do the job?

> From: Nate Eldredge <eldredge AT ap DOT net>

Hi !

An alternative way to do that 
-----------------------------
You can write directly to keyboard's port 
0x60 or 0x64.

here is a summary from the interrupt list

0edH : Turn LED 'lock key' lights on or off. First send 0edH, then send
byte
_7 6 5 4 3  2  1  0_
_not used_  c_ n_ s _
_               _
ScrollLock light 01H=turn on     _ _
NumLock light    02H=turn on       _
CapsLock light   04H=turn on        

The bit positions 0-3 correspond to bits 4-6 of the keyboard flags
variable in the BIOS Data area.  You should make an effort to keep the
flags in sync with the lights.  For instance, if you do a big favor for
the user and set his ten-key pad into NumLock mode (by setting bit 5 of
0:0417) then be sure to turn on the corresponding LED (eg, bit 1).


so you may want to do the following:

	mov al,0edh
	out 060H,al
	nop
	mov al,3		// scrolllock and numlock on
	out 060H,al

you should try port 64H if port 60H does not work.

for more information read the interrupt list.

Genady
--------------7B55C5C9D81D6DD31F3F1EF0
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Genady Beryozkin
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Genady Beryozkin
n:              Beryozkin;Genady
org:            The Technion
adr:            ;;;Natzrat Illit / Haifa;;;Israel
email;internet: c0467082 AT t2 DOT technion DOT ac DOT il
note:           Homepage : http://t2.technion.ac.il/~c0467082/
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------7B55C5C9D81D6DD31F3F1EF0--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019