• Advertisement
Sign in to follow this  

can't use interrupts in protected mode ?

This topic is 3871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, im trying to write a 16 bit app, but there seems to a be a problem with interrupts, that is whenever i use them the app crashes. I looked it up on a few forums and found out that ints are only available in 16 bit real mode. I want to access the BIOS/DOS services. How can I assemble/link my app so it would run in 16 bit real? I have a 16 bit linker (masm). Thanks ))

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by LessBread
What do the people at those other forums say?


they said make yr app 16 bit, but thats the problem, i got a 16 bit linker and assembler, but im still forced to specify /SUBSYSTEM:CONSOLE for linker options which as msdn states is a 32bit windows console. Although i just downloaded Pass32 assembler and the interrupts seem to work but I think it uses somesort of remapping or something. Is ther any way I can write a 16 bit app and run it in real mode under windows? thx

Share this post


Link to post
Share on other sites
It sounds like your linker isn't 16 bit at all. The executable formats for 16 bit apps are ME and LE and .com of course. /SUBSYSTEM:CONSOLE sounds like a flag involved in producing PE files (ie 32 bit exe).

According to what I know, such a 16 bit app would run in an emulator/virtual machine. Real mode under windows defeats the purpose of running windows in the first place.

Share this post


Link to post
Share on other sites
16 bit applications are emulated under Windows with the NTVDM. It
emulates real mode, not protected mode. Hence, you are in real mode.

It sounds like your compilier is 32bit (Not 16) as LessBread pointed out.
If this is true, then no--you cannot use DOS/BIOS interrupts.

Normally in this case, you would either switch into real mode to
execute the interrupts (v8086 mode); then switch back to protected
mode. Another method is direct hardware programming using io ports.
ie, writing your own drivers.

I only know of 32bit versions of masm. What version are you using?

A good 16bit assembler you can try is Netwide Assembler (NASM)

Share this post


Link to post
Share on other sites
Quote:
Original post by Crypter
I only know of 32bit versions of masm. What version are you using?

I'm using MASM 8 for VC++ Express, and the docs said that the linker it provides is a 16 bit one (linker is link.exe Microsoft Incremental Linker)
Quote:

A good 16bit assembler you can try is Netwide Assembler (NASM)

I tried so many, I think I have over 4 assemblers, TASM, NASM, MASM, FASM, and Pass32, but for each one the syntax is different, which I found surprisin coming from the highlevel langs. Up to now the only assembler that worked was masm, and its free too D

Quote:
Original post by Rockoon1
What asm model are you using?

I'm using the small model, is that what you ment? If you meant the assembler than im using masm 8.

btw thanks for replies ))

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement