www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Problem with inline assembly interrupts

↑ ↓ ← Nac <Nac_member pathlink.com> writes:
I'm trying to do some basic interrupts in my inline assembly, but when I run the
program it performs an illegal operation. The inline assembly works fine when I
don't use interrupts.

Here's the code I'm using:

#include <stdlib.h>
int main()
{ 
asm {
mov dl,30h
mov ah,06
int 21h
}
system("PAUSE");
return 0;
}


It should print '0' to the screen. I've also tried some examples from the
Digital Mars FAQs, and the ones without interrupts work fine, but the others
crash.

Thanks for help!
Apr 14 2006
↑ ↓ Jan Knepper <jan smartsoft.us> writes:
Don't think you really can do that in Win32 code...
How did you target the code? DOS 16 bits?



Nac wrote:
 I'm trying to do some basic interrupts in my inline assembly, but when I run
the
 program it performs an illegal operation. The inline assembly works fine when I
 don't use interrupts.
 
 Here's the code I'm using:
 
 #include <stdlib.h>
 int main()
 { 
 asm {
 mov dl,30h
 mov ah,06
 int 21h
 }
 system("PAUSE");
 return 0;
 }
 
 
 It should print '0' to the screen. I've also tried some examples from the
 Digital Mars FAQs, and the ones without interrupts work fine, but the others
 crash.
 
 Thanks for help!
 
 

-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Apr 14 2006
↑ ↓ → Nac <Nac_member pathlink.com> writes:
Yes, I was compiling for Win32...I fiddled with command line args to change it
to DOS16 mode and now it works fine. Thanks!


In article <e1o9lj$2fvc$1 digitaldaemon.com>, Jan Knepper says...
Don't think you really can do that in Win32 code...
How did you target the code? DOS 16 bits?




-- 
ManiaC++
Jan Knepper

But as for me and my household, we shall use Mozilla...
www.mozilla.org

Apr 14 2006