C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Int86 function in C

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language
View previous topic :: View next topic  
Author Message
Arun
Guest





PostPosted: Tue Mar 21, 2006 2:06 pm    Post subject: Int86 function in C Reply with quote



I recently came to know that using int86 function with interrupt number
22 we can identify keystrokes.
I want to know whether this is in any way different from getch()
function.
any help on this is much appreciated.
Back to top
Vladimir S. Oka
Guest





PostPosted: Tue Mar 21, 2006 2:06 pm    Post subject: Re: Int86 function in C Reply with quote



Arun wrote:
Quote:
I recently came to know that using int86 function with interrupt number
22 we can identify keystrokes.
I want to know whether this is in any way different from getch()
function.
any help on this is much appreciated.

[Posting once every minute does not hasten the responses (unless it's
Google playing up again, but it usualy does it thrice).]

Why not look into a standard `getchar()` function, which is guaranteed
to exist on any conforming implementation?

<OT>
It is different in a fundamental way. You stand a fighting chance that
`getch()`, although non-standard will be implemented in the next
incartnation of your compiler/library. Using interrupts locks you
completely to MS DOS platform.
</OT>
Back to top
santosh
Guest





PostPosted: Tue Mar 21, 2006 3:06 pm    Post subject: Re: Int86 function in C Reply with quote



Arun wrote:
Quote:
I recently came to know that using int86 function with interrupt number
22 we can identify keystrokes.
I want to know whether this is in any way different from getch()
function.
any help on this is much appreciated.

There is no 'int86' or getch() function in standard C. The latter
though is a common extension. For the former you probably meant INT 80h
interface to the Linux kernel? In any case, none of it is standard (and
hence portable) C, which is the topic for this newsgroup.
Back to top
santosh
Guest





PostPosted: Tue Mar 21, 2006 3:06 pm    Post subject: Re: Int86 function in C Reply with quote

Vladimir S. Oka wrote:
Quote:
Arun wrote:
I recently came to know that using int86 function with interrupt number
22 we can identify keystrokes.
I want to know whether this is in any way different from getch()
function.
any help on this is much appreciated.

[Posting once every minute does not hasten the responses (unless it's
Google playing up again, but it usualy does it thrice).]

Why not look into a standard `getchar()` function, which is guaranteed
to exist on any conforming implementation?

OT
It is different in a fundamental way. You stand a fighting chance that
`getch()`, although non-standard will be implemented in the next
incartnation of your compiler/library. Using interrupts locks you
completely to MS DOS platform.
/OT

<OT>
Software interrupt based interfaces are also present in Linux and
Windows, though in the latter's case, they aren't really usable. It
depends on the Interrupt number. I think the OP means INT 80h for
Linux.
</OT>
Back to top
Jack Klein
Guest





PostPosted: Tue Mar 21, 2006 5:06 pm    Post subject: Re: Int86 function in C Reply with quote

On 21 Mar 2006 06:07:15 -0800, "santosh" <santosh.k83 (AT) gmail (DOT) com> wrote
in comp.lang.c:

Quote:
Arun wrote:
I recently came to know that using int86 function with interrupt number
22 we can identify keystrokes.
I want to know whether this is in any way different from getch()
function.
any help on this is much appreciated.

There is no 'int86' or getch() function in standard C. The latter
though is a common extension. For the former you probably meant INT 80h
interface to the Linux kernel? In any case, none of it is standard (and
hence portable) C, which is the topic for this newsgroup.

Off topic, but no, he probably didn't mean the Linux system call
interrupt.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
Back to top
Keith Thompson
Guest





PostPosted: Tue Mar 21, 2006 9:06 pm    Post subject: Re: Int86 function in C Reply with quote

"santosh" <santosh.k83 (AT) gmail (DOT) com> writes:
Quote:
Arun wrote:
I recently came to know that using int86 function with interrupt number
22 we can identify keystrokes.
I want to know whether this is in any way different from getch()
function.
any help on this is much appreciated.

There is no 'int86' or getch() function in standard C. The latter
though is a common extension. For the former you probably meant INT 80h
interface to the Linux kernel? In any case, none of it is standard (and
hence portable) C, which is the topic for this newsgroup.

Actually, getch() is several common extensions. There's a function by
that name in DOS and/or Windows, and another one in curses/ncurses
(which is mostly Unix-ish).

--
Keith Thompson (The_Other_Keith) kst-u (AT) mib (DOT) org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Back to top
santosh
Guest





PostPosted: Tue Mar 21, 2006 9:06 pm    Post subject: Re: Int86 function in C Reply with quote

Keith Thompson wrote:
Quote:
"santosh" <santosh.k83 (AT) gmail (DOT) com> writes:
Arun wrote:
I recently came to know that using int86 function with interrupt number
22 we can identify keystrokes.
I want to know whether this is in any way different from getch()
function.
any help on this is much appreciated.

There is no 'int86' or getch() function in standard C. The latter
though is a common extension. For the former you probably meant INT 80h
interface to the Linux kernel? In any case, none of it is standard (and
hence portable) C, which is the topic for this newsgroup.

Actually, getch() is several common extensions. There's a function by
that name in DOS and/or Windows, and another one in curses/ncurses
(which is mostly Unix-ish).

Yes, along with getche() and others. That's what I said too. I have no
idea though about 'int86', whatever it may be, and it's differences
from getch(), which is what the OP wants to know.
Back to top
Guest






PostPosted: Wed Mar 22, 2006 2:06 am    Post subject: Re: Int86 function in C Reply with quote

int86() is a standard non-standard way of acessing the DOS and BIOS
API on a PC. It's possible to do things easily in DOS by using them. An
overly complete set of things you can do in such architectures is in
the Ralf Brown Interrupt list:

http://www.ctyme.com/rbrown.htm

There it says int 0x16 (22) is keyboard utilities.

Remember: use int86 and you'll be locked in that awful operating
system, FOREVER !!!
Hint: there's a curses version for DOS. It has getch() and much more !
http://pdcurses.sourceforge.net/
Hint 2: If you'd like to code more easily and faster, use a high level
language, with many built-in features, like Python or Ruby.

Henrique Dante de Almeida
Back to top
santosh
Guest





PostPosted: Wed Mar 22, 2006 7:06 am    Post subject: Re: Int86 function in C Reply with quote

hdante (AT) gmail (DOT) com wrote:
Quote:
int86() is a standard non-standard way of acessing the DOS and BIOS
API on a PC.
rest snipped


Thanks for the info, but can we end this highly off-topic thread now?
Back to top
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language All times are GMT
Page 1 of 1

 
 


Powered by phpBB © 2001, 2006 phpBB Group