Mail Archives: djgpp/1996/12/05/05:53:40
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 -