delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/14/17:27:53

Message-ID: <38A81EDA.B586F57A@kt.cybersurf.de>
Date: Mon, 14 Feb 2000 16:27:23 +0100
From: =?iso-8859-1?Q?J=F6rg?= Schumann <jschumann AT kt DOT cybersurf DOT de>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en-US,de,en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: void far *pointer
Reply-To: djgpp AT delorie DOT com

Hello,

I have the following question:

Is it possible to define far pointers in djgpp
as I have done in the following example with MSVC++?
And:
If so, which command line parameters do I have to
specify? (e.g.: gcc -v example.c -o example )
Thank you in advance. JSchumann
-----------------------------------------------------

#include <dos.h>
#include <malloc.h>
#include <stdio.h>

void main( void )
{
   void far *p;   /* define pointer */
   unsigned int seg_val;
   unsigned int off_val;

   p = _fmalloc( 100 );         /* example for initialisation of p:
allocate memory */

   seg_val = _FP_SEG( p );      /* get segment- and offset-address */
   off_val = _FP_OFF( p );

   printf("Pointer: %Fp\n" ,p);
   printf("Segment: %.4X\n",seg_val);
   printf("Offset : %.4X\n",off_val);

   _ffree(p);   /* free memory */
}


- Raw text -


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