public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Status indecation
@ 2003-07-24  9:33 Nigel Murphy
  0 siblings, 0 replies; 2+ messages in thread
From: Nigel Murphy @ 2003-07-24  9:33 UTC (permalink / raw)
  To: 'zippo'; +Cc: gcc-help

Hi Zippo, I'm not sure if this is of help,

 Int 16,2 (int 16, AH=2)

This function returns the state of various keys on the PC keyboard in the 
al register.
The values returned are as follows:

Bit Meaning
7 Insert state (toggle by pressing INS key)
6 Caps lock (1=capslock on)
5 Num lock (1=numlock on)
4 Scroll lock (1=scroll lock on)
3 Alt (1=Alt key currently down)
2 Ctrl (1=Ctrl key currently down)
1 Left shift (1=left shift key down)
0 Right shift (1=right shift key down)

This is the old DOS way of doing things using the BIOS.

You also got a segmentation fault due to acessing a peice of protected 
memory (i.e. outside of your program), you probably running in Protected 
Mode.

-----Original Message-----
From:	zippo [SMTP:zippo752001@comcast.net]
Sent:	23 July 2003 22:10
To:	gcc-help@gcc.gnu.org
Subject:	Status indecation

On Wed, 23 Jul 2003 10:28:33 -0400
zippo <zippo752001@comcast.net> wrote:

> I am trying to write a program and i need to be able to view the bios 
information in memory, "capslock numlock shift etc" how ever i do not know 
the code to read raw from a specific memory location, any help and i will 
be greatful.

>> maybe there is a easier way todo what i am trying todo. All i am trying 
todo is read weather capslock numlock and scrolllock are on and then return 
a value "boolean" i tried


#include <stdio.h>
typedef volatile char byte;
int main() {
	byte* ptr = (byte*)0xC000000;
	printf("%20x\n", *ptr &0xFF);
}

it compiled but when run gave me a Segmentation Fault
I was told about (API) calls but need somemore information. Thanks for any 
and all your help, zippo

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Status indecation
  2003-07-23 18:44   ` memory location zippo
@ 2003-07-23 23:06     ` zippo
  0 siblings, 0 replies; 2+ messages in thread
From: zippo @ 2003-07-23 23:06 UTC (permalink / raw)
  To: gcc-help

On Wed, 23 Jul 2003 10:28:33 -0400
zippo <zippo752001@comcast.net> wrote:

> I am trying to write a program and i need to be able to view the bios information in memory, "capslock numlock shift etc" how ever i do not know the code to read raw from a specific memory location, any help and i will be greatful.

>> maybe there is a easier way todo what i am trying todo. All i am trying todo is read weather capslock numlock and scrolllock are on and then return a value "boolean" i tried 


#include <stdio.h>
typedef volatile char byte;
int main() {
	byte* ptr = (byte*)0xC000000;
	printf("%20x\n", *ptr &0xFF);
}

it compiled but when run gave me a Segmentation Fault
I was told about (API) calls but need somemore information. Thanks for any and all your help, zippo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-24  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-24  9:33 Status indecation Nigel Murphy
  -- strict thread matches above, loose matches on Subject: below --
2003-07-23 17:20 gcc error: /usr/bin/ld: cannot open crt1.o: No such file or directory Navtej Buttar
2003-07-23 18:08 ` Rupert Wood
2003-07-23 18:44   ` memory location zippo
2003-07-23 23:06     ` Status indecation zippo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).