News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Interrupts and 32 bits

Started by ookami, February 15, 2011, 08:54:43 AM

Previous topic - Next topic

ookami

I read in one topic that we can't use interrupts in 32 bits mode. I have two questions :

- Why ?
- So in the 32 bits mode the INT instruction is totally useless ?

Thanks

hutch--

Yes unless you are writing very low level drivers for ring0.

Use the Windows API functions.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

japheth

Quote from: ookami on February 15, 2011, 08:54:43 AM
I read in one topic that we can't use interrupts in 32 bits mode. I have two questions :

- Why ?
- So in the 32 bits mode the INT instruction is totally useless ?

You can use the INT instruction in 32-bits of course. The problem is that many ints won't do anything else than a GPF. Exceptions are: INT 3 (which is similar to DebugBreak()), INT 2Eh (which is/was used to call the "native API"), ...

So the INT instruction is not totally useless, but just not used that often anymore.

ookami

#3
Thank you. :U

But why does that make a GPF ? What exactly the problem ?

FORTRANS

Hi,

   Why?  Because the people that wrote Windows as a 32-bit
protected mode operating system decided to use CALL to
access the API rather than using INT.  So an interrupt is
generally just not supported.  And if it is not supported, it
is an error.  GPF.

   To a different why, DOS used INT to access its various
functions.  As DOS went through newer versions and both
Microsoft and third parties added functions, the interrupt
"chain" became rather complex and "slow".  And that is a
possible explanation for not wanting to use interrupts for
the more complex API of Windows.  Though that is just
a guess of course.

Cheers,

Steve N.

dedndave


Magnum

http://www.informit.com/articles/article.aspx?p=22442

I can't run this code right now cuz I am a Vista System.

NtQuerySystemInformation:
    mov   eax, 97h
    lea   edx, [esp+4]
    int   2Eh
    ret   10h
Have a great day,
                         Andy

ookami