www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/11/08:19:11

Date: Thu, 11 Jan 2001 15:07:02 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Igor Shapiro <shapiroigor AT mail DOT ru>
cc: djgpp AT delorie DOT com
Subject: Re: far functions with GCC
In-Reply-To: <93jr6f$1t89$1@berg.samara.net>
Message-ID: <Pine.SUN.3.91.1010111150115.17787A@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 11 Jan 2001, Igor Shapiro wrote:

>     The situation is as follows: I wrote a C++ program with Watcom, that
> loads external modules (lets call them drivers). The "driver" is written
> with GCC because it supports binary targets (maybe other compilers do
> support?). So the C++ program reads the driver into a new allocated segment.
> So when it calls a function from the driver it must do a far call. So the
> function must end by retf - isn't it? :-)

You could use ``asm("lret");'', I suppose.

Note that Watcom and GCC probably differ in how they set up segment 
registers, so you will need to restore important registers such as SS, 
ES, and perhaps GS.

- Raw text -


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