Date: Thu, 11 Jan 2001 15:07:02 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Igor Shapiro cc: djgpp AT delorie DOT com Subject: Re: far functions with GCC In-Reply-To: <93jr6f$1t89$1@berg.samara.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.