Click to See Complete Forum and Search --> : Assembly langauge from VC++


Sivakumar
September 27th, 1999, 02:52 PM
Hi,

Could you please let me know how to execute the assembly language instruction int ( interrupt)
from VC++ 6.0

Whenever I include the instruction



_asm
{
mov ..
int ..
}



and execute the application, then I get a run time error always.

Any clarification would be appreciated.

Regards

Siva

Email: siva@indusaglobal.com


Programming is always a learning process

Anthony Mai
September 27th, 1999, 04:59 PM
Forget about it. The Windows operating system, which works under protected mode of the x86 CPU, wrapes everything up so there is simply no way you can access a device directly, read from or write to a specific memory location, create or handle hardware or software interrupts, etc. You used to be able to write to certain memory locations under 1MB in Win16. Now even that is impossible.

You have to write your VxD to do any kind of low level programming. Unfortunately that is not something easy to learn.


I hate fat programs as much as I hate being fat myself. I am lean and mean and so is my program.

Paul McKenzie
September 28th, 1999, 09:46 AM
What interrupt are you trying to call? This piece of information is what you should have posted. The problem is *not* the int instruction itself; it's the interrupt that you are trying to execute.

Regards,

Paul McKenzie

Sivakumar
September 28th, 1999, 11:19 AM
I need to find the total number of sectors in a CD drive and also I need to read the content of a sector from a CD drive.

Any solution towards this would be excellent.

Regards

Siva
Email: siva@indusaglobal.com

Programming is always a learning process

Paul McKenzie
September 28th, 1999, 11:42 AM
Have you tried DeviceIoControl()? Also, look at article Q138434 in the MSDN on-line help.

Regards,

Paul McKenzie

Sivakumar
September 28th, 1999, 11:48 AM
Paul,

Once again thanks for your time and efforts.

But, the solution with DeviceIoControl does not work with Win 95 and 98. The product which I am developing should work with Win 95 and 98.

The other reference given in MSDN directly calls the assembly language and that is not successfully getting compiled in VC++.

Your guidance would be a great success to my project.

Thanks and regards

Siva

Email: siva@indusaglobal.com

Programming is always a learning process

Paul McKenzie
September 28th, 1999, 12:00 PM
But according to your original post, it is successfully compiled. It just doesn't run.

The problem is that no one knows what the steps that you are trying to do. Given that you have found the reference in MSDN, can you tell me the "Q" number of the article in MSDN, and posting more code on what you are trying to do? A "mov" and an "int" is not enough information for anyone to help.

BTW, does article "Q137813" help?

Regards,

Paul McKenzie

Sivakumar
September 28th, 1999, 12:08 PM
Paul,

I was reding the article Q137813 and compiled the program as per the instruction in that article.

Yes, it compiled and whenever I execute it gives an error 'Fatal Exception'.

My only problem is how to read a sector from a CD drive.

As mentioned earlier, the solution works with every drive but not with a CD.

Please enlighten my vision on this.

Regards

Siva


Programming is always a learning process

Paul McKenzie
September 28th, 1999, 12:54 PM
Where does it give the fatal exception? Have you used the debugger? What function is being executed? Have you looked at the register window to make sure that the register arguments are valid? Are you making sure that you are following the code *exactly*? Your first post only showed a mov and an int. The code in the actual article is much more extensive. Since this question entails a lot of code, it is better that you provide much more information to us.

Also, since the article is named "How Win32 Applications Can Read CD-ROM Sectors in Windows 95", I would suspect that this is the right way to do it. Other than that, this is the only resource that I know of that answers your questions concerning reading CD sectors.

Regards,

Paul McKenzie