www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/05/05:53:40

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Passing an address in ES:BX to and int.
Date: Sat, 30 Nov 1996 00:22:13 -0800
Organization: Three pounds of chaos and a pinch of salt
Lines: 29
Message-ID: <329FEEB5.FCB@cs.com>
References: <57obtd$9ro AT news DOT sas DOT ab DOT ca>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp102.cs.com
Mime-Version: 1.0
To: jonklipp AT freenet DOT edmonton DOT ab DOT ca
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

jonklipp AT freenet DOT edmonton DOT ab DOT ca wrote:
> 
> Anyway, I'm trying to port some code written for Borland C.  I need to
> call interrupt 2eh.  I know hoe to call the interrupt and everything, BUT,
> it needs ES:BX to point to a structures address in my code.  In Borland,
> this is easy, you just use FP_SEG and FP_OFF.  Offset can be figured out
> in DJGPP just by using &variable, unless I'm terribly wrong.  I don't know
> how to figure out the variables segment is.  Assuming that the structure
> is in the same segment as the code, would something like:
> 
>         sregs.es =_my_cs();
> work?
> 
> Anybody know how to do this?  I guess I'm basically wondering if there is
> a DJGPP equivilant of FP_OFF and FP_SEG.

This problem is addressed in sections 17.7 and 18.2 of the DJGPP
Frequently Asked Questions list (v2/faq202b.zip), and the whole of those
sections describes the various pitfalls and techniques for accessing
hardware interrupts under DJGPP and DPMI.  There are a number of
Borland-isms that you are going to have to unlearn, but in general it's
much nicer to do things DJGPP-style.  ;)

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |        fighteer AT cs DOT com          |
| Proud owner of what might one   |   http://www.cs.com/fighteer    |
| day be a spectacular MUD...     | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------

- Raw text -


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