delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/25/17:32:54

From: "Alexei A. Frounze" <alex DOT fru AT mtu-net DOT ru>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: NumLock
Date: Fri, 26 May 2000 01:17:07 +0400
Organization: MTU-Intel ISP
Lines: 55
Message-ID: <392D9853.8476DD6E@mtu-net.ru>
References: <392D5840 DOT 7A4E6899 AT t-online DOT de> <392D6242 DOT A1557120 AT mtu-net DOT ru> <392D7561 DOT 8CF3A94B AT t-online DOT de>
NNTP-Posting-Host: ppp105-185.dialup.mtu-net.ru
Mime-Version: 1.0
X-Trace: gavrilo.mtu.ru 959289412 53074 212.188.105.185 (25 May 2000 21:16:52 GMT)
X-Complaints-To: usenet-abuse AT mtu DOT ru
NNTP-Posting-Date: 25 May 2000 21:16:52 GMT
X-Mailer: Mozilla 4.72 [en] (Win95; I)
X-Accept-Language: ru,en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Just use DPMI stuff. Some simple and very useful functions are available in
the "sys/movedata.h" file.

Here goes the example:
---------------8<----------------
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <sys/movedata.h>

int main() {
  char k;
  
  clrscr();
  printf ("hit Enter for NumLock switching...\n");
  getch();

  _dosmemgetb (0x417, 1, &k);
  k ^= 1<<5;
  _dosmemputb (&k, 1, 0x417);
  
  printf ("hit Enter for NumLock switching...\n");
  getch();

  _dosmemgetb (0x417, 1, &k);
  k ^= 1<<5;
  _dosmemputb (&k, 1, 0x417);

  return 0;
}
---------------8<----------------

Good Luck
Alexei A. Frounze
-----------------------------------------
Homepage: http://alexfru.chat.ru
Mirror:   http://members.xoom.com/alexfru

Kai Dietrich wrote:
> 
> Hi!
> 
> > set/reset bit #5 at real mode segment 0x40 offset 0x17 byte.
> >
> > Good Luck
> > Alexei A. Frounze
> 
> Hmm, I had no luck...
> How do I get acces to a real mode segment+offset in DJGPPs DPMI mode
> (example code would be a great help)?
> 
> TIA
> Bye
>         Kai

- Raw text -


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