The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: armiof1 on August 16, 2010, 03:18:22 AM

Title: Calling 16bit interrupts with DPMI from 32bit c++
Post by: armiof1 on August 16, 2010, 03:18:22 AM
Hi all, is it possible to call a 16bit interrupt from 32bit c++ inline code using DPMI in windows 7. I have seen a snippet that uses 32 bit and 16 bit dll's to do a thunk. could that be skipped in favor of an inline __asm block. Thanks in advance.
Title: Re: Calling 16bit interrupts with DPMI from 32bit c++
Post by: dedndave on August 16, 2010, 03:26:10 AM
i doubt that'll fly
win32 kernel has no INT 2xh service routines or handlers
even if it did, it would require ring 0 access to execute the INT
BIOS has changed over the years, as well - i haven't kept up with it
Title: Re: Calling 16bit interrupts with DPMI from 32bit c++
Post by: armiof1 on August 16, 2010, 03:28:04 AM
Thanks for the quick reply.
Title: Re: Calling 16bit interrupts with DPMI from 32bit c++
Post by: armiof1 on August 16, 2010, 03:32:40 AM
So im thinking i will have to go through the system32 API's to do anything low level.
Title: Re: Calling 16bit interrupts with DPMI from 32bit c++
Post by: hutch-- on August 16, 2010, 04:15:52 AM
Yes and be thankful, the API is far more powerful than DOS interrupts.
Title: Re: Calling 16bit interrupts with DPMI from 32bit c++
Post by: armiof1 on August 16, 2010, 01:17:04 PM
Just to be clear are the 16bit interrupts dead in favor of API call or are there certain current situations ie. program implementations in which they can be used.
Title: Re: Calling 16bit interrupts with DPMI from 32bit c++
Post by: dedndave on August 16, 2010, 04:02:41 PM
if you write a 16-bit program, they are emulated through NTVDM.exe
i have ran some fairly complex old stuff that seems to run ok
note that no 64-bit OS's support 16-bit programs - 32-bit OS's seem to be ok with it
that does not allow you to hop back and forth between the 32-bit API and 16-bit INT's
i suppose someone with enough desire could figure out NTVDM and make something happen
probably more work than it's worth