delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/03/14/22:05:33

Date: Fri, 14 Mar 2003 22:05:13 -0500
Message-Id: <200303150305.h2F35DG11549@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <G3wca.1706$z_3.763310@news1.news.adelphia.net>
(ken DOT jen AT adelphia DOT net)
Subject: Re: Problems adressing memory variable
References: <RUfca.942$z_3 DOT 477599 AT news1 DOT news DOT adelphia DOT net> <b4s30b$n6o$1 AT antares DOT lu DOT erisoft DOT se> <G3wca.1706$z_3 DOT 763310 AT news1 DOT news DOT adelphia DOT net>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

>  char * disp_str = "Hello!";
>         output.x.bp = ((disp_str[0]) >> 4);
>         output.x.ss = (((disp_str[0]) << 4) >> 4);

Addresses in DJGPP are *not* segment:offset.  They are 32-bit linear
offsets into a protected segment (i.e. all DJGPP programs are TINY
mode, not far mode).  If you want to pass data to a DOS function like
this, you *must* copy the data to DOS memory and calculate the seg:ofs
of that buffer.  You'll need to use something like dosmemput() or
<sys/farptr.h> and the transfer buffer defined in <go32.h>.

- Raw text -


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