delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/27/16:37:20

From: "Alexei A. Frounze" <alex DOT fru AT mtu-net DOT ru>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: keyboard interrupt
Date: Mon, 27 Mar 2000 23:55:55 +0400
Organization: MTU-Intel ISP
Lines: 42
Message-ID: <38DFBCCB.6A1BC333@mtu-net.ru>
References: <8bod7h$rj1$1 AT gxsn DOT com>
NNTP-Posting-Host: ppp108-106.dialup.mtu-net.ru
Mime-Version: 1.0
X-Trace: gavrilo.mtu.ru 954187177 42124 212.188.108.106 (27 Mar 2000 19:59:37 GMT)
X-Complaints-To: usenet-abuse AT mtu DOT ru
NNTP-Posting-Date: 27 Mar 2000 19:59:37 GMT
X-Mailer: Mozilla 4.61 [en] (Win95; I)
X-Accept-Language: en,ru
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In fact, you can't make it in plane C with DJGPP. That's because
DJGPP/GCC doesn't know the reserved word such as "interrupt" or
"__interrupt". You must make IRQ wrapper in ASM and switch there stack
as well due to flat memory model which is used by C programs. But indeed
most of things could be really made in a C function that you can call
from the IRQ wrapper. This is a way Allegro works and I also implemented
similar thing w/o Allegro myself. It's rather simple. Beleive me.

Wanna sources?

ASM file is 854 bytes long with about 30 lines. :)
Main C module with kbd functions is 6 KB.
Example program is 0.5 KB.

So it's indeed very short and simple thingy.

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

Anthony Graham wrote:
> 
> I've been experimenting with the __dmpi and _go32 things and would like to
> know if anyone would be able to tell me how to do a simple keyboard routine
> (no assembly) that increases a variable whenever a key is pressed, (I'll
> make the thing a little more useful later, I just need to know how to
> replace the default keyboard interrupt routine without it crashing), also
> putting it back to normal after Q is pressed would be really helpful too.
> 
> thanks loads.
> 
> -Anthony
> 
> SPAM IS ILLEGAL...
> ONCE IT IS KNOWN THAT SPAM IS NOT WANTED
> THEY CALL IT UNSOLICITED MAIL
> YOU ARE NOT TO SEND ME ANY ADVERTISEMENTS,
> SPECIAL OFFERS OR ANYTHING WHICH MY PERMISSION IS NOT
> GRANTED
> NOW IT IS ILLEGAL

- Raw text -


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