www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/21/04:12:52

Date: Wed, 21 Aug 1996 10:56:46 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: John Joseph Newbigin <079519 AT bud DOT cc DOT swin DOT edu DOT au>
Cc: djgpp AT delorie DOT com
Subject: Re: assembly
In-Reply-To: <Pine.OSF.3.91.960820140336.2062A-100000@bud.cc.swin.edu.au>
Message-Id: <Pine.SUN.3.91.960821104943.336S-100000@is>
Mime-Version: 1.0

On Tue, 20 Aug 1996, John Joseph Newbigin wrote:

> > _main:
> > 
> >       movl $string, %dx                 # move string into dx
> >       movb $0x09, %ah                   # print the string, calling
> >       int  $0x21                        # int 21h, subfunction 9h
> This is doing a protected mode int. but DOS is a real mode program. I am 
> sure there is a reason why it works under 95, but I don't know it.

I think the above explanation is incorrect.  I think the DPMI server
catches the INT instruction and reissues it after switching to real mode. 
The real problem is that the DX register has a pointer to a protected-mode
address, and DOS cannot get at these.  Windows 95 probably moves the
contents of $string to a buffer in conventional memory and puts its
address into DX before reissuing the interrupt, so it works.

The bottom line is that the above technique can be only used in DJGPP for 
interrupt functions that don't need pointers to buffers.  For more 
details, see sections 18.1 and 18.2 of the DJGPP FAQ list (available as 
v2/faq201b.zip from the same place you get DJGPP).

- Raw text -


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