www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/10/03:45:59

Date: Tue, 10 Mar 1998 10:45:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Samir Barjoud <samir AT mindspring DOT com>,
Lennart Marien <lennartm AT metronet DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: Newbie prolem with ASM!
In-Reply-To: <3504abd0.12351691@news.miami.mindspring.com>
Message-ID: <Pine.SUN.3.91.980310104430.3898K-100000@is>
MIME-Version: 1.0

On Tue, 10 Mar 1998, Samir Barjoud wrote:

> > _asm_("
> > movsw $0x0003, %ax
> > int 0x10
> > ")
> 
> Even if the above had compiled ok...it would not have had the
> desired effect at run-time. Since DJGPP compiled programs
> run in 32-bit protected mode, you can't directly call a real
> mode interrupt. In fact, it would have most likely triggered a 
> floating point exception, as that is what vector 16 is used for 
> in protected mode.

Actually, it *is* possible to use the INT NN instruction directly from
a DJGPP program.  Functions which are register-based (i.e., they don't
involve passing data in a buffer) will really work this way.  That's
because the DPMI server traps the INT instruction and reflects it to
real mode (that is, it switches to real mode and reissues the
interrupt call).

Please in the future try testing the validity of your opinions before
posting such definitive replies.  With short code snippets such as the
one above, it is very easy.  The issue of protected-mode programming
is complicated enough even without false assertions.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019