www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/16/17:00:58

From: "DeHackEd" <Not DOT given AT out>
References: <19980516194750 DOT 22475 DOT rocketmail AT send1e DOT yahoomail DOT com>
Subject: Re: Question about DJGPP
Date: Sat, 16 May 1998 16:51:05 -0400
Lines: 54
Message-ID: <uyhkBxQg9GA.104@uppubnews03>
Newsgroups: comp.os.msdos.djgpp
NNTP-Posting-Host: d8-bn46-blvl-pda.attcanada.net [142.194.137.200]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Luke Strozek wrote in message
<19980516194750 DOT 22475 DOT rocketmail AT send1e DOT yahoomail DOT com>...
>Hello!
>
>1. I`ve downloaded DJGPP several days ago. I`m only a beginner and I
>would like to know if there is any function in GCC that makes a
>pointer to a specific memory field. In Borland C/C++, which I used
>before, there was such function called MK_FP. And what about FP_SEG
>and FG_OFF?


You cannot reference memory directly unless it's your own or you've allocated it
using MALLOC. This is explained in the FAQ IIRC. There are functions that will
do such things, and you can disable protected memory, but this risks too much.
Using a NULL pointer by accident is too much to think about.

Just imagine DJGPP is being stuck on the huge memory model, because that's the
way it works. No more segments, offsets, near, far etc.

>2. I would also like to know how to generate interrupts in DJGPP using
>REGS union and SREGS. The int86 function has only one union as a
>parameter. And what if I would like to include registers like ah and
>es in ONE interrupt?


_dpmi_regs or some such. Read the info docs on _dpmi_int and you will get
details.

>3. Does DJGPP allocate EMS memory when calling function MALLOC? And do
>I need to declare some 'far' (as it was in BCC) pointers?


Don't use the word FAR. DJGPP will use whatever memory it can get it's hands on,
even if it has to swap (this is dependant on your DPMI server, but CWSDPMI can
do it, and so will Windows :)).

char *memory = malloc(HUGE_NUMBER); will work perfectly well. FAR will cause
errors.

>4. Does DJGPP accept OBJ files from different compilers? (but code
>written in C)?


Not directly. There are a few utilities to do such things, but they require the
code to be compiled in a few restrictions. Your best bet is to re-compile them.

--
"DeHackEd"

EMail address not given out due to low-life spammers.




- Raw text -


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