delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/18/01:46:31

Message-Id: <3.0.1.32.19990718134517.006a72c8@apiitkl.edu.my>
X-Sender: df990244 AT apiitkl DOT edu DOT my
X-Mailer: Windows Eudora Light Version 3.0.1 (32)
Date: Sun, 18 Jul 1999 13:45:17 +0800
To: djgpp AT delorie DOT com
From: Mark <rhosts AT bigfoot DOT com>
Subject: Re: 0xA000 plot pixels questions in 13h mode
Cc: nate AT cartsys DOT com
In-Reply-To: <3791484A.885F939D@cartsys.com>
References: <3 DOT 0 DOT 1 DOT 32 DOT 19990717221010 DOT 00698cd8 AT apiitkl DOT edu DOT my>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Hello Nate (and others),

I understand a lot you explained to me and I realy appreciate it. Hope you
can take som more of my questions.

>> - I noticed that there are lots of functions that look so much like the
above:
>>         _farpokeb
>>         _farpokew
>>         _farnspokew
>>         etc.
>
>You'll notice that the ones with "ns" in the middle don't require the
>segment as one of their args ("ns" = "no segment").  You must select the
>segment first with `_farsetsel' for these.  This is a performance
>advantage but probably not useful when getting started.  The others pass
>the segment each time.

Ok. I think I understand. And I had this working:
_farpokeb(_dos_ds,0xA0000 + y*320+x, color);

_dos_ds is said to be a selector to allow direct access to absolute
addresses. 

- Can this _dos_ds looked at as some kind of 'portal with guardsmen' that
allow 0 to 1 MB addresses? 

- If so ... Are all _farnspokeb(), _farnspokel(), _farnspeekw() etc. codes
using that same 'portal' defined once(?) in a  porgram with
_farsetsel(_dos_ds)?

- Can I just use the same _dos_ds with all my _farpokeb() accesses to those
addresses? Or does _my_ds come in here somewhere?

- And what does the DS mean in _dos_ds?

 
>> - Why are there so many functions that look like they are far or near types
>> ? The compiler is 32bit and in the FAQ stated that DJGPP doesn't even
>> recognise the far and near types ?!?!
>
>Some compilers allow you to specify near and far as part of the pointer,
>like `char far *p'.  GCC (DJGPP's compiler) doesn't-- all pointers are
>effectively near.  These functions are provided to let you access memory
>outside your segment anyway.

I don't realy get this. Where will my pointers become far or remain near?
If I were to declare:
	int i[100], *ptr;
	ptr=i;
Is this within my program's segment or is it going to be far?
If far, ... what would be near?
And if I were to declare:
	unsigned char *double_buffer 
	double_buffer = (unsigned char *)malloc(320*200);
This 'double_buffer' is far, right? 
If there are any differences between the '*ptr' and the 'double_buffer',
what are they?

Regards;
Mark.


- Raw text -


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