<--- Turn the page
   
(contents page)
   
Turn the page ---> ![]() The Keyboard LEDsChanging the Keyboard Status LEDs |
Have you ever wanted to make sure the CAPS LOCK was off, NUM LOCK was on, or both at the start of your program? Well, here we are going to find out how. DOS has a BYTE in low memory that keeps track of these items. It is very simple to change the bit representation in this BYTE. This BYTE is at located at address 0040:0017h.
|
To change the state of one of these items, simple set the corresponding BIT to the desired value, 0 for OFF, 1 for ON. Remember that BIT 7 is the left most BIT in the BYTE. Let us make sure the CAPS LOCK is off. push es mov ax,0040h mov es,ax mov al,es:[0017h] and al,10111111b mov es:[0017h],al pop esIt would be the same for the other four (4) items. ¥ |
<--- Turn the page
   
(contents page)
   
Turn the page ---> Page 3