?
Solved

Using interrupts(int XX) in C++ .net

Posted on 2005-05-06
5
Medium Priority
?
380 Views
Last Modified: 2010-04-24
Why doesn't work the following code:
1: char c;      
2:  __asm{
3:    mov ah,0
4:    int 16h
5:    mov c,ah
6:  }
While debuging it gives an "Unhandled exception at 0x0040126d in 8_1.exe: 0xC0000005: Access violation reading location 0xffffffff." in the 4th line.
Why?????
0
Comment
Question by:Centauri
  • 2
3 Comments
 
LVL 11

Expert Comment

by:Jase-Coder
ID: 13950622
try puting 0x16
0
 
LVL 11

Accepted Solution

by:
Jase-Coder earned 400 total points
ID: 14198596
if my previous solution doesnt work and I dont think it does, I think it is because 32bit compilers dont allow the use of 16-bit interrupts being using in this way. I have tried on BCB6 and I was getting similar errors there. I only got it working when I used the 16-bit Turbo C++ compiler.
0
 
LVL 4

Expert Comment

by:furqanchandio
ID: 14441571
hi

the answer is provided by jase-coder is 100% correct. you cant call dos/bios functions from even visual c++ 6, then how can u do it from vC++.net

why dont you do this simply


c=getch();

cheers

:-)

0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question