Hi! I just wanted to know if Interrupts work in Windows. I tried using the conventional DOS interrupts in MASM, but it wouldn't work. Is there any way at all to get through Windows while still using MASM? Any help appreciated. Thanks!
Posted on 2001-04-21 11:02:00 by Nitin
In protected mode, interrupts work far differently than in real mode. While no Windows program (other than those designed to run for Windows 3.x) can directly call an interrupt, interrupts still do occur in Windows. (Quite frankly, interrupts are hard to get rid of!) If what you're trying to do is much like what interrupts are used for in DOS, you should consult the Windows 32 API. I'm sorry I can't give you a link, but there's probably one on Iczelion's homepage. If you're trying to run a console mode program, you might find it interesting to note that they are -not- DOS programs. They still use the Windows kernel, and thus, are very nearly identical in respects of security and protection. If you want a collection of all available DOS interrupts for real or protected mode programming, you should look for the famous Ralf Brown's interrupt list. It covers literally everything you ever wanted to know, tripled. I hope you find this information useful. If not, sorry...I tried. :)
Posted on 2001-04-21 14:39:00 by Racso
Nitin, Interrupts in DOS were primarily system functions accessed through registers. In 32 bit protected mode Windows, the system function are accessed throught the API calls. Much of the hardware is no longer accessible at that level and if you try to make most interrupt calls, you will get crashes. System calls in Windows differ in that they are accessed through stack parameters rather than registers. There is a far greater range of system calls you can make and where applicable, they have 32 bit range which is much larger than 16 bit range. Regards, hutch@pbq.com.au
Posted on 2001-04-21 18:43:00 by hutch--
OK, so Win doesn't allow you to use int's, but I found something very confusing in MSDN. Please go here (CD-ROM version, "contents" treeview): MSDN Library Visual Studio 6.0\Platform SDK\Windows Base Services\Windows 95 features\Windows 95 reference\Functions Suddenly, all kinds of INT's with ASM source! What IS this? :confused:
Posted on 2001-04-22 09:02:00 by Qweerdy
Qweerdy, You can use some of the interrupts in win95 but not in later versions. I used a DOS interrupt to interrogate a printer and it worked fine in win 95 but it fails on NT4, win2k, 98 I think from memory so they are no real use. Better to use the APIs where you can as they tend to be reliable across different versions. Regards, hutch@pbq.com.au
Posted on 2001-04-22 09:56:00 by hutch--
Hey! Thanks for all the info! I was wondering if something was wrong with the compiler or something. I was expecting the compiler to be backwards-compatible, but it didn't go the way I thought it would. It just gave a hell lotta errors in compiling wherever I specified anything of the sort "int 21h". Anyways, feel free to visit my DOS Assembly site: http://asmprogramming.terrashare.com I'm working on a Windows version, which should be ready in a few more weeks.
Posted on 2001-04-22 16:37:00 by Nitin