The MASM Forum

General => The Campus => Topic started by: gapry on April 27, 2015, 10:19:51 AM

Title: How can I use Interrupt in 64-bits Window 7/8 via x86 Instruction ?
Post by: gapry on April 27, 2015, 10:19:51 AM
Dear:

     If I need to write some applications via x86/x64 Instruction in Window 7, how can I use Interrupt or Exception to speedup my program? For now my approach is polling or coroutine, I hope I can speedup it via Interrupt or Exception. I read the book, Assembly Language for x86 Processors (7th) and found a approach, 16-Bit MS-DOS Programming. But I think that is out of date. Any suggestion?

Thanks
Title: Re: How can I use Interrupt in 64-bits Window 7/8 via x86 Instruction ?
Post by: dedndave on April 27, 2015, 12:31:56 PM
what kind of event triggers it ?
interrupts are pretty much unusable, at least in user mode
not even sure they are usable in kernel mode
Title: Re: How can I use Interrupt in 64-bits Window 7/8 via x86 Instruction ?
Post by: hutch-- on April 27, 2015, 01:28:42 PM
Hi gapry,

Welcome on board. You are right, the old 16 bit DOS was real mode addressing where 32 and 64 bit Windows are protected mode addressing and the ranges are entirely different. As Dave mentioned, some kernel mode drivers use specific interrupts for some hardware tasks but they are not available in user mode at all. The trick is to learn your Widows API functions well including sometimes complex variations and you will get the best you can get this way.

Look at multiple threading and picking the right API combination and you may surprise yourself. Fast algorithms are an art so get used to timing different algos to get the speed you need.
Title: Re: How can I use Interrupt in 64-bits Window 7/8 via x86 Instruction ?
Post by: rrr314159 on April 27, 2015, 05:37:11 PM
hello gapry.

Depends what interrupt you're looking for, traditional 16-bit interrupts are not available but there are callback functions that do the same sort of thing, namely asynchronously call a designated routine in your program, taking the place of polling. There are also software interrupts like "int 3" used for debugging that could be cleverly adapted to your needs, maybe. It depends entirely what you're trying to do. As hutch says there are plenty of ways to speed up programs, interrupt vs. polling is only one of many issues, usually not very important.