473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Int86 function in C

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.

Mar 21 '06 #1
9 14811

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>

Mar 21 '06 #2
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.

Mar 21 '06 #3
Vladimir S. Oka wrote:
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>

Mar 21 '06 #4
On 21 Mar 2006 06:07:15 -0800, "santosh" <sa*********@gmail.com> wrote
in comp.lang.c:
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/~a...FAQ-acllc.html
Mar 21 '06 #5
"santosh" <sa*********@gmail.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).

--
Keith Thompson (The_Other_Keith) ks***@mib.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.
Mar 21 '06 #6
Keith Thompson wrote:
"santosh" <sa*********@gmail.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.

Mar 21 '06 #7
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.


<OT>
It depends on the implementation. In one system getch() might end up
calling the same code (BIOS?) as int86 with service no. 22 might. In
another system int86() may not even be available while getch() may be.
This is something you should not worry about to write programs.

In fact, sticking to pure ISO standard C is a good way to start out.
Then as your programming skill improves and you need platform specific
functionality, you can learn such specific stuff as the above.

Look up the description for getch() and int86() at the following URL.
If you absolutely need to know their implementation in DJGPP, you can
look up the sources, as it is Free Software.
http://www.delorie.com/djgpp/doc/libc/
</OT>

Finally, in future, please post only standard C related questions to
this group. Post platform specific questions like the above to their
respective groups like comp.os.msdos.djgpp. That way, you're assured of
the most relavent and accurate response.

Mar 21 '06 #8
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

Mar 22 '06 #9
hd****@gmail.com wrote:
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?

Mar 22 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
5
by: phil_gg04 | last post by:
Dear Javascript Experts, Opera seems to have different ideas about the visibility of Javascript functions than other browsers. For example, if I have this code: if (1==2) { function...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
2
by: sushil | last post by:
+1 #include<stdio.h> +2 #include <stdlib.h> +3 typedef struct +4 { +5 unsigned int PID; +6 unsigned int CID; +7 } T_ID; +8 +9 typedef unsigned int (*T_HANDLER)(void); +10
6
by: os2 | last post by:
hi with turbo c, it exist a function name int86 whick triggers the serial interrupt. i search the same function under linux any idea? thanks
0
by: Arun | last post by:
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...
2
by: Fredmanglis | last post by:
I have encountered the int86() function while reading some books on C. It however does not work on my Ms Visual Studio compiler and I was just wondering, is it still a supported standard and if it...
3
by: abd elkader | last post by:
what is the int86(51,&in,&out) ......what's the 51 i kown it's interrupt number but that mean and what the in,out in (union REGS in,out)
1
by: JKaur | last post by:
hello frnds, please tell me the difference between DOS interrupts and interrupts invoked using int86() function in C (are those 8086 intrupts?). In some text i have read these are different, but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.